:root {
  color-scheme: dark;
  --bg: #000000;
  --panel: #0b0c0a;
  --panel-2: #10120f;
  --panel-grad-1: rgba(16, 18, 15, 0.96);
  --panel-grad-2: rgba(5, 7, 6, 0.96);
  --surface: #0d1110;
  --surface-strong: #030504;
  --rail-bg: #040605;
  --track: #111915;
  --line: #27302a;
  --line-hot: #00e676;
  --text: #ecf4ee;
  --text-soft: #d7e3dc;
  --muted: #8d9a91;
  --dim: #59645d;
  --green: #00e676;
  --cyan: #00b8ff;
  --amber: #ffb800;
  --red: #ff3b30;
  --brand: #5cdcff;
  --grid-line-1: rgba(0, 230, 118, 0.035);
  --grid-line-2: rgba(0, 230, 118, 0.025);
  --shadow: rgba(0, 0, 0, 0.55);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1ee;
  --panel: #ffffff;
  --panel-2: #f4f6f4;
  --panel-grad-1: rgba(255, 255, 255, 0.98);
  --panel-grad-2: rgba(244, 246, 244, 0.98);
  --surface: #ffffff;
  --surface-strong: #e4e9e4;
  --rail-bg: #e7ece7;
  --track: #dde3dd;
  --line: #ccd4cc;
  --line-hot: #0aa15c;
  --text: #16201a;
  --text-soft: #2b362f;
  --muted: #5b6a60;
  --dim: #8a988e;
  --green: #0aa15c;
  --cyan: #0090c7;
  --amber: #a5680a;
  --red: #c13327;
  --brand: #0090c7;
  --grid-line-1: rgba(10, 161, 92, 0.05);
  --grid-line-2: rgba(10, 161, 92, 0.04);
  --shadow: rgba(20, 30, 24, 0.18);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #eef1ee;
    --panel: #ffffff;
    --panel-2: #f4f6f4;
    --panel-grad-1: rgba(255, 255, 255, 0.98);
    --panel-grad-2: rgba(244, 246, 244, 0.98);
    --surface: #ffffff;
    --surface-strong: #e4e9e4;
    --rail-bg: #e7ece7;
    --track: #dde3dd;
    --line: #ccd4cc;
    --line-hot: #0aa15c;
    --text: #16201a;
    --text-soft: #2b362f;
    --muted: #5b6a60;
    --dim: #8a988e;
    --green: #0aa15c;
    --cyan: #0090c7;
    --amber: #a5680a;
    --red: #c13327;
    --brand: #0090c7;
    --grid-line-1: rgba(10, 161, 92, 0.05);
    --grid-line-2: rgba(10, 161, 92, 0.04);
    --shadow: rgba(20, 30, 24, 0.18);
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans Mono", "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  min-height: 32px;
  padding: 0 12px;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  border-color: var(--cyan);
  outline: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr) auto;
  background:
    linear-gradient(var(--grid-line-1) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-2) 1px, transparent 1px),
    var(--bg);
  background-size: 24px 24px;
}

.topbar {
  display: grid;
  grid-template-columns: 250px minmax(320px, 1fr) auto auto auto auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
  padding: 0 12px;
  min-width: 0;
}

.brand {
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}

.prompt-mark {
  color: var(--cyan);
  font-weight: 700;
}

.selectors {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.dropdown {
  position: relative;
  min-width: 0;
}

.select-like {
  min-width: 118px;
  width: 100%;
  text-align: left;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.select-like .select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  font-size: 11px;
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 0.15s ease, color 0.15s ease;
}

.select-like[aria-expanded="true"] {
  border-color: var(--cyan);
}

.select-like[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
  color: var(--cyan);
}

.select-like.wide {
  min-width: 290px;
}

.run-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-weight: 700;
}

.run-status.paused {
  color: var(--amber);
}

.dot {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--green);
}

.run-status.paused .dot {
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
  animation: none;
}

