:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --gold: var(--accent);
  --gold-hover: var(--accent-hover);
  --ok: #34c759;
  --err: #ff3b30;
  --warn: #ff9f0a;
  --fill: #e8e8ed;
  --fill-hover: #d2d2d7;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --radius-tight: 8px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px 32px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  text-align: center;
}
.login-card .muted {
  text-align: center;
  margin: 0 0 8px;
}
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; }

input, button, textarea, select {
  font: inherit;
}
input {
  background: var(--fill);
  border: 1px solid transparent;
  border-radius: var(--radius-tight);
  color: var(--text);
  padding: 11px 14px;
  flex: 1;
  min-width: 0;
  transition: background 0.15s, box-shadow 0.15s;
}
input:focus {
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.22);
  border-color: var(--accent);
}
.login-card input {
  width: 100%;
  flex: none;
}

.btn {
  border: none;
  border-radius: var(--radius-tight);
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 590;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.login-card .btn-primary {
  width: 100%;
  padding: 12px 16px;
  border-radius: 980px;
  margin-top: 4px;
}
.btn-ghost {
  background: var(--fill);
  color: var(--text);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--fill-hover); color: var(--text); }
.btn-danger {
  background: transparent;
  color: var(--err);
  border: 1px solid rgba(255, 59, 48, 0.28);
}
.btn-danger:hover {
  color: #fff;
  background: var(--err);
  border-color: var(--err);
}
.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.admin-user-actions .btn { font-size: 12px; padding: 6px 10px; }
.col-actions { width: 148px; white-space: nowrap; }

.error-text { color: var(--err); font-size: 13px; margin-top: 10px; }

.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 232px;
  background: #f0f0f2;
  border-right: 1px solid var(--border);
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
}
.brand {
  font-weight: 600;
  color: var(--text);
  padding: 0 8px 20px;
  font-size: 15px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 6px 14px;
  margin-bottom: 8px;
}
.sidebar-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  object-fit: cover;
}
.sidebar-brand-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px;
  min-width: 0;
  flex: 1;
  line-height: 1.2;
}
.sidebar-brand-title {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}
.sidebar-brand-sep {
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}
.sidebar-scope-picker {
  position: relative;
  flex-shrink: 0;
}
.sidebar-scope-trigger {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.sidebar-scope-trigger:hover,
.sidebar-scope-picker.is-open .sidebar-scope-trigger {
  border-color: transparent;
  background: var(--fill);
  color: var(--text);
}
.sidebar-scope-chevron {
  font-size: 9px;
  color: var(--muted);
}
.sidebar-scope-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 120;
  min-width: 104px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-tight);
  padding: 4px;
  box-shadow: var(--shadow);
}
.sidebar-scope-option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.sidebar-scope-option:hover,
.sidebar-scope-option.is-active {
  background: var(--fill);
  color: var(--text);
}
.admin-nav-group.hidden {
  display: none;
}
.nav-link {
  display: block;
  padding: 8px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 500;
}
.nav-link:hover {
  background: rgba(0, 0, 0, 0.04);
}
.nav-link.active {
  background: var(--fill);
  color: var(--text);
  font-weight: 600;
}
.nav-secondary { margin-top: 10px; font-size: 13px; color: var(--muted); }
.sidebar-logout {
  margin-top: auto;
  width: 100%;
  background: transparent;
  color: var(--muted);
  border: none;
}
.sidebar-logout:hover { background: var(--fill); color: var(--text); }

