:root {
  --bg: #08080a;
  --bg-panel: #0d0d10;
  --bg-titlebar: #131317;
  --surface: #0d0d10;
  --surface-hi: #131317;
  --line: #2a2a30;
  --border-bright: #45454e;
  --text: #f4f5f7;
  --muted: #8a8d96;
  --gold: #e3b24c;
  --teal: #4fb6a8;
  --coral: #dd7a64;
  --violet: #8c86d8;
  --danger: #c81e2e;
  --accent: #c81e2e;
  --green: #4caf6d;
  --blue: #5b8def;
  --pink: #d874a0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plex", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: #c7cbd3;
  text-decoration: underline;
  text-decoration-color: rgba(199, 203, 211, 0.35);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-color: #c7cbd3;
}

a.btn {
  text-decoration: none;
}

.mono {
  font-family: "JBM", monospace;
}

/* --- layout / sidebar --- */

.layout {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  transition: width 0.18s ease, padding 0.18s ease;
}

.sidebar.collapsed {
  width: 60px;
  padding: 18px 10px;
  overflow: visible;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
}

.brand .crest {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
}

.brand .mark {
  font-family: "Gothic", serif;
  font-size: 19px;
  letter-spacing: 0.01em;
  line-height: 1;
  background: linear-gradient(160deg, #f5f6f7 0%, #d8dadd 22%, #9a9ea3 45%, #eef0f1 58%, #6d7175 75%, #c9cccf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.collapse-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-hi);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collapse-btn svg {
  display: block;
  flex-shrink: 0;
}

.collapse-btn:hover {
  color: var(--text);
}

.sidebar.collapsed .collapse-btn svg {
  transform: rotate(180deg);
}

.nav-icon {
  width: 16px;
  flex-shrink: 0;
  text-align: center;
}

.acc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}

.acc-header:hover {
  background: var(--surface-hi);
}