.meta {
  color: var(--text-soft);
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.username-badge {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.username-badge:empty {
  display: none;
}

.icon-btn {
  width: 32px;
  min-width: 0;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}

a.icon-btn {
  height: 32px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  text-decoration: none;
}

a.icon-btn:hover {
  border-color: var(--cyan);
}

.icon-btn i.bi {
  font-size: 16px;
  line-height: 1;
}

.icon-btn:hover i.bi {
  color: var(--cyan);
}

.main-grid {
  display: grid;
  grid-template-columns: 64px minmax(260px, 300px) minmax(560px, 1fr) minmax(480px, 1.2fr);
  min-height: 0;
}

.rail {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--rail-bg);
}

.rail button {
  min-height: 78px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.rail button i.bi {
  font-size: 20px;
  line-height: 1;
}

.rail button span {
  font-size: 9px;
  text-align: center;
  line-height: 1.3;
}

.rail button.active {
  color: var(--cyan);
  background: rgba(0, 184, 255, 0.08);
  border-left: 3px solid var(--cyan);
}

.rail-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line) !important;
}

.left-panel,
.center-panel,
.right-panel {
  min-width: 0;
  min-height: 0;
}

.left-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  border-right: 1px solid var(--line);
  overflow: hidden;
  background: rgba(11, 12, 10, 0.05);
}

.center-panel {
  display: grid;
  grid-template-rows: auto minmax(250px, 42%) minmax(260px, 1fr);
  gap: 7px;
  padding: 10px;
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.runtime-error {
  grid-row: 1;
  border: 1px solid var(--red);
  background: rgba(255, 59, 48, 0.1);
  color: var(--text);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  min-height: 42px;
}

.runtime-error > i {
  color: var(--red);
  font-size: 16px;
}

.runtime-error span {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.right-panel {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  overflow: hidden;
}

.panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-grad-1), var(--panel-grad-2));
  min-width: 0;
}

.left-panel .panel {
  border-width: 0 0 1px 0;
  padding: 14px;
  min-height: 0;
  overflow: auto;
  transition: box-shadow 0.2s ease;
}

.left-panel .panel[hidden] {
  display: none !important;
}

.left-panel .panel.active-left-panel {
  display: block;
}

.left-panel .panel.flash {
  box-shadow: inset 0 0 0 1px var(--cyan);
}

.panel-title {
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 8px;
}

.left-panel .panel-title {
  font-size: 15px;
  margin-bottom: 12px;
}

.section-kicker {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.run-card-inner {
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 12px;
}

.run-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.round-control {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--green);
  border-color: var(--green);
}

.round-control i.bi {
  font-size: 18px;
}

.round-control.paused {
  color: var(--amber);
  border-color: var(--amber);
}

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

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

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

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

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

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.metric-row div {
  padding: 9px 7px;
  border-right: 1px solid var(--line);
}

.metric-row div:last-child {
  border-right: 0;
}

.metric-row span,
.usage-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 4px;
}

.metric-row strong,
.usage-grid strong {
  font-size: 14px;
  font-weight: 700;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  color: var(--text-soft);
  margin-bottom: 8px;
  font-size: 11px;
}

.bar {
  height: 7px;
  border: 1px solid var(--line);
  background: var(--track);
  overflow: hidden;
  margin-bottom: 8px;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
  transition: width 0.3s ease;
}

.bar.small {
  height: 6px;
  margin: 8px 0 0;
}

.bar.small span {
  background: var(--green);
  box-shadow: none;
}

/* "Đang xử lý" trong Tổng quan — hiện tool/subagent đang chạy dở, cập nhật theo sự kiện TOOL/
   DISPATCH chưa có FinishedAt trên Event Timeline (xem app.js: renderCurrentActivity). Mục
   đích: những lúc agent xử lý lâu (vd. draft_chapter cả phút) mà Live Stream không in gì,
   người dùng vẫn thấy hệ thống đang làm việc thay vì tưởng bị treo. */
.current-activity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(0, 184, 255, 0.35);
  background: rgba(0, 184, 255, 0.08);
  font-size: 11px;
  color: var(--cyan);
  overflow: hidden;
}

.current-activity span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  animation: activity-pulse 1.2s ease-in-out infinite;
}

@keyframes activity-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

/* Trạng thái loading cho các panel nạp dữ liệu bất đồng bộ lúc mở truyện (Event Timeline, danh
   sách chương, model khả dụng, nhân vật...) — hiển thị ngay khi trang mở, được chính hàm render
   tương ứng ghi đè khi dữ liệu thật (hoặc trạng thái rỗng thật) sẵn sàng. */