.main {
  flex: 1;
  padding: 32px 36px 48px;
  overflow: auto;
}
.page h2 {
  margin: 0 0 16px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  box-shadow: none;
}
.card-clickable {
  cursor: pointer;
  width: 100%;
  font: inherit;
  color: inherit;
  transition: background 0.15s, transform 0.15s;
}
.card-clickable:hover {
  border-color: var(--border);
  background: #fafafa;
}
.card-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.card-static { cursor: default; }
.card-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.card-value { font-size: 18px; font-weight: 700; }
.card-value .ok, .card-value.ok, .ok { color: var(--ok); }
.card-value .bad, .card-value.bad, .bad { color: var(--err); }
.card-value .warn, .warn { color: var(--warn); }
.card-sub { font-size: 12px; margin-top: 6px; line-height: 1.4; }
.card-hint { font-size: 11px; margin-top: 10px; opacity: 0.75; }
.card-bad { border-color: rgba(248, 81, 73, 0.45); }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.page-head h2 { margin: 0; }
.overview-intro { margin: 0 0 20px; }
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  margin: 8px 0 12px;
}
.quick-links { margin-top: 28px; }
.quick-link-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.quick-link-row a { text-decoration: none; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
}
.modal {
  width: 100%;
  max-width: 520px;
  max-height: min(85vh, 720px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 17px; font-weight: 600; color: var(--text); }
.modal-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body {
  padding: 16px 20px;
  overflow: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.modal-desc { margin: 0 0 14px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.warn-text { color: var(--warn); }
.detail-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 16px;
  font-size: 13px;
}
.detail-dl dt { color: var(--muted); margin: 0; }
.detail-dl dd { margin: 0; word-break: break-word; }
.detail-dl a { color: var(--accent); }
.detail-dl a.table-page-link { text-decoration: none; }
.detail-dl a.table-page-link:hover { text-decoration: underline; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.panel h3 { margin: 0 0 8px; font-size: 15px; }

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

.auth-intro { margin: 0 0 16px; max-width: 640px; }
.auth-panel { max-width: 640px; margin-top: 8px; }
.auth-row { margin-bottom: 20px; }
.auth-row:last-child { margin-bottom: 0; }
.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.auth-controls {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}
.auth-input {
  flex: 1;
  min-width: 200px;
}
.auth-row-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.input-affix {
  position: relative;
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: stretch;
}
.input-affix .auth-input {
  width: 100%;
  padding-right: 44px;
  min-width: 0;
}
.affix-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 32px;
  border: none;
  border-radius: var(--radius-tight);
  background: var(--fill);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.affix-btn:hover {
  background: var(--fill-hover);
  color: var(--text);
}
.affix-btn:active { transform: translateY(-50%) scale(0.96); }
.dice-icon {
  font-size: 18px;
  line-height: 1;
}

.result-box {
  margin-top: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.table-wrap {
  margin-top: 14px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table-wrap table.admin-table {
  table-layout: fixed;
}
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  word-break: normal;
  overflow-wrap: break-word;
}
.admin-table .col-method {
  width: 5.5rem;
  min-width: 52px;
  white-space: nowrap;
  writing-mode: horizontal-tb;
}
.admin-table .col-nick {
  width: 8rem;
  min-width: 80px;
  max-width: 10rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  writing-mode: horizontal-tb;
}
.admin-table .col-account,
.admin-table .col-email {
  width: 24%;
  word-break: break-all;
  writing-mode: horizontal-tb;
}
.admin-table .col-time {
  width: 10.5rem;
  white-space: nowrap;
}
.admin-table .col-id {
  width: 24%;
  word-break: break-all;
}
th { color: var(--muted); font-weight: 600; background: #fafafa; }
tr:hover td { background: #fafafa; }

select {
  background: var(--fill);
  border: 1px solid transparent;
  border-radius: var(--radius-tight);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
select:focus {
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.22);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
}
.tag.ok { background: rgba(44, 162, 79, 0.2); color: var(--ok); }
.tag.bad { background: rgba(248, 81, 73, 0.15); color: var(--err); }
.bad { color: var(--err); }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1d1d1f;
  border: none;
  color: #f5f5f7;
  padding: 12px 18px;
  border-radius: 980px;
  font-size: 13px;
  z-index: 100;
  max-width: 360px;
  box-shadow: var(--shadow);
}

.page-head-split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.library-intro { margin: 4px 0 0; max-width: 36rem; }
.library-search-wrap { flex: 0 1 320px; min-width: 200px; }
.library-search {
  width: 100%;
  background: var(--fill);
  border: 1px solid transparent;
  border-radius: 980px;
  color: var(--text);
  padding: 10px 16px;
  font: inherit;
}
.library-user-table .col-phone { width: 9rem; }
.library-user-table .col-email { width: 22%; word-break: break-all; }
.library-user-table .col-stats { width: 7rem; white-space: nowrap; }
.library-user-table .col-enter { width: 3rem; text-align: right; }
.library-enter-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-tight);
}
.library-enter-btn:hover { background: var(--fill); color: var(--text); }
.library-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  padding-bottom: 8px;
}

.pool-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.pool-user-meta { flex: 1; min-width: 200px; }
.pool-user-meta h3 { margin: 0 0 4px; font-size: 1.15rem; }
.pool-user-meta p { margin: 0; font-size: 13px; color: var(--muted); }

.pool-shell {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 320px;
}
.pool-shell-wide {
  max-width: 880px;
}
.pool-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.pool-header-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
}
.pool-header-sub { font-size: 13px; color: var(--muted); margin: 0; }
.pool-tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.pool-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.pool-tag-chip .pool-tag-check {
  font-size: 12px;
  opacity: 0.55;
  width: 14px;
  text-align: center;
}
.pool-tag-chip.filter-on .pool-tag-check {
  opacity: 1;
}
.pool-tag-chip.active {
  border-color: transparent;
  color: var(--text);
  background: var(--fill);
}
.pool-tag-chip.filter-on {
  border-color: transparent;
  background: var(--fill);
}
.pool-tag-chip .count {
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted);
}
.pool-body { padding: 0 0 12px; }
.pool-section-label {
  padding: 8px 16px 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.pool-case-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.pool-case-row:hover { background: #fafafa; }
.pool-case-main { flex: 1; min-width: 0; }
.pool-case-side {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pool-case-gender {
  font-size: 13px;
  color: #8b949e;
  min-width: 1.2em;
  text-align: center;
}
.pillar-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pillar-line {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.pillar-gan,
.pillar-zhi {
  display: inline-block;
  width: 1.1em;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
.pool-case-chevron {
  color: var(--muted);
  font-size: 18px;
  margin-left: 4px;
}
.pool-case-name {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pool-pin {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
}
.pool-case-sub { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.pool-case-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pool-case-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius);
  border: 1px solid;
  background: transparent;
}
.pool-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.segmented-control {
  display: inline-flex;
  border: none;
  border-radius: 9px;
  overflow: hidden;
  background: var(--fill);
  padding: 2px;
  gap: 2px;
}
.segmented-control button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 590;
  border-radius: 7px;
}
.segmented-control button:hover { color: var(--text); }
.segmented-control button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.segmented-control-wrap { flex-shrink: 0; }

.library-head-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}
.library-head-tools .library-search { flex: 1 1 200px; max-width: 320px; }

.nav-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: var(--radius);
  background: var(--err);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  vertical-align: middle;
}

.mega-comms-card { padding: 20px 24px; }
.mega-comms-title {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
}
.mega-comms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px 24px;
}
.mega-comms-stat .mega-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}
.mega-comms-stat .mega-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.mega-comms-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
.mega-comms-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.business-hint { margin: 0 0 12px; min-height: 1.2em; }
.card-highlight .card-label { color: var(--muted); }
.card-highlight .card-value { font-size: 2rem; }