.acc-caret {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.acc-header.open .acc-caret {
  transform: rotate(90deg);
}

.acc-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
  margin-left: 19px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.acc-body.open {
  max-height: 1200px;
}

.acc-body .nav-item {
  font-size: 12.5px;
  padding: 7px 10px;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  font-family: "JBM", monospace;
}

.footer-text {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.footer-text .name {
  color: var(--text);
}

.footer-text .role {
  color: var(--muted);
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .acc-caret,
.sidebar.collapsed .brand .mark,
.sidebar.collapsed .acc-body,
.sidebar.collapsed .footer-text,
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed form[action="/logout"] {
  display: none;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #b6bcc6;
}

.nav-item:hover {
  background: var(--surface-hi);
  color: var(--text);
}

.nav-item.active {
  background: var(--surface-hi);
  color: var(--text);
}

.nav-text {
  font-family: "JBM", monospace;
}

.nav-item .chip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-badge {
  background: var(--coral);
  color: #1c1108;
  font-family: "JBM", monospace;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.chip-tron_wallets {
  background: var(--teal);
}

.chip-gsm_sip {
  background: var(--coral);
}

.acc-header.acc-tron.open {
  color: var(--teal);
}

.acc-header.acc-gsm.open {
  color: var(--coral);
}

.period-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

.period-card .label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.period-card .value {
  font-family: "JBM", monospace;
  font-size: 13px;
}

.main {
  flex: 1;
  padding: 30px 36px;
  max-width: 1000px;
}

.auth-page .main {
  max-width: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- hero --- */

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.hero .eyebrow {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.hero .total {
  font-family: "JBM", monospace;
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
}

.hero .total .unit {
  color: var(--muted);
  font-size: 22px;
  font-weight: 500;
}

.hero .sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
}

.hero .sub b {
  color: var(--text);
  font-weight: 500;
}

/* --- pulse strip --- */

.pulse {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 46px;
  margin: 18px 0 26px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.pulse .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--accent), #4a0e15);
  border-radius: 3px;
  opacity: 0.85;
  min-height: 3px;
}

.pulse .bar.low {
  background: linear-gradient(180deg, #3a3e48, #262930);
  opacity: 0.6;
}

.pulse .bar.today {
  background: linear-gradient(180deg, #ef4a54, var(--accent));
  opacity: 1;
}

.section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
}

/* --- tx list (feed) --- */

.tx-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tx {
  display: grid;
  grid-template-columns: 34px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border-radius: 9px;
}

.tx:hover {
  background: var(--surface);
}

.tx .icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.icon-tron_wallets {
  background: rgba(79, 182, 168, 0.15);
  color: var(--teal);
}

.icon-gsm_sip {
  background: rgba(221, 122, 100, 0.15);
  color: var(--coral);
}

.tx .info {
  min-width: 0;
}

.tx .info .name {
  font-size: 13.5px;
  font-weight: 500;
}

.tx .info .meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.tx .cat {
  font-size: 11px;
  color: var(--muted);
  font-family: "JBM", monospace;
  white-space: nowrap;
}

.tx .status {
  font-family: "JBM", monospace;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.legend {
  display: flex;
  gap: 16px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.legend .item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--muted);
}

.legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* --- generic components --- */

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 18px 40px -22px rgba(0, 0, 0, 0.8);
}

form.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 360px;
}

input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}

textarea {
  resize: vertical;
}

button {
  background: var(--accent);
  color: #fff2f2;
  border: none;
  font-family: "Plex", sans-serif;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13.5px;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 500;
}

button.primary {
  background: var(--teal);
  color: #08211d;
}

button.violet {
  background: var(--violet);
  color: #1c1834;
}

button.danger {
  background: var(--coral);
  color: #2b1108;
}

a.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff2f2;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13.5px;
}

a.btn:hover {
  opacity: 0.9;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

th, td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

th {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-top: 4px;
  padding-bottom: 10px;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

.error {
  color: var(--danger);
  margin-bottom: 8px;
}

.checkbox-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

/* --- status pills --- */

.pill {
  display: inline-block;
  font-family: "JBM", monospace;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-bright);
  white-space: nowrap;
}

.pill-pending { background: rgba(227, 178, 76, 0.15); color: var(--gold); }
.pill-confirmed { background: rgba(79, 182, 168, 0.15); color: var(--teal); }
.pill-completed { background: rgba(140, 134, 216, 0.18); color: var(--violet); }
.pill-rejected, .pill-cancelled { background: rgba(221, 122, 100, 0.15); color: var(--coral); }

.pill-unpaid { background: rgba(134, 140, 151, 0.15); color: var(--muted); }
.pill-checking { background: rgba(227, 178, 76, 0.15); color: var(--gold); }
.pill-paid { background: rgba(79, 182, 168, 0.15); color: var(--teal); }
.pill-mismatch { background: rgba(221, 122, 100, 0.15); color: var(--coral); }

/* --- page header (team pages) --- */

.page-title {
  font-family: "Plex", sans-serif;
  font-size: 22px;
  font-weight: 600;
  margin: 4px 0 20px;
}

/* --- toolbar (secondary controls above a table, e.g. status filter) --- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.toolbar-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  flex-shrink: 0;
}

/* --- status filter row --- */

.status-filter {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.status-filter a {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
}

.status-filter a:hover {
  color: var(--text);
}

.status-filter a.active {
  background: var(--surface-hi);
  color: var(--text);
  border-color: var(--surface-hi);
}

/* --- sensitive content (SIP credentials) --- */

.secret {
  font-family: "JBM", monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  border: 1px solid var(--coral);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
}

/* --- misc table helpers --- */

.num {
  font-family: "JBM", monospace;
  font-weight: 500;
}

.copy-addr {
  cursor: pointer;
  color: #c7cbd3;
  border-bottom: 1px dashed rgba(199, 203, 211, 0.3);
}

.copy-addr:hover {
  border-bottom-color: #c7cbd3;
}

.copy-addr.copied {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.text-right {
  text-align: right;
}

.actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.actions-row form {
  display: inline;
}

/* --- inline per-row actions in list tables (orders list, payments queue) --- */

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

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.row-actions form {
  display: inline-flex;
}

button.row-btn {
  padding: 5px 9px;
  font-size: 11.5px;
  border-radius: 6px;
  white-space: nowrap;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 500;
}

button.row-btn:hover {
  border-color: #3a3f4a;
}

button.row-btn.primary {
  border-color: rgba(79, 182, 168, 0.35);
  color: var(--teal);
}

button.row-btn.primary:hover {
  border-color: var(--teal);
  background: rgba(79, 182, 168, 0.08);
}

button.row-btn.danger {
  border-color: rgba(221, 122, 100, 0.35);
  color: var(--coral);
}

button.row-btn.danger:hover {
  border-color: var(--coral);
  background: rgba(221, 122, 100, 0.08);
}

button.row-btn.violet {
  border-color: rgba(140, 134, 216, 0.35);
  color: var(--violet);
}

button.row-btn.violet:hover {
  border-color: var(--violet);
  background: rgba(140, 134, 216, 0.08);
}

.row-hash-form {
  display: inline-flex;
  gap: 4px;
}

.row-hash-input {
  width: 84px;
  padding: 5px 7px !important;
  font-size: 11.5px !important;
}

/* --- stats page --- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-tile {
  padding: 18px;
}

.stat-tile .total.num-green { color: var(--green); }
.stat-tile .total.num-blue { color: var(--blue); }
.stat-tile .total.num-purple { color: var(--violet); }
.stat-tile .total.num-red { color: var(--danger); }
.stat-tile .total.num-yellow { color: var(--gold); }
.stat-tile .total.num-pink { color: var(--pink); }

.status-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* --- narrow viewports: sidebar stacks above content instead of squeezing it --- */

.hidden-row {
  display: none;
}

/* --- SIP tile grid, grouped by base --- */

.sip-base-group {
  margin-bottom: 16px;
}

.sip-base-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.sip-base-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-hi);
  overflow: hidden;
  margin-bottom: 4px;
}

.sip-base-progress-bar {
  height: 100%;
  background: var(--teal);
  border-radius: 2px;
  transition: width 0.2s ease;
}

.sip-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
}

/* Colors/behavior matched 1:1 against the live ASGARD CRM (.sip-brick) —
   click anywhere on the tile toggles selection (orange ring), a small gear
   button opens the account detail page without triggering selection. */
.sip-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border: 2px solid;
  border-radius: 7px;
  cursor: pointer;
  transition: 0.12s;
  font-weight: 800;
  user-select: none;
}