.panel-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  color: var(--muted);
  font-size: 11px;
}

.panel-loading-spinner {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: panel-spin 0.7s linear infinite;
}

@keyframes panel-spin {
  to { transform: rotate(360deg); }
}

.credit-title {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.credit-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: 11px;
  color: var(--text-soft);
}

.credit-block strong {
  color: var(--cyan);
  font-size: 13px;
}

.current-model-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: var(--text-soft);
}

.current-model-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
}

.current-model-price {
  color: var(--amber);
}

.current-model-row strong {
  color: var(--text);
  font-weight: 700;
}

/* Tooltip thông tin model — hiện khi hover một dòng model (popup chọn model hoặc danh sách
   "Model khả dụng"). Cao hơn cả .dropdown-menu (140) vì thường mở cạnh nó. */
.model-tooltip {
  position: fixed;
  z-index: 150;
  max-width: 300px;
  background: var(--surface-strong);
  border: 1px solid var(--cyan);
  box-shadow: 0 16px 40px var(--shadow);
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text-soft);
  pointer-events: none;
}

.model-tooltip-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 4px;
}

.model-tooltip-price {
  color: var(--amber);
  margin-bottom: 6px;
}

.model-tooltip-row {
  margin-top: 4px;
  line-height: 1.5;
}

.model-tooltip-row strong {
  color: var(--text);
}

.agent-list {
  display: grid;
  gap: 7px;
}

.agent {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid rgba(140, 150, 140, 0.2);
  padding-bottom: 8px;
}

.agent:last-child {
  border-bottom: 0;
}

.agent-badge {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--cyan);
  font-size: 10px;
}

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

.agent-task {
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}

.agent-state {
  color: var(--green);
  font-size: 10px;
}

.agent-state.waiting {
  color: var(--amber);
}

.agent-state.paused {
  color: var(--dim);
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.usage-grid > div {
  border: 1px solid var(--line);
  padding: 9px;
  min-height: 56px;
}

.usage-grid .wide-stat {
  grid-column: span 2;
}

.model-usage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}

.model-usage-head span {
  color: var(--muted);
}

.model-usage-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.model-usage-row {
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 10px;
  min-width: 0;
}

.model-usage-row.current {
  /* Ghim lên đầu danh sách + nền tương phản (xem app.js: renderModelUsage sắp xếp current lên
     trước) — trước đây chỉ đổi màu viền, khó nhận ra giữa danh sách dài nhiều model. */
  border-color: var(--cyan);
  background: rgba(0, 184, 255, 0.14);
  box-shadow: 0 0 0 1px var(--cyan) inset;
}

.model-usage-row.limited {
  border-color: rgba(255, 184, 0, 0.55);
}

.model-usage-main {
  min-width: 0;
}

.model-usage-main strong,
.model-usage-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-usage-main strong {
  color: var(--text);
  white-space: nowrap;
}

.model-usage-main span {
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}

.model-usage-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.status-pill,
.billing-pill {
  border: 1px solid var(--line);
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 700;
}

.status-pill.current {
  color: var(--cyan);
  border-color: var(--cyan);
}

.status-pill.available {
  color: var(--green);
  border-color: rgba(0, 230, 118, 0.45);
}

.status-pill.limited {
  color: var(--amber);
  border-color: rgba(255, 184, 0, 0.55);
}

.billing-pill.free {
  color: var(--green);
}

.billing-pill.paid {
  color: var(--amber);
}

.model-usage-row dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 0;
}

.model-usage-row dl div {
  min-width: 0;
}

.model-usage-row dt {
  color: var(--muted);
  font-size: 10px;
}

.model-usage-row dd {
  margin: 2px 0 0;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-list {
  margin: 0;
}

.context-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(140, 150, 140, 0.2);
  padding: 7px 0;
}

.context-list dt {
  color: var(--muted);
}

.context-list dd {
  margin: 0;
  text-align: right;
}

.panel-heading {
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
}

.panel-heading .panel-title {
  margin: 0 auto 0 0;
}