.business-chart-panel { margin-top: 20px; padding: 16px 20px 20px; }
.business-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.business-chart-head .section-title { margin: 0; }
.business-chart-days select {
  flex: 0 0 auto;
  width: auto;
  min-width: 64px;
  margin: 0 4px;
  padding: 6px 8px;
}
.business-chart-note { margin: 0 0 12px; font-size: 12px; }
.business-chart-wrap {
  position: relative;
  min-height: 220px;
  max-height: 360px;
}

.feedback-toolbar { gap: 12px; align-items: center; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.checkbox-inline input { flex: 0 0 auto; width: auto; }
.feedback-table td.feedback-content { max-width: 420px; white-space: pre-wrap; word-break: break-word; }
.feedback-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.feedback-actions .btn { padding: 6px 10px; font-size: 12px; }

.share-ai-table td.share-ai-user { min-width: 140px; }
.share-ai-detail-block { margin-bottom: 16px; }
.share-ai-detail-block h4 { margin: 0 0 8px; font-size: 13px; color: var(--text); }
.share-ai-detail-pre {
  margin: 0;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--fill);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow: auto;
}
.share-ai-expand td { background: #fafafa; }
.status-ok { color: var(--ok); }
.status-fail { color: var(--err); }

.discipline-placeholder {
  padding: 48px 32px;
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}
.discipline-placeholder h3 { color: var(--text); margin: 0 0 12px; }

.pool-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.pool-topbar .segmented-control-wrap { margin-left: auto; }

@media (max-width: 720px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar-logout { margin-top: 0; margin-left: auto; width: auto; }
  .nav-link { display: inline-block; }
  .library-head-tools { flex: 1 1 100%; }
  .pool-topbar .segmented-control-wrap { margin-left: 0; width: 100%; }
}

.pk-panel {
  padding: 0;
  overflow: hidden;
  background: #f5f5f5;
}
.pk-preview-wrap {
  background: #f5f5f5;
  padding: 0 0 20px;
  min-height: 420px;
}
.pk-preview-scroll {
  max-height: calc(100vh - 220px);
  min-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f5f5f5;
}
.pk-preview-scroll::-webkit-scrollbar {
  width: 8px;
}
.pk-preview-scroll::-webkit-scrollbar-track {
  background: #f5f5f5;
}
.pk-preview-scroll::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
.pk-preview-scroll::-webkit-scrollbar-thumb:hover {
  background: #b08850;
}
.pk-portal-frame {
  background: #f5f5f5;
}
.pk-portal-header-wrap {
  background: #fff;
  border-bottom: 1px solid #eee;
  position: relative;
  z-index: 50;
  overflow: visible;
}
.pk-portal-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.pk-portal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}
.pk-portal-logo {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: block;
  object-fit: cover;
}
.pk-portal-brand-text {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  letter-spacing: 0.5px;
}
.pk-portal-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 2px;
  min-width: 280px;
}
.pk-portal-tab {
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 500;
  color: #666;
  position: relative;
  cursor: default;
  user-select: none;
}
.pk-portal-tab.is-active {
  color: #b08850;
  font-weight: 600;
}
.pk-portal-tab.is-active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 2px;
  background: #b08850;
  border-radius: 1px;
}
.pk-portal-header-actions {
  display: contents;
}
.pk-disc-picker-host {
  position: relative;
  margin-left: auto;
}
.pk-disc-picker {
  position: relative;
  min-width: 152px;
}
.pk-disc-trigger,
.pk-disc-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 140px;
  padding: 7px 10px;
  margin: 0 4px;
  border: none;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  color: #666;
  transition: background 0.12s;
}
.pk-disc-trigger {
  margin: 0;
  padding: 7px 10px;
}
.pk-disc-trigger:hover,
.pk-disc-option:hover {
  background: rgba(176, 136, 80, 0.06);
}
.pk-disc-trigger.is-active,
.pk-disc-option.is-active {
  background: rgba(176, 136, 80, 0.1);
  color: #b08850;
  font-weight: 600;
}
.pk-disc-option.is-off {
  opacity: 0.45;
}
.pk-disc-char {
  width: 18px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: #999;
}
.pk-disc-trigger.is-active .pk-disc-char,
.pk-disc-option.is-active .pk-disc-char {
  color: #8a6a3e;
}
.pk-disc-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pk-disc-chevron {
  font-size: 9px;
  color: #999;
  padding-left: 2px;
  flex-shrink: 0;
}
.pk-disc-trigger.is-active .pk-disc-chevron {
  color: #8a6a3e;
}
.pk-disc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 118;
  background: transparent;
}
.pk-disc-menu {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 121;
  background: #fff;
  border-radius: 4px;
  border: 1px solid #eee;
  padding: 4px 0;
  box-shadow: 0 4px 16px rgba(61, 43, 31, 0.14);
}
.pk-disc-add {
  border-top: 1px solid #f0f0f0;
  margin-top: 2px;
  padding-top: 9px;
  color: #b08850;
}
.pk-disc-add-icon {
  width: 18px;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  line-height: 1;
  color: #b08850;
}
.pk-field-hint {
  margin: 6px 0 0;
  font-size: 12px;
}
.pk-main-card {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  scrollbar-width: thin;
  scrollbar-color: #ccc #f5f5f5;
}
.pk-main-card::-webkit-scrollbar {
  height: 8px;
}
.pk-main-card::-webkit-scrollbar-track {
  background: #f5f5f5;
}
.pk-main-card::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
.pk-main-card::-webkit-scrollbar-thumb:hover {
  background: #b08850;
}
.pk-column-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
}
.pk-col-card {
  flex: 0 0 220px;
  width: 220px;
  padding: 20px 12px 12px;
  border-right: 1px solid #eee;
  box-sizing: border-box;
}
.pk-col-card:last-child {
  border-right: none;
}
.pk-col-card.is-disabled {
  opacity: 0.5;
}
.pk-col-card.dragging {
  opacity: 0.45;
}
.pk-col-card.drag-over {
  outline: 2px dashed #b08850;
  outline-offset: -2px;
}
.pk-item-expand {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #bbb;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, background 0.15s;
}
.pk-item-expand:hover,
.pk-item-expand.is-open {
  color: #b08850;
  background: rgba(176, 136, 80, 0.08);
}
.pk-col-item.is-header .pk-item-label {
  font-weight: 600;
}
.pk-col-card.is-drawer .pk-col-title {
  color: #8a7355;
}
.pk-col-card.pk-col-flyout {
  border-left: 2px solid rgba(176, 136, 80, 0.35);
  background: rgba(176, 136, 80, 0.03);
}
.pk-col-card.pk-col-flyout .pk-col-title::before {
  content: "? ";
  color: #b08850;
}
.pk-drawer-section {
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 0 16px;
}
.pk-drawer-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.pk-drawer-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #444;
  margin: 0 0 4px;
}
.pk-drawer-section-desc {
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  max-width: 720px;
}
.pk-drawer-count {
  flex-shrink: 0;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(176, 136, 80, 0.1);
  color: #8a6a3a;
  white-space: nowrap;
}
.pk-drawer-card {
  min-height: 120px;
}
.pk-portal-body.pk-drop-zone-active,
.pk-drawer-section.pk-drop-zone-active {
  outline: 2px dashed rgba(176, 136, 80, 0.55);
  outline-offset: 4px;
  border-radius: 4px;
}
.pk-col-items.drag-over {
  background: rgba(176, 136, 80, 0.06);
  border-radius: 4px;
}
.pk-col-card.is-drawer .pk-drag-handle {
  opacity: 1;
  color: #b08850;
}
.pk-check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 16px;
  font-size: 13px;
  cursor: pointer;
}
.pk-kind-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pk-kind-option {
  cursor: pointer;
  margin: 0;
}
.pk-kind-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pk-kind-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  min-height: 68px;
}
.pk-kind-option:hover .pk-kind-card {
  border-color: rgba(0, 113, 227, 0.35);
}
.pk-kind-option.is-active .pk-kind-card {
  border-color: var(--accent);
  background: rgba(0, 113, 227, 0.06);
  box-shadow: 0 0 0 1px rgba(0, 113, 227, 0.16);
}
}
.pk-kind-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.pk-kind-option.is-active .pk-kind-title {
  color: #8a6a3a;
}
.pk-kind-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.pk-disc-del {
  color: #c44;
  border-top: 1px solid #f0f0f0;
  margin-top: 4px;
  padding-top: 8px;
}
.pk-disc-del-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 11px;
  background: rgba(204, 68, 68, 0.1);
  color: #c44;
  font-size: 16px;
  line-height: 1;
}
.pk-col-head {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  user-select: none;
}
.pk-col-title {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #333;
  line-height: 1.3;
  min-width: 0;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  transition: background 0.12s;
}
.pk-col-title:hover {
  background: rgba(176, 136, 80, 0.08);
}
.pk-drag-handle {
  color: #ccc;
  font-size: 10px;
  letter-spacing: -2px;
  cursor: grab;
  flex-shrink: 0;
  padding: 2px 0;
}
.pk-drag-handle:active {
  cursor: grabbing;
}
.pk-col-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pk-col-item {
  position: relative;
  display: grid;
  grid-template-columns: 12px 22px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
  padding: 6px 26px 6px 4px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: background 0.12s;
}
.pk-col-item:hover {
  background: rgba(176, 136, 80, 0.06);
}
.pk-col-item.is-disabled {
  opacity: 0.45;
}
.pk-col-item.dragging {
  opacity: 0.45;
}
.pk-col-item.drag-over {
  background: rgba(176, 136, 80, 0.1);
}
.pk-item-drag {
  color: #ccc;
  font-size: 10px;
  letter-spacing: -2px;
  cursor: grab;
  width: 12px;
  min-width: 12px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s;
  justify-self: start;
}
.pk-col-item:hover .pk-item-drag {
  opacity: 1;
}
.pk-item-num {
  width: 22px;
  height: 22px;
  border-radius: 11px;
  background: #ccc;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
  flex-shrink: 0;
  justify-self: center;
}
.pk-item-label-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.pk-item-label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  overflow: visible;
}
.pk-item-link-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b08850;
  flex-shrink: 0;
  margin-top: 7px;
}
.pk-item-del {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: #bbb;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.pk-col-item:hover .pk-item-del {
  opacity: 1;
}
.pk-col-item-add {
  align-items: center;
  padding: 6px 4px;
  cursor: default;
  grid-template-columns: 12px 22px;
}
.pk-col-item-add:hover {
  background: transparent;
}
.pk-item-drag-spacer {
  width: 12px;
  min-width: 12px;
  visibility: hidden;
  pointer-events: none;
}
.pk-plus-num {
  width: 22px;
  height: 22px;
  border-radius: 11px;
  border: 1px dashed #ccc;
  background: transparent;
  color: #b08850;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  justify-self: center;
  grid-column: 2;
  transition: border-color 0.15s, background 0.15s;
}
.pk-plus-num:hover {
  border-color: #b08850;
  background: rgba(176, 136, 80, 0.08);
}
.pk-col-add-card {
  flex: 0 0 100px;
  width: 100px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px;
  border: none;
  border-right: none;
  background: transparent;
  cursor: pointer;
  color: #b08850;
  transition: background 0.15s;
}
.pk-col-add-card:hover {
  background: rgba(176, 136, 80, 0.04);
}
.pk-plus-lg {
  width: 44px;
  height: 44px;
  border: 2px dashed #ddd;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  transition: border-color 0.15s;
}
.pk-col-add-card:hover .pk-plus-lg {
  border-color: #b08850;
}
.pk-drag-handle {
  color: #ccc;
  font-size: 10px;
  letter-spacing: -2px;
  cursor: grab;
  flex-shrink: 0;
}
.pk-drag-hint {
  max-width: 1200px;
  margin: 16px auto 0;
  padding: 0 16px;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  color: #999;
}
.pk-context-menu {
  position: fixed;
  z-index: 200;
  min-width: 120px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 6px 20px rgba(61, 43, 31, 0.14);
}
.pk-context-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: #333;
  text-align: left;
  cursor: pointer;
}
.pk-context-item:hover:not(:disabled) {
  background: rgba(176, 136, 80, 0.08);
  color: #b08850;
}
.pk-context-item:disabled {
  opacity: 0.35;
  cursor: default;
}
.pk-portal-body {
  padding: 24px 16px 0;
}
@media (max-width: 720px) {
  .pk-item-del {
    opacity: 1;
  }
  .pk-portal-header {
    padding: 12px 16px;
  }
  .pk-item-drag {
    opacity: 1;
  }
}
.pk-form-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 210;
}
.pk-form-modal {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.pk-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.pk-form-head h3 { margin: 0; font-size: 16px; color: var(--text); }
.pk-form-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.pk-field-group { display: flex; flex-direction: column; gap: 14px; }
.pk-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.pk-form-body input[type="text"],
.pk-form-body input[type="url"] {
  width: 100%;
  box-sizing: border-box;
}
.pk-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.pk-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

.online-users-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0 12px;
}
.heartbeat-icon {
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(44, 162, 79, 0.35));
}
.online-users-head-text { min-width: 0; }
.online-users-title {
  margin: 0 0 4px;
  color: var(--ok);
}
.online-users-desc { margin: 0; }
#pk-item-delete-wrap { margin-top: 4px; }
#pk-item-delete-wrap.hidden { display: none; }