.sip-tile:hover {
  transform: translateY(-1px);
  filter: brightness(1.2);
}

.sip-tile.free {
  border-color: #3ecf8e;
  color: #3ecf8e;
  background: rgba(62, 207, 142, 0.08);
}

.sip-tile.assigned {
  border-color: #4a9eff;
  color: #4a9eff;
  background: rgba(74, 158, 255, 0.1);
}

.sip-tile.broken {
  border-color: #e05252;
  color: #e05252;
  background: rgba(224, 82, 82, 0.08);
}

.sip-tile.selected {
  box-shadow: 0 0 0 3px rgba(224, 130, 82, 0.6);
  background: rgba(224, 130, 82, 0.2) !important;
}

.sip-tile .ext {
  font-family: "JBM", monospace;
  font-size: 13px;
  font-weight: 800;
}

.sip-tile .assignee {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  font-size: 8px;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 3px;
  opacity: 0.8;
}

.sip-gear {
  position: absolute;
  top: 1px;
  right: 2px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 9px;
  opacity: 0.7;
  color: inherit;
  padding: 0;
  line-height: 1;
}

.sip-gear:hover {
  opacity: 1;
}

/* --- client card grid --- */

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.client-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.client-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-card-stats {
  display: flex;
  gap: 16px;
  font-size: 12.5px;
}

.client-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.client-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* --- toggle switch (settings on/off rows) --- */

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-row .toggle-label {
  font-size: 13.5px;
  font-weight: 500;
}

.toggle-row .toggle-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .track {
  position: absolute;
  inset: 0;
  background: var(--line);
  border-radius: 999px;
  transition: background 0.15s ease;
}

.toggle-switch .track::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #c7cbd3;
  border-radius: 50%;
  transition: transform 0.15s ease, background 0.15s ease;
}

.toggle-switch input:checked + .track {
  background: rgba(79, 182, 168, 0.4);
}