.panel-heading label {
  color: var(--text-soft);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.panel-heading button {
  min-height: 26px;
  padding: 0 9px;
  color: var(--muted);
}

.event-panel {
  grid-row: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.events-scroll {
  overflow: auto;
  min-height: 0;
}

.events-table {
  width: 100%;
  border-collapse: collapse;
}

.events-table th,
.events-table td {
  border-bottom: 1px solid rgba(140, 150, 140, 0.2);
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}

.events-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  background: var(--surface-strong);
}

.events-table td:last-child {
  white-space: normal;
  overflow-wrap: anywhere;
}

.events-table .empty-row td {
  color: var(--dim);
  text-align: center;
  padding: 20px;
}

/* Event Timeline (index.html) là bảng duy nhất cần table-layout: fixed + cột đầu hẹp
   cố định — 3 cột đầu (Time/Level/Agent) luôn ngắn, chỉ cột Event cần co giãn.
   Đã từng đặt các quy tắc này thẳng trên .events-table dùng chung, khiến bảng "Người
   dùng"/"Nhật ký truy cập" ở admin.html (5 và 4 cột, nội dung khác hẳn) bị ép vào đúng
   3 mốc rộng 84/64/92px đó → badge/text tràn ra ngoài, đè lên cột kế bên. Scope lại theo
   .events-scroll (chỉ bọc bảng timeline) để không ảnh hưởng các bảng .events-table khác. */
.events-scroll .events-table {
  table-layout: fixed;
}

.events-scroll .events-table th:nth-child(1),
.events-scroll .events-table td:nth-child(1) {
  width: 84px;
}

.events-scroll .events-table th:nth-child(2),
.events-scroll .events-table td:nth-child(2) {
  width: 64px;
}

.events-scroll .events-table th:nth-child(3),
.events-scroll .events-table td:nth-child(3) {
  width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stream-panel {
  grid-row: 3;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

/* Live Stream — giao diện chat: mỗi lần agent đổi lượt (SSE 'agent') là một .stream-bubble mới,
   token tiếp theo chỉ append vào .stream-bubble-text của bong bóng cuối (xem app.js:appendStream)
   — không rebuild toàn bộ danh sách mỗi token, giữ hiệu năng khi stream nhiều token/giây. */
#streamOutput {
  margin: 0;
  padding: 12px;
  height: 100%;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stream-bubble {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  background: var(--surface);
  padding: 8px 12px;
  max-width: 92%;
}

.stream-bubble-header {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stream-bubble-text {
  font-family: inherit;
  white-space: pre-wrap;
  line-height: 1.62;
  color: var(--text-soft);
}

#streamOutput.nowrap .stream-bubble-text {
  white-space: pre;
}

.stream-bubble:has(.tag-writer) {
  border-left-color: var(--cyan);
}

.stream-bubble:has(.tag-architect) {
  border-left-color: #b083ff;
}

.stream-bubble:has(.tag-coordinator) {
  border-left-color: var(--amber);
  align-self: flex-end;
}

.stream-bubble:has(.tag-editor) {
  border-left-color: var(--green);
}

.tag-writer {
  color: var(--cyan);
}

.tag-architect {
  color: #b083ff;
}

.tag-coordinator {
  color: var(--amber);
}

.tag-editor {
  color: var(--green);
}

.tag-you {
  color: var(--brand);
}

/* Chỉ báo "đang chạy" trong Live Stream (xem app.js: updateLiveStepIndicator) — MỘT dòng duy nhất,
   tự cập nhật tại chỗ (không tạo dòng mới mỗi giây/mỗi bước), hiện đúng lúc đang chờ (Router vừa
   giao việc / một tool đang chạy) và tự ẩn ngay khi model bắt đầu nhả token thật. Cố ý không dùng
   style bong bóng chat — chấm nhấp nháy + nền mờ để phân biệt ngay đây là trạng thái "đang chờ",
   không phải lời agent — nhưng vẫn full-width, không cắt ngắn text như ô "Đang xử lý" cũ ở Tổng
   quan (.current-activity dùng text-overflow:ellipsis, panel đó quá hẹp). */
.stream-step {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px dashed rgba(0, 184, 255, 0.35);
  background: rgba(0, 184, 255, 0.06);
  font-size: 11px;
  color: var(--cyan);
}

.stream-step-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  animation: activity-pulse 1.2s ease-in-out infinite;
}

.stream-step-text {
  white-space: pre-wrap;
  line-height: 1.5;
}

.tabs {
  display: flex;
  align-items: end;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
  padding-left: 12px;
}

.tabs button {
  border-width: 0 1px 0 0;
  min-width: 96px;
  background: transparent;
}

.tabs button.active {
  color: var(--cyan);
  border: 1px solid var(--cyan);
  border-bottom-color: var(--surface-strong);
  margin-bottom: -1px;
}

.tab-panel {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.reader-grid {
  display: grid;
  grid-template-columns: minmax(170px, 34%) minmax(0, 1fr);
  min-height: 0;
  height: 100%;
}

.chapter-list {
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.chapter-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.chapter-list-head span {
  color: var(--green);
  border: 1px solid rgba(10, 161, 92, 0.4);
  padding: 3px 8px;
  font-size: 10px;
}

.chapter-list-head span.in-progress {
  color: var(--amber);
  border-color: rgba(255, 184, 0, 0.4);
}

#chapterList {
  overflow: auto;
}

.chapter-item {
  border-bottom: 1px solid rgba(140, 150, 140, 0.2);
  padding: 12px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: block;
  color: var(--text-soft);
}

.chapter-item:hover {
  border-color: var(--line);
  background: rgba(0, 184, 255, 0.05);
}

.chapter-item.active {
  color: var(--cyan);
  border-left: 3px solid var(--cyan);
  background: rgba(0, 184, 255, 0.08);
}

.chapter-item span {
  /* Kẹp tối đa 2 dòng — tiêu đề/dòng đầu chương đôi khi dài bất thường (chương thiếu heading
     rõ ràng khiến firstLine() lấy nguyên cả đoạn văn đầu, xem internal/entry/web/session.go),
     nếu không giới hạn thì hàng chapter trong danh sách bên trái sẽ cao bất định. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  margin-top: 6px;
}

.chapter-item .ok,
.chapter-item .pending,
.chapter-item .writing {
  float: right;
  margin: 2px 0 0 8px;
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.chapter-item .ok {
  color: var(--green);
  background: radial-gradient(circle at center, var(--green) 0 3px, transparent 4px);
}

.chapter-item .pending {
  color: var(--muted);
}

.chapter-item .writing {
  color: var(--amber);
  background: radial-gradient(circle at center, var(--amber) 0 3px, transparent 4px);
  animation: pulse-writing 1.2s ease-in-out infinite;
}

@keyframes pulse-writing {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.chapter-reader {
  position: relative;
  padding: 20px 28px;
  overflow: auto;
  line-height: 1.7;
  height: 100%;
}

.chapter-reader h1 {
  margin: 0 0 12px;
  font-size: 24px;
}

.chapter-reader h2,
.chapter-reader h3 {
  margin: 26px 0 10px;
}

.chapter-reader p {
  color: var(--text-soft);
}

.chapter-reader blockquote {
  margin: 22px 0;
  border-left: 3px solid var(--cyan);
  padding-left: 16px;
  color: var(--text-soft);
}

.chapter-reader footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin-top: 28px;
  padding-top: 14px;
}

.chapter-reader .empty-state {
  color: var(--muted);
  padding: 40px 0;
}

.chapter-reader .empty-state button {
  margin-top: 14px;
}

.story-scroll {
  overflow: auto;
  height: 100%;
  padding: 14px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.story-block {
  padding: 14px;
}

.story-title {
  margin: 4px 0 8px;
  font-size: 20px;
}

.story-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.story-tags span {
  border: 1px solid var(--line);
  padding: 3px 9px;
  font-size: 10px;
  color: var(--muted);
}

.story-logline {
  color: var(--text-soft);
  margin: 0;
}

.story-outline {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--text-soft);
}

.story-characters {
  display: grid;
  gap: 8px;
}

.story-character {
  border: 1px solid var(--line);
  padding: 10px;
}

.story-character strong {
  display: block;
}

.story-character span {
  color: var(--muted);
  display: block;
  margin-top: 3px;
  font-size: 11px;
}

.file-reader {
  padding: 0;
}

.file-preview {
  margin: 0;
  padding: 16px;
  font-family: inherit;
  height: 100%;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--text-soft);
}

.file-item {
  border-bottom: 1px solid rgba(140, 150, 140, 0.2);
  padding: 10px 12px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: block;
  color: var(--text-soft);
}

.file-item:hover {
  background: rgba(0, 184, 255, 0.05);
}

.file-item .fname {
  display: block;
}

.file-item .fmeta {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}

.file-item.active {
  color: var(--cyan);
  border-left: 3px solid var(--cyan);
  background: rgba(0, 184, 255, 0.08);
}

.commandbar {
  display: grid;
  grid-template-columns: 46px minmax(240px, 1fr) 116px 116px 136px 136px;
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--line);
  background: var(--surface-strong);
  padding: 10px 14px;
}

.commandbar textarea {
  min-width: 0;
  min-height: 46px;
  max-height: 200px;
  resize: none;
  overflow-y: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 12px 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.commandbar textarea::placeholder {
  color: var(--dim);
}

.commandbar button {
  height: 46px;
  flex-shrink: 0;
  font-size: 14px;
}

.commandbar .primary {
  color: var(--brand);
  border-color: var(--cyan);
  box-shadow: inset 0 0 24px rgba(0, 184, 255, 0.12);
}

.terminal-button {
  padding: 0;
  color: var(--text-soft);
}

/* Floating dropdown menu (provider / model / export) */
.dropdown-menu {
  position: fixed;
  min-width: 200px;
  max-height: 280px;
  overflow: auto;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px var(--shadow);
  /* Cao hơn .modal (131) — dropdown model trong popup "Truyện mới" mở TỪ BÊN TRONG modal, nếu
     thấp hơn .modal-backdrop (130) thì click sẽ rơi xuyên qua backdrop (đóng luôn modal) dù mắt
     vẫn thấy danh sách phía dưới lớp backdrop mờ. */
  z-index: 140;
  list-style: none;
  margin: 0;
  padding: 4px;
}

.dropdown-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  padding: 8px 10px;
  min-height: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.menu-label-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.menu-label-row .billing-pill {
  flex: 0 0 auto;
}

.dropdown-menu button small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
  white-space: normal;
}

.dropdown-menu button:hover,
.dropdown-menu button:focus-visible {
  background: rgba(0, 184, 255, 0.12);
  color: var(--text);
  border-color: transparent;
}

.dropdown-menu button.selected {
  background: var(--cyan);
  color: var(--surface-strong);
  font-weight: 700;
}

.dropdown-menu button.selected small {
  color: var(--surface-strong);
  opacity: 0.8;
}

.dropdown-menu .menu-divider {
  border-top: 1px solid var(--line);
  margin: 4px 2px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 130;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 92vw);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  z-index: 131;
  box-shadow: 0 24px 64px var(--shadow);
}

.modal.modal-lg {
  width: min(720px, 94vw);
}

.new-novel-prompt {
  min-height: 220px;
  resize: vertical;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px;
  font: inherit;
  line-height: 1.6;
}

.new-novel-prompt::placeholder {
  color: var(--muted);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.diag-list {
  margin: 0;
  padding: 14px;
  display: grid;
  gap: 10px;
  overflow: auto;
}

.diag-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(140, 150, 140, 0.2);
  padding-bottom: 8px;
}

.diag-list dt {
  color: var(--muted);
}

.diag-list dd {
  margin: 0;
  text-align: right;
}

.diag-report {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  color: var(--text-soft);
  max-height: 60vh;
  overflow: auto;
}

.settings-body {
  padding: 14px;
  display: grid;
  gap: 14px;
  overflow: auto;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-row input[type="number"] {
  width: 90px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 8px;
}

.settings-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.segmented {
  display: flex;
  border: 1px solid var(--line);
}

.segmented button {
  border: 0;
  min-height: 28px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: rgba(0, 184, 255, 0.15);
  color: var(--cyan);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

/* Toasts */
.toast-stack {
  position: fixed;
  bottom: 88px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 140;
  max-width: min(320px, 80vw);
}

.toast {
  background: var(--surface-strong);
  border: 1px solid var(--cyan);
  color: var(--text);
  padding: 10px 14px;
  font-size: 12px;
  box-shadow: 0 8px 24px var(--shadow);
  animation: toast-in 0.15s ease;
}

.toast.error {
  border-color: var(--red);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: 220px minmax(280px, 1fr) auto;
  }

  .meta,
  .top-actions {
    display: none;
  }

  .main-grid {
    grid-template-columns: 58px 250px minmax(400px, 1fr);
  }

  .right-panel {
    display: none;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-rows: auto minmax(0, 1fr) 68px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 10px 12px;
  }

  .selectors {
    grid-column: 1 / -1;
    order: 3;
  }

  .select-like,
  .select-like.wide {
    min-width: 0;
    flex: 1 1 0;
  }
}

@media (max-width: 860px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .app-shell {
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: auto;
    min-height: 100vh;
  }

  .topbar,
  .commandbar {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
  }

  .selectors {
    flex-direction: column;
  }

  .rail {
    display: none;
  }

  .main-grid {
    display: block;
    min-height: auto;
  }

  .left-panel,
  .center-panel,
  .right-panel {
    display: block;
    border-right: 0;
    overflow: visible;
  }

  .center-panel {
    padding: 8px;
    border-right: 0;
  }

  .event-panel,
  .stream-panel {
    margin-bottom: 8px;
  }

  .event-panel {
    overflow-x: auto;
  }

  .events-table {
    min-width: 680px;
  }

  #streamOutput {
    height: 320px;
  }

  .right-panel {
    display: grid;
    grid-template-rows: auto auto;
  }

  .tab-panel {
    height: auto;
  }

  .reader-grid {
    display: block;
    height: auto;
  }

  .chapter-list {
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #chapterList {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    overflow-x: auto;
  }

  .chapter-reader {
    max-height: none;
  }

  .commandbar {
    padding: 8px;
  }

  .terminal-button {
    display: none;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 11px;
  }

  .brand {
    font-size: 17px;
  }

  .metric-row,
  .usage-grid {
    grid-template-columns: 1fr;
  }

  .metric-row div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-row div:last-child {
    border-bottom: 0;
  }

  .usage-grid .wide-stat {
    grid-column: auto;
  }

  .chapter-reader {
    padding: 18px 16px;
  }

  .chapter-reader h1 {
    font-size: 21px;
  }
}

/* ============================================================
   Login page
   ============================================================ */

.auth-shell {
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(var(--grid-line-1) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-2) 1px, transparent 1px),
    var(--bg);
  background-size: 24px 24px;
  padding: 24px;
  position: relative;
}

.auth-card {
  width: min(380px, 100%);
  padding: 30px 26px 26px;
  display: grid;
  gap: 4px;
}

.auth-brand {
  justify-content: center;
  font-size: 22px;
  margin-bottom: 6px;
}

.auth-sub {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 20px;
  text-align: center;
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 6px;
  font-size: 11px;
  color: var(--text-soft);
}

.auth-field input {
  height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  font-size: 13px;
}

.auth-field input:focus {
  border-color: var(--cyan);
  outline: none;
}

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}