textarea {
  font: inherit;
  background: var(--fill);
  border: 1px solid transparent;
  border-radius: var(--radius-tight);
  color: var(--text);
  padding: 10px 12px;
  width: 100%;
  resize: vertical;
  min-height: 72px;
}
textarea:focus {
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.22);
  border-color: var(--accent);
}
select {
  font: inherit;
  background: var(--fill);
  border: 1px solid transparent;
  border-radius: var(--radius-tight);
  color: var(--text);
  padding: 10px 12px;
}
.ops-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ops-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12); }
.ops-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ops-card-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.ops-card-copy strong { font-size: 14px; }
.ops-card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ops-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-tight);
  background: var(--bg);
  flex-shrink: 0;
}
.ops-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
}
.ops-form {
  display: grid;
  gap: 12px;
  max-width: 720px;
  margin-top: 16px;
}
.ops-form h3 { margin: 0; }
.ops-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.ops-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}
.ops-form-row:has(select) {
  grid-template-columns: 140px 1fr auto;
}
.ops-check {
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.ops-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.ops-chips, .ops-hits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.ops-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
}
.ops-chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}
.ops-hit {
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
}
.ops-hit:hover { border-color: var(--accent); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
@media (max-width: 720px) {
  .ops-form-row, .ops-form-row:has(select) { grid-template-columns: 1fr; }
}

/* ??????? ?? Pexels ?? */
.ops-cover-preview { margin: 8px 0 4px; }
.ops-cover-preview img { max-width: 100%; max-height: 160px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }
.ops-pexels-box { margin: 8px 0 12px; display: flex; flex-direction: column; gap: 8px; }
.ops-pexels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ops-pexels-thumb { padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg); cursor: pointer; }
.ops-pexels-thumb img { width: 100%; height: 72px; object-fit: cover; display: block; }
.ops-pexels-thumb:hover { border-color: var(--accent); }