.toggle-switch input:checked + .track::before {
  transform: translateX(16px);
  background: var(--teal);
}

.toggle-switch.danger input:checked + .track {
  background: rgba(221, 122, 100, 0.4);
}

.toggle-switch.danger input:checked + .track::before {
  background: var(--coral);
}

/* --- always-on info row (flood/scam protection, non-editable) --- */

.always-on-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.always-on-row:last-child {
  border-bottom: none;
}

.always-on-badge {
  font-size: 11px;
  color: var(--teal);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 820px) {
  .layout {
    flex-direction: column;
  }

  .sidebar,
  .sidebar.collapsed {
    width: 100%;
    padding: 14px 16px;
  }

  .sidebar-footer {
    margin-top: 0;
  }

  .main {
    max-width: none;
    padding: 20px;
  }

  .settings-grid {
    grid-template-columns: 1fr !important;
  }
}

/* --- terminal-window card + role-tag/avail-chip components ---
   Ported from the services-boss mini-app design. Not wired into any
   business template yet (phase 2) — available for future pages that
   want the full titlebar-dots treatment instead of the plain .card. */

.term {
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 18px 40px -22px rgba(0, 0, 0, 0.8);
}

.term-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--bg-titlebar);
  border-bottom: 1px solid var(--line);
}

.term-titlebar .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  opacity: 0.85;
  flex-shrink: 0;
}

.term-titlebar .dot.r,
.term-titlebar .dot.g {
  background: var(--accent);
}

.term-titlebar .dot.y {
  background: var(--muted);
}

.term-path {
  margin-left: 6px;
  font-family: "JBM", monospace;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-status {
  margin-left: auto;
  font-family: "JBM", monospace;
  font-size: 10.5px;
  color: var(--accent);
}

.term-status::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 5px 1px var(--accent);
  margin-right: 5px;
}

.term-body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.term-body h2 {
  font-family: "Plex", sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  margin: 0;
}

.term-body p {
  font-family: "Plex", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

.term-toggle {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.term-toggle .label {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.term-toggle .chevron {
  color: var(--muted);
  font-size: 11px;
  transition: transform 0.25s ease;
}

.term-toggle.open .chevron {
  transform: rotate(180deg);
}

.term-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s ease;
}

.term-panel.open {
  grid-template-rows: 1fr;
}

.term-panel-inner {
  overflow: hidden;
  min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
  .term-panel { transition: none; }
  .term-toggle .chevron { transition: none; }
}

.role-tag {
  font-family: "JBM", monospace;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
}

.role-tag::before { content: "["; }
.role-tag::after { content: "]"; }

.avail-label {
  margin-top: 12px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.avail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.avail-chip {
  font-family: "JBM", monospace;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--text);
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  padding: 4px 9px;
  white-space: nowrap;
}

.avail-chip::before { content: "["; color: var(--muted); }
.avail-chip::after { content: "]"; color: var(--muted); }

/* --- matrix rain background --- */

#rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.09;
  pointer-events: none;
  z-index: 0;
}

/* --- boot overlay --- */

#boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.6s ease;
  cursor: pointer;
}

#boot.hidden {
  opacity: 0;
  pointer-events: none;
}

.boot-inner {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 140px;
}

.scanbar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--text);
  box-shadow: 0 0 8px 1px var(--text), 0 0 24px 4px rgba(200, 30, 46, 0.45);
  transform: translateY(0);
}

@media (prefers-reduced-motion: no-preference) {
  .scanbar.run {
    animation: sweep 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
}

@keyframes sweep {
  from { transform: translateY(0); }
  to { transform: translateY(138px); }
}

.boot-lines {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 28px;
}

.boot-line {
  font-family: "JBM", monospace;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--text);
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
}

.boot-line.show { opacity: 1; }

.boot-line .prompt { color: var(--muted); margin-right: 8px; }

.boot-hint {
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.boot-crest {
  display: flex;
  justify-content: center;
  margin-top: 18px;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.boot-crest.show { opacity: 0.85; }
.boot-crest svg { width: 36px; height: 36px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7)); }

#app {
  opacity: 0;
  transition: opacity 0.7s ease;
}

#app.show { opacity: 1; }