.auth-checkbox input {
  width: 15px;
  height: 15px;
}

.auth-submit {
  width: 100%;
  height: 46px;
  margin-top: 4px;
  font-size: 14px;
}

.auth-error {
  color: var(--red);
  font-size: 11px;
  margin: 0;
}

.auth-note {
  color: var(--dim);
  font-size: 10px;
  text-align: center;
  margin: 18px 0 0;
  line-height: 1.7;
}

.auth-theme-btn {
  position: fixed;
  top: 16px;
  right: 16px;
}

/* ============================================================
   Home page (thư viện truyện)
   ============================================================ */

.home-shell {
  /* height (không phải min-height): body/html có overflow:hidden toàn cục (xem :92) cho layout
     dashboard cố định viewport của index.html — .home-shell (home.html/admin.html) phải tự bị
     giới hạn đúng bằng viewport thì phần tử con .admin-main (flex:1; overflow:auto) mới thực sự
     cuộn được, nếu không nó cứ giãn dài vô hạn theo nội dung và không bao giờ tràn để cuộn. */
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

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

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 12px;
  height: 34px;
}

.home-search i.bi {
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

.home-search input {
  border: 0;
  background: transparent;
  color: var(--text);
  flex: 1;
  min-width: 0;
  height: 100%;
}

.home-search input::placeholder {
  color: var(--dim);
}

.home-main {
  flex: 1;
  overflow: auto;
  padding: 28px 32px 60px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* Vẫn cuộn được (overflow:auto ở trên) — chỉ ẩn thanh scrollbar hiển thị, đỡ rối giao diện trên
   trang thư viện/quản trị vốn là trang nội dung dài, khác với các khung cuộn nội bộ nhỏ trong
   dashboard chính (.events-scroll, .left-panel...) vẫn giữ scrollbar mặc định. */
.home-main,
.admin-main {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.home-main::-webkit-scrollbar,
.admin-main::-webkit-scrollbar {
  display: none;
}

.home-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.home-title {
  margin: 0 0 4px;
  font-size: 22px;
}

.home-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.home-toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.novel-card {
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: start;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.novel-card:hover {
  border-color: var(--cyan);
}

.novel-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.novel-name {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.novel-writer {
  margin: -8px 0 0;
  color: var(--dim);
  font-size: 10px;
  word-break: break-all;
}

.novel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.novel-stats span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-bottom: 3px;
}

.novel-stats strong {
  font-size: 12px;
}

.phase-badge,
.role-badge,
.status-badge {
  display: inline-block;
  border: 1px solid currentColor;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.phase-init,
.phase-premise,
.phase-unfinished {
  color: var(--dim);
}

.phase-outline {
  color: var(--cyan);
}

.phase-writing {
  color: var(--amber);
}

.phase-complete {
  color: var(--green);
}

.home-empty {
  text-align: center;
  padding: 90px 20px;
  color: var(--muted);
  display: grid;
  gap: 16px;
  justify-items: center;
}

.danger-btn {
  border-color: var(--red);
  color: var(--red);
}

.danger-btn:hover {
  background: rgba(255, 59, 48, 0.1);
  border-color: var(--red);
}

@media (max-width: 720px) {
  .home-topbar {
    grid-template-columns: 1fr auto;
    row-gap: 8px;
  }

  .home-search {
    grid-column: 1 / -1;
    max-width: none;
    order: 3;
  }

  .home-main {
    padding: 20px 16px 40px;
  }

  .novel-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Admin page (quản lý truy cập)
   ============================================================ */

.admin-main {
  flex: 1;
  overflow: auto;
  padding: 28px 32px 60px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 24px;
  align-content: start;
}

.admin-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  margin-bottom: 4px;
}

.admin-back:hover {
  color: var(--cyan);
}

.admin-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.admin-section-title {
  margin: 0 0 4px;
  font-size: 18px;
}

.admin-section-sub {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.admin-table-wrap {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-grad-1), var(--panel-grad-2));
  overflow-x: auto;
}

.admin-table-wrap .events-table {
  table-layout: auto;
}

.admin-table-wrap .events-table th,
.admin-table-wrap .events-table td {
  white-space: nowrap;
  padding: 10px 16px;
}

.admin-table-wrap .events-table td.wrap {
  white-space: normal;
}

.admin-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}

.admin-pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.role-admin {
  color: var(--cyan);
}

.role-editor {
  color: var(--amber);
}

.role-viewer {
  color: var(--dim);
}

.status-active {
  color: var(--green);
}

.status-locked {
  color: var(--red);
}

.admin-row-actions {
  display: flex;
  gap: 6px;
}

.admin-row-actions .icon-btn {
  width: 26px;
  height: 26px;
  min-height: 0;
}

.admin-row-actions .icon-btn i.bi {
  font-size: 13px;
}

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-avatar {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--cyan);
  flex-shrink: 0;
  text-transform: uppercase;
}

.admin-you-tag {
  color: var(--dim);
  font-size: 9px;
  margin-left: 6px;
}

.admin-empty-log {
  color: var(--dim);
  text-align: center;
  padding: 30px;
}

.admin-invite-result {
  margin: 4px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--cyan);
  background: rgba(0, 184, 255, 0.08);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.admin-invite-result code {
  color: var(--cyan);
  font-weight: 700;
}

@media (max-width: 720px) {
  .admin-main {
    padding: 20px 16px 40px;
  }
}