/* ??????????? */
.research-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.research-sidebar { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 12px; }
.research-main { min-width: 0; }
.research-session-pick { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); cursor: pointer; }
.research-session-pick:hover { border-color: var(--accent); }
.research-session-pick-title { font-weight: 600; font-size: 13px; }
.research-step-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.research-step-chip { font-size: 12px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.research-step-chip.is-active { border-color: var(--accent); color: var(--accent); }
.research-step-chip.is-done { border-color: #238636; color: #3fb950; }
.research-panels details { margin-bottom: 10px; }
.research-person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.research-person-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.research-person-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.research-person-tab { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; }
.research-person-tab.is-active { border-color: var(--accent); color: var(--accent); }
.research-event-list { list-style: none; margin: 0; padding: 0; }
.research-event-item { padding: 6px 0; border-bottom: 1px solid var(--border); }
.research-commit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 10px 0; }
.research-commit-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: flex; gap: 8px; align-items: flex-start; }
.research-commit-actions { flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ops-card.is-draft { opacity: 0.92; border-style: dashed; }
.ops-fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px 12px;
  margin: 0 0 12px;
}
.ops-fieldset legend { padding: 0 6px; color: var(--muted); font-size: 13px; }
#research-root.is-busy { opacity: 0.7; pointer-events: none; }
@media (max-width: 900px) {
  .research-layout { grid-template-columns: 1fr; }
  .research-sidebar { position: static; }
}

.hotspot-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.hotspot-step {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.hotspot-step.is-active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.hotspot-step.is-done { border-color: #34c759; color: #248a3d; }
.hotspot-step-arrow { color: var(--muted); }
.hotspot-analysis pre {
  white-space: pre-wrap;
  font: inherit;
  background: var(--bg);
  padding: 12px;
  border-radius: 8px;
}
#hotspot-analyze-prompt, #hotspot-event-body, #hotspot-step4 textarea, #hotspot-people-hint {
  width: 100%;
}
.hotspot-cast-note { font-size: 13px; }
.hotspot-cast-role {
  display: block;
  margin-top: 4px;
  width: min(280px, 100%);
}
.hotspot-person-block { margin: 12px 0 18px; }
.hotspot-cover-row { display: grid; grid-template-columns: 220px 1fr; gap: 16px; margin: 12px 0; }
.hotspot-cover-preview { width: 100%; height: 140px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.hotspot-cover-preview.is-empty {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--muted); font-size: 13px;
}
.hotspot-layout-row { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 720px) {
  .hotspot-cover-row { grid-template-columns: 1fr; }
}
#page-hot-news-desk { position: relative; }
.hot-news-desk-head { margin-bottom: 8px; }
.hot-news-desk-parent { margin: 0 0 6px; font-size: 22px; }
.hot-news-subnav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hot-news-back {
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hot-news-back-icon { display: block; }
.hotspot-step2-head { margin-bottom: 14px; }
.hotspot-step2-head h3 { margin: 0 0 6px; }
.hotspot-write-substeps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.hotspot-write-substep {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-tight);
  background: var(--fill);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.hotspot-write-substep:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.hotspot-write-substep.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--fill));
}
.hotspot-write-substep.is-done:not(.is-active) {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.hotspot-write-substep-num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.hotspot-write-substep.is-active .hotspot-write-substep-num,
.hotspot-write-substep.is-done .hotspot-write-substep-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.hotspot-write-panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-tight);
  background: var(--fill);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hotspot-write-panel h4 { margin: 0; }
.hotspot-write-panel-foot { margin-top: 6px; }
.hotspot-prompt-label {
  font-size: 12px;
  color: var(--muted);
}
.hotspot-write-panel textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-tight);
  padding: 10px 12px;
  font-size: 13px;
}
.hotspot-founded-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hotspot-radio input[type="radio"] { margin-top: 3px; }
.hotspot-write-panel .btn.is-loading {
  opacity: 0.85;
  pointer-events: none;
}
.hotspot-write-panel .btn.is-loading::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: hotspot-spin 0.7s linear infinite;
  vertical-align: -2px;
}
.hotspot-subject-block {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-tight);
  background: var(--fill);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hotspot-subject-block h4 { margin: 0; }
.hotspot-subject-split { margin: 0; font-size: 14px; }
.hotspot-subject-preview { margin: 0; font-size: 14px; color: var(--text); }
.hotspot-subject-status { margin: 0; font-size: 12px; }
.hotspot-step2-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.hotspot-collect-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hotspot-collect-block textarea {
  width: 100%;
  min-height: 52px;
  resize: vertical;
  background: var(--fill);
  border: 1px solid transparent;
  border-radius: var(--radius-tight);
  padding: 10px 12px;
  font-size: 13px;
}
.hotspot-step2-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.hotspot-step2-col h4 { margin: 0 0 8px; font-size: 15px; }
@media (max-width: 900px) {
  .hotspot-step2-actions,
  .hotspot-step2-split { grid-template-columns: 1fr; }
}
.hotspot-topic-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.hotspot-topic-meta { font-size: 13px; color: var(--muted); margin: 0; }
.hotspot-page-nums {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hotspot-page-num {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.hotspot-page-num:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.hotspot-page-num.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.hotspot-user-hints {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.hotspot-user-hints h4 { margin: 0 0 6px; font-size: 14px; }
.hotspot-user-hints-list {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}
.hotspot-user-hints-list li { margin: 4px 0; font-size: 13px; }
.hotspot-requests-panel { margin: 16px 0; }
.hotspot-requests-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.hotspot-requests-head h3 { margin: 0 0 4px; font-size: 15px; }
.hotspot-requests-ranked-wrap { margin-bottom: 12px; }
.hotspot-requests-list-wrap {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}
.hotspot-request-row {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}
.hotspot-request-row p { margin: 0; font-size: 13px; }
.hotspot-request-row .muted { margin-top: 4px; font-size: 12px; }
.hotspot-rank {
  display: inline-block;
  min-width: 18px;
  margin-right: 6px;
  color: var(--accent);
  font-weight: 700;
}
.hotspot-step1-title { margin: 0 0 12px; font-size: 15px; }
.btn-icon-only {
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.btn-icon-only .hotspot-refresh-icon { display: block; }
.btn-refresh.is-spinning .hotspot-refresh-icon { visibility: hidden; }
.btn-refresh.is-spinning .hotspot-btn-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
}
.hot-news-subtitle { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.hot-news-desk-toolbar {
  align-items: center;
  margin-bottom: 12px;
}
.hot-news-desk-toolbar .hotspot-steps { margin: 0; flex: 1; }
.hot-news-entry-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.hot-news-entry-card:hover { border-color: var(--accent); background: var(--bg); }
.hot-news-lists { margin-top: 0; }
.hotspot-card.is-draft { border-style: dashed; opacity: 0.95; }
#hotspot-event-title { width: 100%; max-width: 640px; }
.hotspot-loading {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.35);
}
.hotspot-loading.hidden { display: none; }
.hotspot-loading-card {
  min-width: 240px;
  background: var(--surface);
  border-radius: 16px;
  padding: 32px 36px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.hotspot-spinner,
.hotspot-btn-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--fill);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: hotspot-spin 0.7s linear infinite;
}
.hotspot-btn-spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 6px;
}
.hotspot-btn-spinner.hidden { display: none; }
.btn-refresh.is-spinning {
  min-width: 40px;
  justify-content: center;
  padding-left: 12px;
  padding-right: 12px;
}
.btn-refresh.is-spinning .hotspot-btn-spinner {
  margin-right: 0;
  width: 16px;
  height: 16px;
}
@keyframes hotspot-spin {
  to { transform: rotate(360deg); }
}
.hotspot-loading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.hotspot-desk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.hotspot-desk-col h3 { margin: 0 0 12px; font-size: 15px; }
.hotspot-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hotspot-card h4 { margin: 0; font-size: 15px; }
.hotspot-card p { margin: 0; font-size: 13px; line-height: 1.45; }
.hotspot-card.is-live { background: var(--surface); }
.hotspot-card-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.hotspot-derived { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.hotspot-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.4;
}
.hotspot-check input { margin-top: 3px; flex: 0 0 auto; }
.hotspot-check span { display: flex; flex-direction: column; gap: 2px; }
.hotspot-check small, .hotspot-check em { color: var(--muted); font-style: normal; font-size: 12px; }
.hotspot-topic-card { gap: 10px; }
.hotspot-topic-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.hotspot-topic-card-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hotspot-topic-discard {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  padding: 0 2px;
  margin: -2px -2px 0 0;
  cursor: pointer;
}
.hotspot-topic-discard:hover { color: #c93400; }
.hotspot-topic-card-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.hotspot-topic-go {
  min-width: 44px;
  padding: 8px 14px;
  font-size: 18px;
  line-height: 1;
}
.hotspot-card-actions { margin-top: 8px; }
.hotspot-people { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.hotspot-collision { margin: 0 0 8px 24px; display: flex; flex-direction: column; gap: 4px; }
.hotspot-hint { color: #c93400; font-size: 13px; margin: 8px 0 6px; }
#hotspot-people-hint {
  width: 100%;
  min-height: 56px;
  resize: vertical;
  background: var(--fill);
  border: 1px solid transparent;
  border-radius: var(--radius-tight);
  padding: 10px 12px;
}
.hotspot-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 24px;
}
.hotspot-modal-card {
  width: min(560px, 100%);
  background: var(--surface);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.hotspot-modal-head, .hotspot-modal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.hotspot-modal-foot { margin-top: 16px; justify-content: flex-end; }
@media (max-width: 900px) {
  .hotspot-desk-grid { grid-template-columns: 1fr; }
}
