:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #0f766e;
  --brand-2: #115e59;
  --danger: #b91c1c;
  --warn: #b45309;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #111827;
  --ink: #e5e7eb;
  --muted: #94a3b8;
  --line: #263245;
  --brand: #22a39f;
  --brand-2: #1a8d89;
  --danger: #ef4444;
  --warn: #f59e0b;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  transition: background-color 0.25s ease, color 0.25s ease;
  background:
    radial-gradient(circle at 0% 0%, #cdece8 0, transparent 35%),
    radial-gradient(circle at 100% 0%, #fdeccf 0, transparent 35%),
    var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
}

@supports not (color: color-mix(in srgb, #000 50%, #fff 50%)) {
  body {
    background: var(--bg);
  }

  .sidebar {
    background: #e9f3f1;
  }

  .nav-item.active,
  .session.active,
  .chip:hover,
  .analysis-mode-btn.active {
    background: rgba(15, 118, 110, 0.12);
    border-color: rgba(15, 118, 110, 0.34);
    color: var(--brand);
  }

  .card,
  .login-card,
  .table-wrap,
  .resume-view-item,
  .resume-view-skills,
  .resume-view-processes,
  .resume-contact-card,
  .resume-note-card,
  .raw-preview-frame-wrap,
  .raw-resume-content,
  .project-detail-grid > .card:not(.project-detail-overview),
  .org-list-card,
  .org-member-summary-card,
  .org-mapping-card,
  .chat-log,
  .chat-composer,
  .ai-toolbar,
  .ai-news-strip,
  .session,
  .chip,
  .analysis-mode-btn,
  .ai-status-badge,
  .ai-news-chip,
  .toast {
    border-color: var(--line);
    background: var(--panel);
  }

  .bubble.user,
  .analysis-mode-btn.active {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
    color: #f8fffe;
  }

  .ai-toolbar,
  .chat-log,
  .chat-composer,
  .ai-news-strip,
  .dashboard-focus-card,
  .project-detail-overview,
  .org-shell-card {
    background-image: none;
  }

  .ai-mode-note,
  .ai-status-label,
  .session-preview,
  .hint,
  .raw-preview-notice {
    color: var(--muted);
  }
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 0% 0%, rgba(34, 163, 159, 0.12) 0, transparent 35%),
    radial-gradient(circle at 100% 0%, rgba(30, 64, 175, 0.12) 0, transparent 35%),
    var(--bg);
}

.login-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.6);
  display: none;
  place-items: center;
  z-index: 40;
  padding: 20px;
  overflow: auto;
}

.login-modal.show {
  display: grid;
}

.login-modal.open {
  display: grid;
}

.login-card {
  width: min(420px, 100%);
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--line));
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
}

.login-card > * {
  min-width: 0;
}

.login-card input,
.login-card select,
.login-card textarea {
  width: 100%;
  min-width: 0;
}

.login-card .form-actions {
  position: sticky;
  bottom: -24px;
  z-index: 2;
  margin: 2px -24px -24px;
  padding: 12px 24px 24px;
  border-top: 1px solid color-mix(in srgb, var(--brand) 10%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 82%, transparent) 0%, var(--panel) 28%);
}

.resume-view-item,
.resume-view-skills,
.resume-view-processes,
.resume-contact-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
  margin-bottom: 6px;
}

.resume-view-processes {
  display: grid;
  gap: 10px;
}

.resume-view-process-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resume-view-process-head span {
  color: var(--muted);
  font-size: 12px;
}

.resume-view-process-head strong {
  font-size: 14px;
}

.resume-view-process-list {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  padding-right: 4px;
}

.resume-process-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 98%, #f8fafc 2%);
}

.resume-process-item.is-other-owner {
  border-color: color-mix(in srgb, #f59e0b 42%, var(--line));
  background: color-mix(in srgb, #f59e0b 7%, var(--panel));
}

.resume-process-main strong {
  display: block;
}

.resume-process-main p,
.resume-process-side span {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.resume-process-side {
  display: grid;
  justify-items: end;
  align-content: start;
}

.resume-process-flag {
  grid-column: 1 / -1;
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, #f59e0b 14%, var(--panel));
  color: #b45309;
  font-size: 12px;
  font-weight: 700;
}

.resume-contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

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

.zoom-value {
  min-width: 52px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.raw-preview-notice {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
}

.raw-resume-card {
  width: min(1500px, calc(100vw - 32px));
  height: min(920px, calc(100vh - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.raw-resume-layout {
  display: grid;
  grid-template-columns: minmax(0, 3.4fr) minmax(300px, 0.8fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.raw-resume-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.raw-resume-note-side {
  display: flex;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.raw-preview-frame-wrap {
  display: none;
  height: 100%;
  min-height: 0;
  max-height: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background: color-mix(in srgb, var(--panel) 96%, #eef2f7 4%);
  cursor: default;
  overscroll-behavior: contain;
  position: relative;
}

.raw-preview-frame-wrap.show {
  display: block;
}

.raw-preview-frame-wrap.can-pan {
  cursor: grab;
}

.raw-preview-canvas {
  min-height: 100%;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  box-sizing: border-box;
}

.raw-preview-canvas.hidden,
.raw-preview-frame.hidden {
  display: none;
}

.raw-preview-loading {
  min-height: calc(100% - 36px);
  width: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}

.raw-preview-page {
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

.raw-preview-page canvas {
  display: block;
}

.raw-preview-frame-wrap.dragging,
.raw-resume-content.dragging {
  cursor: grabbing;
  user-select: none;
}

.raw-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  background: #fff;
  transform-origin: top left;
  will-change: transform;
}

.raw-resume-content {
  margin: 0;
  min-height: 100%;
  max-height: none;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, #f8fafc 4%) 0%, color-mix(in srgb, var(--panel) 92%, #f3f4f6 8%) 100%);
  color: var(--ink);
  font: 14px/1.7 "SFMono-Regular", "Consolas", monospace;
  white-space: pre-wrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform-origin: top left;
  cursor: grab;
  overscroll-behavior: contain;
}

.raw-resume-content.hidden {
  display: none;
}

.login-card h2 {
  margin: 0;
}

.login-card p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.error {
  color: var(--danger);
  min-height: 18px;
  font-size: 13px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.resume-parse-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 96%, #f8fafc 4%);
}

.resume-parse-panel input[type="file"] {
  flex: 1;
  min-width: 0;
}

.resume-upload-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 96%, #f8fafc 4%);
  min-width: 0;
}

.resume-upload-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.resume-upload-section-head h3 {
  margin: 0;
  font-size: 14px;
}

.resume-upload-card {
  width: min(760px, 92vw);
  max-height: 88vh;
  overflow: auto;
}

.resume-upload-duplicate-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

.resume-recommend-card {
  width: min(820px, 92vw);
  max-height: 88vh;
  overflow: auto;
  padding-bottom: 20px;
  scroll-behavior: smooth;
}

.resume-recommend-card textarea {
  min-height: 160px;
}

.resume-recommend-card .form-actions {
  position: sticky;
  bottom: -18px;
  margin: 0 -18px -18px;
  padding: 14px 18px 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 16%, transparent 84%) 0%, var(--panel) 24%, var(--panel) 100%);
  border-top: 1px solid color-mix(in srgb, var(--line) 84%, transparent 16%);
  z-index: 1;
}

.resume-upload-insight-card {
  width: min(920px, 92vw);
  max-height: 88vh;
  overflow: auto;
  gap: 16px;
}

.resume-upload-insight-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 96%, #f8fafc 4%);
}

.resume-upload-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resume-upload-insight-head h3 {
  margin: 0;
  font-size: 15px;
}

.resume-upload-insight-list {
  display: grid;
  gap: 10px;
}

.resume-upload-insight-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent 22%);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 8%, var(--panel) 92%) 0%, var(--panel) 100%);
}

.resume-upload-insight-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resume-upload-insight-item-head strong {
  font-size: 15px;
}

.resume-upload-insight-score {
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 14%, white 86%);
  color: var(--brand);
  font-weight: 700;
  white-space: nowrap;
}

.resume-upload-insight-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 13px;
}

.resume-upload-insight-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resume-upload-insight-reasons span {
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, transparent 90%);
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent 82%);
  color: var(--ink);
  font-size: 12px;
}

.resume-upload-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.resume-upload-insight-grid strong {
  display: block;
  margin-bottom: 8px;
}

.resume-upload-insight-bullets {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--ink);
}

.resume-upload-insight-empty {
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 96%, #f8fafc 4%);
}

.resume-fixed-grid {
  min-width: 0;
}

.resume-fixed-grid input {
  min-width: 0;
}

.user-account-card {
  width: min(720px, 94vw);
}

.account-role-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 96%, #f8fafc 4%);
}

.account-role-group span {
  font-weight: 700;
}

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

.checkbox-grid label,
.checkbox-line {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: var(--ink);
  line-height: 1.35;
}

.checkbox-line {
  padding: 2px 0;
}

.admin-user-head {
  align-items: flex-start;
}

.admin-user-card .hint {
  margin-top: 6px;
}

.permission-overview-card {
  grid-column: 1 / -1;
}

#tab-admin .split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

#tab-admin .split > .card {
  min-width: 0;
}

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

.permission-role-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: color-mix(in srgb, var(--panel) 95%, #f8fafc 5%);
  display: grid;
  gap: 8px;
}

.permission-role-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.permission-role-card strong {
  font-size: 16px;
}

.permission-role-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.permission-role-card-c {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 10%, var(--panel) 90%) 0%, var(--panel) 100%);
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line) 66%);
}

.permission-matrix-table td {
  vertical-align: middle;
}

.permission-subnote {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar {
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 82%, #cdece8 18%);
  overflow: auto;
}

:root[data-theme="dark"] .sidebar {
  background: color-mix(in srgb, var(--panel) 90%, #0f172a 10%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #4a4340 0%, #3d3735 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  color: #f5efe4;
  letter-spacing: 0.02em;
}

.brand p {
  margin: 3px 0 0;
  color: rgba(245, 239, 228, 0.7);
  font-size: 12px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
}

.menu-item.active,
.menu-item:hover {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
  color: var(--brand);
}

.user-card {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.user-card .label {
  color: var(--muted);
  margin: 0;
  font-size: 12px;
}

.user-card h3 {
  margin: 6px 0;
  font-size: 15px;
}

.user-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  padding: 20px;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.topbar h2 {
  margin: 0;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.top-actions > * {
  min-width: 0;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  margin-bottom: 12px;
  padding: 18px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--brand) 18%, transparent) 0, transparent 36%),
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 88%, #d8f3ef 12%) 0%, color-mix(in srgb, var(--panel) 94%, #fff7e7 6%) 100%);
}

.dashboard-period-switch {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-hero h3 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.15;
}

.dashboard-hero p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-metrics {
  display: grid;
  gap: 12px;
}

.hero-metrics div {
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 92%, #f8fafc 8%);
}

.hero-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.hero-metrics strong {
  font-size: 28px;
}

.dashboard-focus-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-news-card-standalone {
  margin-bottom: 12px;
}

.dashboard-detail-grid {
  margin-top: 0;
}

.dashboard-focus-list,
.dashboard-news-list {
  display: grid;
  gap: 10px;
}

.dashboard-focus-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 97%, #f8fafc 3%);
}

.dashboard-focus-item strong {
  display: block;
  font-size: 16px;
}

.dashboard-focus-item p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.dashboard-focus-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.dashboard-focus-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
  color: var(--ink);
  font-size: 12px;
}

.dashboard-news-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-news-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 96%, #f8fafc 4%);
}

.dashboard-news-head strong {
  font-size: 16px;
}

.dashboard-news-head span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-news-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.dashboard-news-link {
  width: fit-content;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.dashboard-news-link:hover {
  color: var(--brand-2);
  text-decoration: underline;
}

#resumeRecommendPmField {
  display: grid;
  gap: 8px;
}

.resume-recommend-offer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.resume-recommend-offer-field {
  display: grid;
  gap: 6px;
}

.resume-recommend-offer-field span {
  color: var(--muted);
  font-size: 13px;
}

.plan-a-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.plan-a-metric-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 95%, #ecfeff 5%) 0%, var(--panel) 100%);
  box-shadow: var(--shadow);
}

.plan-a-metric-card span,
.plan-a-metric-card em {
  color: var(--muted);
  font-style: normal;
}

.plan-a-metric-card strong {
  font-size: 28px;
}

.plan-a-split-card {
  margin-top: 12px;
}

.account-metrics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.account-metrics-summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 12px;
}

@media (max-width: 720px) {
  .resume-recommend-offer-grid,
  .plan-a-summary-grid,
  .account-metrics-summary-grid {
    grid-template-columns: 1fr;
  }

  .account-metrics-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

input,
select,
button {
  font: inherit;
}

input[type="search"],
input[type="text"],
select,
.chat-input input {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 220px;
}

textarea {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
}

.resume-edit-btn,
.resume-raw-btn,
.resume-view-btn {
  margin-right: 6px;
}

.resume-recommend-btn {
  margin-right: 6px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  min-height: 0;
  overflow: auto;
}

#tab-ai.active,
#tab-pool.active {
  display: grid;
}

#tab-ai,
#tab-pool {
  min-height: 0;
  overflow: hidden;
}

#tab-ai .chat-layout,
#tab-pool .chat-layout {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.project-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.project-summary-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, #ecfeff 8%) 0%, var(--panel) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.project-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.project-summary-card strong {
  font-size: 26px;
}

.project-modal-card {
  width: min(760px, 94vw);
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.project-modal-card,
.project-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-modal-card input,
.project-modal-card select,
.project-modal-card textarea,
.project-form input,
.project-form select,
.project-form textarea {
  min-width: 0;
  width: 100%;
}

.project-list-card {
  padding-top: 16px;
}

.project-list-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-form-hero {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, var(--panel)) 0%, color-mix(in srgb, #f8fafc 55%, var(--panel)) 100%);
}

.project-form-hero strong {
  font-size: 16px;
}

.project-form-hero span,
.project-section-head p,
.project-detail-meta,
.project-overview-note span,
.project-overview-item span,
.project-detail-item-side span {
  color: var(--muted);
  font-size: 13px;
}

.project-form-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 97%, #f8fafc 3%);
}

.project-section-head h3,
.project-detail-head h3 {
  margin: 0 0 6px;
}

.project-form-grid {
  display: grid;
  gap: 12px;
}

.project-form-grid.one {
  grid-template-columns: 1fr;
}

.project-form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-modal-card textarea {
  min-height: 108px;
  resize: vertical;
}

.project-detail-shell {
  margin-top: 14px;
}

#projectDetailModal {
  z-index: 16;
  padding: 20px;
  overflow: auto;
  align-items: start;
}

#projectDetailSection {
  width: min(1240px, calc(100vw - 32px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  margin: 0;
  padding-right: 6px;
}

.project-detail-header-card {
  margin-bottom: 12px;
}

.project-detail-head {
  align-items: flex-start;
}

.project-detail-actions,
.project-list-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-detail-summary-grid,
.project-overview-grid {
  display: grid;
  gap: 12px;
}

.project-detail-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-detail-summary-card,
.project-overview-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: color-mix(in srgb, var(--panel) 96%, #f8fafc 4%);
}

.project-detail-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.project-detail-summary-card strong {
  font-size: 24px;
}

.project-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.project-detail-overview {
  grid-column: 1 / -1;
}

.project-detail-body-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.project-detail-pool-mode .project-detail-body-layout {
  grid-template-columns: minmax(0, 1fr);
}

.project-detail-pool-mode .project-detail-main-column {
  grid-column: 1 / -1;
}

.project-detail-pool-mode .project-detail-list {
  max-height: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-detail-main-column,
.project-detail-side-column {
  display: grid;
  gap: 14px;
}

.project-detail-grid > .card:not(.project-detail-overview) {
  padding: 12px;
}

.project-detail-grid > .card:not(.project-detail-overview) .card-head {
  margin-bottom: 8px;
}

.project-detail-grid > .card:not(.project-detail-overview) .card-head h3 {
  font-size: 16px;
}

.project-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-overview-item strong,
.project-detail-item strong {
  display: block;
  font-size: 15px;
}

.project-overview-note {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand) 5%, var(--panel));
  border: 1px solid var(--line);
}

.project-overview-note p,
.project-detail-item p {
  margin: 6px 0 0;
  line-height: 1.6;
}

.project-protection-note,
.resume-protection-note {
  display: inline-block;
  margin-top: 8px;
  color: #b45309;
  font-size: 12px;
  line-height: 1.5;
}

.resume-name-cell {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}

.resume-name-cell .pill,
#tab-resume .pill.warn,
#tab-resume .resume-raw-btn {
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.resume-note-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: color-mix(in srgb, var(--panel) 96%, #f8fafc 4%);
  display: grid;
  gap: 8px;
}

.resume-note-side-card {
  height: 100%;
  align-content: start;
}

.raw-note-card {
  width: 100%;
  height: 100%;
  align-content: start;
  overflow: auto;
}

.resume-note-card textarea {
  min-height: 56px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.5;
}

.resume-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.resume-note-head span {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.resume-note-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.resume-note-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.raw-note-list {
  max-height: none;
  min-height: 260px;
}

.resume-note-entry {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 98%, #f8fafc 2%);
}

.resume-note-entry.is-own {
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, var(--panel));
}

.resume-note-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.resume-note-entry-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.resume-note-entry-author {
  font-weight: 700;
  color: var(--ink);
}

.resume-note-entry-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.resume-note-delete-btn {
  border: 0;
  background: transparent;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.resume-note-delete-btn:hover {
  color: #991b1b;
}

.resume-note-delete-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.resume-note-entry p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.resume-note-card .hint {
  margin: 0;
  font-size: 12px;
}

.raw-note-card {
  margin-top: -4px;
  padding: 10px 12px;
}

.recommend-project-picker {
  display: grid;
  gap: 10px;
}

.recommend-project-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand) 8%, var(--panel));
}

.recommend-project-selected.hidden {
  display: none;
}

.recommend-project-selected p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.recommend-project-list {
  display: grid;
  gap: 8px;
  max-height: min(34vh, 320px);
  overflow: auto;
  padding-right: 4px;
}

.recommend-project-option {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 97%, #f8fafc 3%);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.recommend-project-option:hover,
.recommend-project-option.active {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--line));
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
}

.recommend-project-main strong {
  display: block;
}

.recommend-project-main p,
.recommend-project-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.recommend-project-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.project-flow-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 96%, #f8fafc 4%);
  margin: 0 6px 6px 0;
  font-size: 12px;
}

.project-flow-chip.protected {
  border-style: dashed;
}

.project-flow-empty-inline {
  color: var(--muted);
  font-size: 12px;
}

.project-name-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.project-name-trigger:hover {
  color: var(--brand);
}

.project-detail-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  max-height: 200px;
  overflow: auto;
  padding-right: 4px;
}

.project-flow-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.project-flow-grid::-webkit-scrollbar,
.project-pipeline-board::-webkit-scrollbar,
.project-detail-list::-webkit-scrollbar,
.project-flow-list::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.project-flow-grid::-webkit-scrollbar-thumb,
.project-pipeline-board::-webkit-scrollbar-thumb,
.project-detail-list::-webkit-scrollbar-thumb,
.project-flow-list::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: 999px;
}

.project-flow-grid::-webkit-scrollbar-track,
.project-pipeline-board::-webkit-scrollbar-track,
.project-detail-list::-webkit-scrollbar-track,
.project-flow-list::-webkit-scrollbar-track {
  background: transparent;
}

.project-flow-grid {
  gap: 8px;
  margin-bottom: 10px;
}

.project-flow-column {
  flex: 0 0 250px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: color-mix(in srgb, var(--panel) 97%, #f8fafc 3%);
  scroll-snap-align: start;
}

.project-flow-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.project-flow-head span {
  color: var(--muted);
  font-size: 12px;
}

.project-flow-list {
  display: grid;
  gap: 6px;
  max-height: 148px;
  overflow: auto;
  padding-right: 2px;
}

.project-flow-entry {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 95%, #f8fafc 5%);
}

.project-flow-entry.protected {
  border-style: dashed;
}

.project-flow-entry p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.project-resume-trigger {
  cursor: pointer;
}

.project-resume-trigger:hover {
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, var(--panel));
}

.project-resume-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 72%, white);
  outline-offset: 2px;
}

.project-flow-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.project-pipeline-board {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  gap: 8px;
  margin-bottom: 10px;
}

.project-pipeline-card {
  flex: 0 0 126px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 96%, #f8fafc 4%);
}

.project-pipeline-card.active {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
}

.project-pipeline-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.project-pipeline-card strong {
  font-size: 18px;
}

.project-detail-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 97%, #f8fafc 3%);
}

.project-detail-item-main {
  min-width: 0;
}

.project-detail-item-main.project-resume-trigger {
  border-radius: 10px;
  padding: 2px 4px;
  margin: -2px -4px;
}

.project-pool-candidate-card {
  align-items: flex-start;
  min-height: 156px;
}

.project-pool-candidate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.project-pool-candidate-meta span {
  white-space: nowrap;
}

.project-pool-candidate-skills {
  color: var(--muted);
  font-size: 13px;
}

.project-detail-item-side {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 132px;
}

.project-detail-item-side .btn {
  min-width: 88px;
}

.project-detail-item-side.pool-actions {
  min-width: 120px;
}

.project-detail-item-side.pool-actions .btn {
  min-width: 88px;
}

.project-detail-stage-select,
.project-detail-outcome-select {
  min-width: 132px;
  width: 132px;
}

.timeline-item {
  align-items: flex-start;
}

.project-inline-form {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.project-detail-panel {
  overflow: hidden;
}

.project-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-section-head h3 {
  margin: 0;
}

.project-panel-body {
  display: grid;
  gap: 10px;
}

.project-detail-panel.collapsed .project-panel-body {
  display: none;
}

.project-detail-panel.collapsed {
  padding-bottom: 12px;
}

.project-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 96%, #f8fafc 4%);
}

.project-filters input,
.project-filters select {
  flex: 1 1 180px;
  min-width: 180px;
}

.project-meta {
  color: var(--muted);
  font-size: 13px;
}

.project-group-row td {
  padding: 12px 8px 8px;
  background: color-mix(in srgb, var(--brand) 6%, var(--panel));
}

.project-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.project-group-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.project-group-company-btn,
.project-group-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.project-group-company-btn {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
}

.project-group-company-btn:hover {
  color: var(--brand);
}

.project-group-toggle {
  color: var(--brand);
  font-size: 13px;
  white-space: nowrap;
}

.project-group-head strong {
  font-size: 15px;
}

.project-group-head span {
  color: var(--muted);
  font-size: 12px;
}

.company-intro-card {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  display: grid;
  gap: 16px;
}

.company-intro-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.company-intro-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
  gap: 14px;
}

.company-intro-hero.single-column {
  grid-template-columns: 1fr;
}

.company-intro-overview-card,
.company-intro-stat-card,
.company-intro-section,
.company-intro-project-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 96%, #f8fbff 4%);
}

.company-intro-overview-card,
.company-intro-section,
.company-intro-project-card {
  padding: 16px;
}

.company-intro-eyebrow {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.company-intro-overview-card p {
  margin: 0;
  line-height: 1.75;
}

.company-intro-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.company-intro-stat-grid.compact {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.company-intro-stat-card {
  padding: 14px;
  display: grid;
  gap: 6px;
}

.company-intro-stat-card span,
.company-intro-section-head p {
  color: var(--muted);
  font-size: 12px;
}

.company-intro-stat-card strong {
  font-size: 28px;
}

.company-intro-section {
  display: grid;
  gap: 12px;
}

.company-intro-view-page,
.company-intro-edit-page {
  display: grid;
  gap: 14px;
}

.company-intro-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.company-intro-form-field {
  display: grid;
  gap: 8px;
}

.company-intro-form-field.full-width,
.company-intro-form-actions,
.company-intro-form .form-error {
  grid-column: 1 / -1;
}

.company-intro-form-field span {
  color: var(--muted);
  font-size: 12px;
}

.company-intro-form-field input,
.company-intro-form-field textarea {
  width: 100%;
}

.company-intro-form-field textarea {
  resize: vertical;
  min-height: 150px;
}

.company-intro-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.company-intro-section.split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  border: 0;
  background: transparent;
  padding: 0;
}

.company-intro-section.split > article {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 96%, #f8fbff 4%);
  padding: 16px;
}

.company-intro-section-head h3,
.company-intro-project-head strong {
  margin: 0;
}

.company-intro-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.company-intro-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
  color: var(--text);
  font-size: 13px;
}

.company-intro-chip.emphasis {
  background: color-mix(in srgb, #dff7ea 80%, var(--panel));
  color: #196b3a;
}

.company-intro-project-list {
  display: grid;
  gap: 12px;
}

.company-intro-project-card {
  display: grid;
  gap: 10px;
}

.company-intro-project-trigger {
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.company-intro-project-trigger:hover,
.company-intro-project-trigger:focus-visible {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.company-intro-project-head,
.company-intro-project-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.company-intro-project-head span,
.company-intro-project-meta span {
  color: var(--muted);
  font-size: 12px;
}

.company-intro-project-card p {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

@media (max-width: 900px) {
  .company-intro-hero,
  .company-intro-section.split {
    grid-template-columns: 1fr;
  }

  .company-intro-form {
    grid-template-columns: 1fr;
  }

  .company-intro-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .company-intro-project-head,
  .company-intro-project-meta,
  .project-group-head,
  .project-group-main {
    align-items: flex-start;
    flex-direction: column;
  }
}

.org-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.org-shell-card {
  display: grid;
  gap: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, #f8fbff 4%) 0%, var(--panel) 100%);
}

.org-page.hidden {
  display: none;
}

.org-page.active {
  display: grid;
  gap: 12px;
}

.org-shell-card,
.org-shell-card * {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.org-topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.org-topbar h3 {
  margin: 0;
}

.org-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.org-top-stat {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 96%, #f8fafc 4%);
}

.org-top-stat strong {
  color: var(--text);
}

.org-workspace {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
}

.org-workspace.list-only {
  grid-template-columns: 220px;
}

.org-projects-col {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 98%, #f8fafc 2%);
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.org-list-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 98%, #f8fafc 2%);
}

.org-project-row.active {
  background: color-mix(in srgb, var(--brand) 6%, var(--panel));
}

.org-project-open-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.org-detail-topbar {
  align-items: center;
}

.org-detail-topbar > div:first-child {
  display: grid;
  gap: 6px;
}

.editor-mode {
  max-width: 980px;
}

.org-list {
  display: grid;
  gap: 2px;
}

.org-list-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 10px 10px;
  cursor: pointer;
  display: block;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.org-list-item.active {
  border-left-color: color-mix(in srgb, var(--brand) 52%, var(--line));
  background: color-mix(in srgb, var(--brand) 7%, var(--panel));
}

.org-list-item strong {
  display: inline;
  font-weight: 600;
  white-space: nowrap;
}

.org-main-col {
  display: grid;
  gap: 12px;
}

.org-main-col.hidden {
  display: none;
}

.org-meta-form {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: color-mix(in srgb, var(--panel) 98%, #f8fafc 2%);
}

.org-member-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.org-member-summary-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 98%, #f8fafc 2%);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.org-member-summary-card > span {
  color: var(--muted);
  font-size: 12px;
}

.org-member-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.org-member-badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--line);
}

.org-member-badge.edit {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--line));
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
}

.org-member-badge.read {
  background: color-mix(in srgb, var(--panel) 96%, #f8fafc 4%);
}

.org-member-empty {
  color: var(--muted);
  font-size: 12px;
}

.org-selected-node {
  display: inline-flex;
  align-items: center;
  border: 1px dashed color-mix(in srgb, var(--brand) 36%, var(--line));
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}

.org-member-picker-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.org-member-picker-wrap > span {
  font-size: 12px;
  color: var(--muted);
}

.org-member-picker {
  max-height: 132px;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.org-member-row {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.org-member-row.owner {
  background: color-mix(in srgb, var(--brand) 8%, #fff);
  border-radius: 8px;
  padding: 4px;
}

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

.org-member-username {
  color: var(--muted);
}

.org-member-row select {
  min-width: 74px;
  padding: 4px 6px;
}

.org-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.org-mind-panel {
  border: 1px solid #dce4f2;
  border-radius: 20px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  padding: 16px;
  box-shadow: 0 20px 45px -34px rgba(15, 23, 42, 0.35);
  display: grid;
  gap: 14px;
}

.org-mind-stage-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.org-mind-stage-head h3 {
  margin: 0;
  font-size: 18px;
}

.org-mind-toolbar {
  display: grid;
  gap: 10px;
}

.org-mind-toolbar-xmind {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 10px 12px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.org-toolbar-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.org-toolbar-strip-right {
  justify-content: flex-end;
}

.org-toolbar-strip-right .hint {
  margin: 0 auto 0 0;
}

.org-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f8fbff;
}

.org-toolbar-group span {
  color: #5b6780;
  font-size: 12px;
  font-weight: 600;
}

.org-toolbar-group select,
.org-toolbar-group input[type="range"],
.org-toolbar-group input[type="color"] {
  margin: 0;
}

.org-toolbar-group input[type="range"] {
  width: 78px;
}

.org-toolbar-group input[type="color"] {
  width: 30px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
}

.org-tool-btn {
  border: 1px solid #d8e1ef;
  background: #ffffff;
  color: #1f2937;
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.org-tool-btn:hover {
  border-color: #8aa5ff;
  transform: translateY(-1px);
}

.org-tool-btn.active,
.org-tool-btn.primary {
  border-color: #315efb;
  background: #315efb;
  color: #ffffff;
  box-shadow: 0 10px 20px -16px rgba(49, 94, 251, 0.9);
}

.org-tool-btn.secondary {
  background: #f8fbff;
}

.org-tool-btn.zoom-readout {
  min-width: 72px;
}

.org-mind-viewport {
  position: relative;
  overflow: auto;
  min-height: 70vh;
  max-height: 80vh;
  border: 1px solid #dce4f2;
  border-radius: 18px;
  background-color: #ffffff;
  background-image: linear-gradient(#f1f5fb 1px, transparent 1px), linear-gradient(90deg, #f1f5fb 1px, transparent 1px);
  background-size: 28px 28px;
  cursor: grab;
}

.org-mind-viewport.dragging {
  cursor: grabbing;
}

.org-mind-viewport.selection-mode {
  cursor: crosshair;
}

.org-region-selection-box {
  position: absolute;
  border: 1.5px solid #315efb;
  background: rgba(49, 94, 251, 0.12);
  border-radius: 12px;
  pointer-events: none;
  z-index: 12;
}

.org-region-selection-box.hidden {
  display: none;
}

.org-mind-surface {
  position: relative;
  min-width: 1480px;
  min-height: 860px;
  padding: 56px 72px;
  transform-origin: 0 0;
}

.org-link-svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}

.org-link-svg .org-link-path-visual {
  fill: none;
  stroke: #315efb;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
}

.org-link-svg .org-link-path-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.org-link-svg.delete-mode .org-link-path-hit {
  pointer-events: stroke;
  cursor: pointer;
}

.org-link-svg.delete-mode {
  pointer-events: auto;
}

.org-link-svg.delete-mode .org-link-path-hit:hover + .org-link-path-visual,
.org-link-svg.delete-mode .org-link-path:hover {
  stroke: #dc2626;
  stroke-width: 3;
  opacity: 1;
}

.org-quick-panel {
  border: 1px solid #d6e0f0;
  border-radius: 18px;
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 12px;
  box-shadow: 0 24px 48px -30px rgba(15, 23, 42, 0.35);
  max-width: 420px;
}

.org-quick-panel.floating {
  position: sticky;
  bottom: 12px;
  margin-left: auto;
  z-index: 5;
}

.org-quick-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: color-mix(in srgb, var(--panel) 98%, #f8fafc 2%);
  display: grid;
  gap: 8px;
}

.org-quick-block h4 {
  margin: 0;
  font-size: 13px;
}

.org-quick-panel.hidden {
  display: none;
}

.org-quick-head {
  display: grid;
  gap: 2px;
}

.org-quick-head span {
  color: var(--muted);
  font-size: 12px;
}

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

.org-quick-grid.one {
  grid-template-columns: 1fr;
}

.org-quick-results {
  max-height: 180px;
  overflow: auto;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: color-mix(in srgb, var(--panel) 98%, #f8fafc 2%);
}

.org-quick-result {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 2px;
  text-align: left;
}

.org-quick-result.active {
  border-color: color-mix(in srgb, var(--brand) 48%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, #fff);
}

.org-quick-result span {
  color: var(--muted);
  font-size: 12px;
}

.org-mind-root-layout {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) auto minmax(380px, 1fr);
  gap: 40px;
  align-items: start;
}

.org-mind-wing.left {
  display: flex;
  justify-content: flex-end;
}

.org-mind-wing.right {
  display: flex;
  justify-content: flex-start;
}

.org-mind-center {
  display: flex;
  justify-content: center;
}

.org-mind-branch {
  display: grid;
  gap: 26px;
  align-items: flex-start;
}

.org-mind-branch.side-left .org-mind-item {
  justify-items: end;
}

.org-mind-branch.side-right .org-mind-item {
  justify-items: start;
}

.org-mind-item {
  position: relative;
  display: grid;
  gap: 10px;
  z-index: 2;
}

.org-mind-item-head {
  display: grid;
  gap: 10px;
  transform: translate(var(--org-node-offset-x, 0px), var(--org-node-offset-y, 0px));
}

.org-mind-item.side-center {
  justify-items: center;
}

.org-mind-item.side-left::before,
.org-mind-item.side-right::before {
  display: none;
}

.org-mind-item.side-left::before {
  right: calc(var(--org-connector-reach) * -1);
  border-right: var(--org-connector-width) var(--org-connector-style) var(--org-connector-color);
  border-top-right-radius: var(--org-connector-radius);
}

.org-mind-item.side-right::before {
  left: calc(var(--org-connector-reach) * -1);
  border-left: var(--org-connector-width) var(--org-connector-style) var(--org-connector-color);
  border-top-left-radius: var(--org-connector-radius);
}

.org-mind-item.side-left::after,
.org-mind-item.side-right::after {
  display: none;
}

.org-mind-node {
  border: 0;
  background: transparent;
  padding: 0;
  display: grid;
  gap: 8px;
  text-align: left;
  min-width: 300px;
  max-width: 520px;
  position: relative;
}

.org-link-anchors {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.org-link-anchor-wrap {
  position: absolute;
  pointer-events: none;
}

.org-link-anchor-wrap.top {
  left: 50%;
  top: -7px;
  transform: translateX(-50%);
}

.org-link-anchor-wrap.right {
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
}

.org-link-anchor-wrap.bottom {
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
}

.org-link-anchor-wrap.left {
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
}

.org-link-anchor {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid #93a2bf;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
  display: block;
  pointer-events: auto;
  cursor: default;
  opacity: 0.32;
  transition: transform 0.15s ease, opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.org-link-anchor.enabled {
  opacity: 1;
  cursor: crosshair;
}

.org-link-anchor.enabled:hover {
  transform: scale(1.12);
  border-color: #315efb;
}

.org-link-anchor.selected {
  border-color: #315efb;
  background: #315efb;
}

.org-mind-node.root-node {
  min-width: 180px;
  max-width: 240px;
  justify-items: center;
  background: linear-gradient(180deg, #3f67ff 0%, #2549dd 100%);
  border-radius: 16px;
  padding: 18px 22px;
  color: #ffffff;
  box-shadow: 0 26px 46px -28px rgba(49, 94, 251, 0.9);
}

.org-mind-node.root-node.active {
  box-shadow: 0 0 0 4px rgba(63, 103, 255, 0.16), 0 26px 46px -28px rgba(49, 94, 251, 0.9);
}

.org-node-title {
  font-size: 18px;
  line-height: 1.2;
}

.org-inline-name-input {
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
  line-height: 1.2;
  padding: 6px 8px;
  width: 100%;
}

.org-inline-name-input.root {
  max-width: 180px;
  text-align: center;
}

.org-inline-name-input.branch {
  min-width: 96px;
  max-width: 180px;
}

.org-node-desc {
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.org-mind-node.branch-node {
  justify-items: start;
  cursor: grab;
}

.org-mind-node.node-dragging {
  cursor: grabbing;
}

.org-mind-node-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.org-mind-node-row.side-left {
  flex-direction: row-reverse;
  text-align: right;
}

.org-mind-node-badge {
  flex: 0 0 auto;
  border-radius: 10px;
  background: #111111;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 11px 14px;
  box-shadow: 0 10px 20px -16px rgba(17, 17, 17, 0.75);
}

.org-mind-node-text {
  display: block;
  flex: 1 1 auto;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.75;
  padding-top: 2px;
}

.org-mind-node.active .org-mind-node-badge {
  background: #315efb;
}

.org-mind-node.group-selected {
  filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
}

.org-mind-node.group-selected.root-node,
.org-mind-node.group-selected.branch-node {
  box-shadow: 0 0 0 4px rgba(49, 94, 251, 0.16), 0 18px 34px -24px rgba(49, 94, 251, 0.85);
  border-radius: 16px;
}

.org-mind-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #667085;
  font-size: 12px;
  flex-wrap: wrap;
}

.org-mind-actions {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.org-mind-item.side-left .org-mind-actions {
  justify-content: flex-end;
}

.org-mind-item.side-center .org-mind-actions,
.org-mind-item.side-center .org-node-mapping-chips {
  justify-content: center;
}

.org-node-mini-btn {
  border: 1px solid #d6deec;
  background: rgba(255, 255, 255, 0.92);
  color: #344054;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.org-node-mini-btn.danger {
  color: #b42318;
}

.org-node-mapping-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.org-mind-item.side-left .org-node-mapping-chips {
  justify-content: flex-end;
}

.org-node-mapping-chip {
  border: 1px solid #cdd9ff;
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 11px;
  color: #315efb;
  background: #eef3ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--org-map-width, 176px);
  height: var(--org-map-height, 36px);
  position: relative;
  transform: translate(var(--org-map-offset-x, 0px), var(--org-map-offset-y, 0px));
  touch-action: none;
  user-select: none;
  cursor: grab;
  white-space: nowrap;
  transition: box-shadow 0.15s ease;
  overflow: hidden;
}

.org-node-mapping-chip.dragging {
  cursor: grabbing;
  box-shadow: 0 8px 20px -10px rgba(49, 94, 251, 0.65);
}

.org-node-mapping-chip.group-selected {
  border-color: #315efb;
  box-shadow: 0 0 0 3px rgba(49, 94, 251, 0.16);
}

.org-node-mapping-chip.resizing {
  cursor: nwse-resize;
  box-shadow: 0 8px 20px -10px rgba(49, 94, 251, 0.65);
}

.org-map-chip-label {
  display: block;
  width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.org-map-resize-handle {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid #8ea2f2;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  cursor: nwse-resize;
}

.org-map-resize-handle.tl {
  top: -5px;
  left: -5px;
  cursor: nwse-resize;
}

.org-map-resize-handle.tr {
  top: -5px;
  right: -5px;
  cursor: nesw-resize;
}

.org-map-resize-handle.bl {
  bottom: -5px;
  left: -5px;
  cursor: nesw-resize;
}

.org-map-resize-handle.br {
  bottom: -5px;
  right: -5px;
  cursor: nwse-resize;
}

.org-mapping-list {
  display: grid;
  gap: 12px;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.org-mapping-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.org-mapping-toolbar-top {
  justify-content: flex-end;
}

.org-mapping-list-head {
  align-items: end;
}

.org-mapping-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e0e7f3;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 28px -24px rgba(15, 23, 42, 0.35);
}

.org-mapping-team {
  border: 1px solid #dde5f2;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.org-mapping-team-toggle {
  width: 100%;
  border: 0;
  background: #f7faff;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-align: left;
}

.org-mapping-team-toggle strong {
  font-size: 14px;
}

.org-mapping-team-toggle span {
  color: #667085;
  font-size: 12px;
}

.org-mapping-team.expanded .org-mapping-team-toggle {
  background: #edf3ff;
}

.org-mapping-team-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.org-mapping-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid #e5ebf5;
  border-radius: 12px;
  padding: 10px;
}

.org-mapping-main {
  display: grid;
  gap: 8px;
}

.org-mapping-main strong {
  line-height: 1.5;
}

.org-mapping-edit-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1.1fr);
  gap: 8px;
}

.org-mapping-meta {
  font-size: 11px;
  color: #667085;
}

.org-mapping-actions {
  display: grid;
  gap: 6px;
  align-content: start;
}

.org-mapping-card p,
.org-mapping-card span {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 12px;
}

.project-edit-btn {
  margin-right: 6px;
}

.project-list-card .table-wrap {
  overflow-x: auto;
}

#tab-projects th,
#tab-projects td {
  vertical-align: middle;
}

#tab-projects th:nth-child(1),
#tab-projects td.project-name-cell {
  width: 180px;
  max-width: 180px;
}

#tab-projects th:nth-child(2),
#tab-projects td.project-owner-cell {
  width: 120px;
  max-width: 120px;
}

#tab-projects th:nth-child(3),
#tab-projects td.project-target-cell {
  width: 88px;
  max-width: 88px;
}

#tab-projects th:nth-child(4),
#tab-projects td.project-date-cell {
  width: 128px;
  max-width: 128px;
}

#tab-projects th:nth-child(5),
#tab-projects td.project-status-cell {
  width: 96px;
  max-width: 96px;
}

#tab-projects th:nth-child(6),
#tab-projects td.project-priority-cell {
  width: 104px;
  max-width: 104px;
}

#tab-projects th:nth-child(7),
#tab-projects td.project-stage-cell {
  width: 112px;
  max-width: 112px;
}

#tab-projects th:nth-child(8),
#tab-projects td.project-flow-cell {
  width: 220px;
  max-width: 220px;
}

#tab-projects th:nth-child(9),
#tab-projects td.project-note-cell {
  width: 220px;
  max-width: 220px;
}

#tab-projects th:nth-child(10),
#tab-projects td.project-owner-meta-cell {
  width: 108px;
  max-width: 108px;
}

#tab-projects th:nth-child(11),
#tab-projects td.project-datetime-cell {
  width: 166px;
  max-width: 166px;
}

#tab-projects th:nth-child(12),
#tab-projects td.project-action-cell {
  width: 186px;
  max-width: 186px;
}

#tab-projects td.project-name-cell,
#tab-projects td.project-owner-cell,
#tab-projects td.project-target-cell,
#tab-projects td.project-date-cell,
#tab-projects td.project-status-cell,
#tab-projects td.project-priority-cell,
#tab-projects td.project-stage-cell,
#tab-projects td.project-flow-cell,
#tab-projects td.project-note-cell,
#tab-projects td.project-owner-meta-cell,
#tab-projects td.project-datetime-cell,
#tab-projects td.project-action-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tab-projects td.project-flow-cell {
  white-space: normal;
}

#tab-projects td.project-action-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

#tab-projects td.project-action-cell .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

#tab-projects td.project-status-cell .pill,
#tab-projects td.project-priority-cell .pill {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

#tab-projects table {
  min-width: 1720px;
  table-layout: fixed;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.kpi-card {
  background: var(--panel);
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 14px;
}

.kpi-card p {
  margin: 0;
  color: var(--muted);
}

.kpi-card h3 {
  margin: 8px 0;
  font-size: 26px;
}

.kpi-card span {
  color: var(--muted);
  font-size: 12px;
}

.kpi-card.danger {
  background: color-mix(in srgb, var(--danger) 10%, var(--panel));
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-head h3 {
  margin: 0;
}

.card-head.compact {
  margin-bottom: 12px;
}

.timeline,
.todo,
.rules {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}

.timeline li,
.todo li,
.rules li {
  margin: 10px 0;
}

.todo li label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  white-space: nowrap;
}

.todo li.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.admin-audit-card {
  margin-top: 12px;
}

.okr-settings-form input {
  min-width: 0;
  width: 100%;
}

.system-role-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.system-role-settings-list {
  display: grid;
  gap: 10px;
}

.system-role-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.system-role-row .btn {
  white-space: nowrap;
}

.audit-change {
  margin: 4px 0;
  line-height: 1.5;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.resume-filters-grid input,
.resume-filters-grid select {
  flex: 1 1 160px;
  min-width: 0;
}

.resume-filters-grid {
  flex-wrap: wrap;
  overflow-x: auto;
  padding-bottom: 4px;
}

.resume-filters-grid > .btn {
  flex: 0 1 auto;
}

.resume-filters-grid input,
.resume-filters-grid select {
  min-width: 180px;
}

.resume-meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.resume-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}

.resume-pagination-info {
  color: var(--muted);
  font-size: 14px;
}

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

.table-wrap {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

#tab-resume .table-wrap {
  overflow-x: auto;
}

#tab-resume table {
  min-width: 1120px;
  table-layout: auto;
}

#tab-resume th,
#tab-resume td {
  vertical-align: middle;
}

#tab-resume th:nth-child(1),
#tab-resume td:nth-child(1) {
  min-width: 150px;
}

#tab-resume th:nth-child(2),
#tab-resume td.resume-company-cell {
  min-width: 220px;
}

#tab-resume th:nth-child(3),
#tab-resume td:nth-child(3) {
  min-width: 180px;
}

#tab-resume th:nth-child(4),
#tab-resume td.resume-role-cell {
  min-width: 140px;
  white-space: nowrap;
}

#tab-resume th:nth-child(5),
#tab-resume td.resume-years-cell {
  min-width: 86px;
  white-space: nowrap;
}

#tab-resume th:nth-child(6),
#tab-resume td.resume-raw-cell {
  min-width: 116px;
  white-space: nowrap;
}

#tab-resume th:nth-child(7),
#tab-resume td.resume-action-cell {
  min-width: 260px;
}

#tab-resume td.resume-raw-cell .btn,
#tab-resume td.resume-action-cell .btn {
  white-space: nowrap;
  writing-mode: horizontal-tb;
  line-height: 1.15;
}

#tab-resume td.resume-action-cell {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.hint {
  color: var(--muted);
  margin: 8px 0 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.table-wrap th:last-child,
.table-wrap td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--panel);
  box-shadow: -10px 0 16px -18px rgba(15, 23, 42, 0.8);
}

.table-wrap th:last-child {
  z-index: 2;
}

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

th {
  color: var(--muted);
  font-weight: 700;
}

.pill {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill.danger {
  background: #fee2e2;
  color: var(--danger);
}

.pill.warn {
  background: #ffedd5;
  color: var(--warn);
}

.pill.success {
  background: #dcfce7;
  color: #166534;
}

.pill.active {
  background: #dcfce7;
  color: #166534;
}

.pill.paused {
  background: #fef3c7;
  color: #92400e;
}

.pill.closed {
  background: #e5e7eb;
  color: #4b5563;
}

.pill.neutral {
  background: #e0f2fe;
  color: #075985;
}

@media (max-width: 1080px) {
  .permission-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .permission-overview-grid {
    grid-template-columns: 1fr;
  }
}

.pill.sourced,
.pill.recommended,
.pill.interview,
.pill.offer,
.pill.hired,
.pill.dropped,
.pill.scheduled,
.pill.completed,
.pill.passed,
.pill.rejected,
.pill.hold {
  background: #e0f2fe;
  color: #075985;
}

.pill.success {
  background: #dcfce7;
  color: #166534;
}

.tree ul {
  list-style: square;
  padding-left: 18px;
}

.tree li {
  margin: 8px 0;
}

.mapping p {
  margin: 8px 0;
}

.chat-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  max-height: none;
  gap: 16px;
  overflow: hidden;
}

#aiChatLayout.ai-fit-panel-open {
  grid-template-columns: 340px minmax(0, 1fr) 380px;
}

@media (max-width: 1500px) {
  #aiChatLayout.ai-fit-panel-open {
    grid-template-columns: minmax(280px, 0.86fr) minmax(420px, 1fr);
  }

  #aiChatLayout.ai-fit-panel-open .ai-fit-detail-panel {
    grid-column: 1 / -1;
    min-height: 380px;
  }
}

.chat-sidebar {
  display: grid;
  grid-template-rows: minmax(220px, 0.78fr) minmax(0, 1.22fr);
  gap: 14px;
  min-height: 0;
}

.card-subpanel {
  min-height: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 10%, var(--line));
  border-radius: 22px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 99%, white 1%) 0%, color-mix(in srgb, var(--panel) 96%, var(--brand) 4%) 100%);
  box-shadow: 0 18px 42px rgba(3, 10, 22, 0.16);
}

.chat-sessions {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.chat-session-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px;
  gap: 8px;
  min-height: 0;
}

.chat-session-list {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: none;
}

.chat-session-list::-webkit-scrollbar {
  display: none;
}

.chat-sidebar-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.chat-sidebar-subhead {
  margin-bottom: 8px;
}

.chat-sidebar-list {
  display: grid;
  gap: 8px;
}

.chat-sidebar-list .session {
  margin-bottom: 0;
}

.chat-sessions h3 {
  margin-top: 0;
}

@media (max-width: 960px) {
  .raw-resume-card {
    width: min(98vw, 98vw);
    max-height: 94vh;
    padding: 16px;
  }

  .raw-resume-layout {
    grid-template-columns: 1fr;
  }

  .raw-preview-frame-wrap,
  .raw-preview-canvas,
  .raw-preview-frame {
    min-height: 56vh;
  }

  .raw-preview-frame {
    height: 56vh;
  }

  .raw-preview-loading {
    min-height: calc(56vh - 36px);
  }

  .raw-resume-content {
    min-height: 280px;
    max-height: 34vh;
  }

  .project-summary-grid,
  .project-detail-summary-grid,
  .project-overview-grid,
  .project-detail-grid,
  .project-flow-grid,
  .project-pipeline-board,
  .org-summary-grid,
  .dashboard-focus-grid,
  .resume-view-layout,
  .project-form-grid.two,
  .project-form-grid.three {
    grid-template-columns: 1fr;
  }

  .project-detail-body-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-okr-record {
    grid-template-columns: 1fr;
  }

  .dashboard-okr-record-actions {
    flex-wrap: wrap;
  }

  .project-detail-pool-mode .project-detail-list {
    grid-template-columns: 1fr;
  }

  .project-detail-item,
  .project-list-actions,
  .project-detail-head,
  .project-section-head,
  .org-node-card,
  .org-mapping-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-detail-item-side {
    justify-items: start;
    min-width: 0;
  }
}

.session {
  width: 100%;
  text-align: left;
  background: color-mix(in srgb, var(--panel) 97%, white 3%);
  border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--line));
  border-radius: 16px;
  padding: 12px 13px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.session:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
}

.session strong {
  display: block;
  margin-bottom: 4px;
}

.session-preview {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.session strong {
  display: block;
  margin-bottom: 4px;
}

.session-preview {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.session.active {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 16%, var(--panel)) 0%, color-mix(in srgb, var(--panel) 96%, white 4%) 100%);
}

.chat-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.ai-fit-detail-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.chat-main-head {
  display: grid;
  gap: 8px;
}

.pool-main {
  display: grid;
  min-height: 0;
  overflow: hidden;
}

.chat-main.pool-mode {
  grid-template-rows: minmax(0, 1fr);
}

.chat-main.pool-mode .ai-toolbar,
.chat-main.pool-mode .ai-news-strip,
.chat-main.pool-mode .chat-log,
.chat-main.pool-mode .chat-input {
  display: none;
}

.ai-pool-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.ai-pool-page.hidden {
  display: none;
}

.ai-pool-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--brand) 10%, transparent) 0%, transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 98%, white 2%) 0%, color-mix(in srgb, var(--panel) 92%, var(--brand) 8%) 100%);
}

.ai-pool-page-head h3 {
  margin: 0;
  font-size: 28px;
}

.ai-pool-page-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ai-pool-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-pool-stage-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ai-pool-stage-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  background: color-mix(in srgb, var(--panel) 97%, white 3%);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ai-pool-stage-tab.active {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--line));
  background: color-mix(in srgb, var(--brand) 14%, var(--panel));
  color: var(--ink);
}

.ai-pool-stage-panels {
  display: grid;
  min-height: 0;
}

.ai-pool-stage-panel {
  min-height: 0;
}

.ai-pool-stage-panel.hidden {
  display: none;
}

.ai-pool-panel {
  display: grid;
  gap: 12px;
  min-height: 0;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--brand) 10%, transparent) 0%, transparent 36%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 97%, white 3%) 0%, color-mix(in srgb, var(--panel) 92%, var(--brand) 8%) 100%);
}

.ai-pool-form-panel,
.ai-pool-result-panel,
.ai-pool-retained-panel {
  overflow: auto;
  min-height: 0;
}

.ai-pool-head,
.ai-pool-result-head,
.ai-pool-head-actions,
.ai-pool-actions,
.ai-pool-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-pool-head h3,
.ai-pool-result-head h3 {
  margin: 0;
  font-size: 22px;
}

.ai-pool-select {
  min-width: 180px;
  min-height: 36px;
}

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

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

.ai-pool-grid.ai-pool-grid-six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.ai-pool-grid label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ai-pool-grid label span {
  font-size: 12px;
  color: var(--muted);
}

.ai-pool-grid input,
.ai-pool-grid select,
.ai-pool-select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  background: color-mix(in srgb, var(--panel) 96%, white 4%);
  min-height: 46px;
  padding: 0 12px;
  font: inherit;
  color: var(--ink);
}

.ai-pool-grid .span-2 {
  grid-column: span 2;
}

.ai-pool-grid .span-6 {
  grid-column: span 6;
}

.ai-pool-actions {
  justify-content: flex-start;
  align-items: center;
}

.ai-pool-actions .form-hint.error {
  color: #b42318;
  font-size: 12px;
}

.ai-pool-summary {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.ai-pool-summary-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-pool-summary-tags .pill {
  white-space: nowrap;
}

.ai-pool-result-list {
  min-height: 0;
  max-height: min(68vh, 780px);
  overflow: auto;
  display: grid;
  gap: 12px;
}

.ai-pool-retained-wrap {
  min-height: 0;
  height: 100%;
}

.ai-pool-retained-table {
  min-width: 900px;
  table-layout: auto;
}

.ai-pool-retained-table th,
.ai-pool-retained-table td {
  vertical-align: middle;
}

.ai-pool-retained-table td:nth-child(1) {
  min-width: 150px;
}

.ai-pool-retained-table td:nth-child(2) {
  min-width: 200px;
}

.ai-pool-retained-table td:nth-child(3),
.ai-pool-retained-table td:nth-child(4),
.ai-pool-retained-table td:nth-child(5),
.ai-pool-retained-table td:nth-child(6) {
  white-space: nowrap;
}

.ai-pool-phone-cell {
  font-variant-numeric: tabular-nums;
}

.ai-pool-action-cell .btn {
  white-space: nowrap;
}

.session.pool-entry {
  padding: 10px 10px 9px;
}

.session.pool-entry strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.session.pool-entry .session-preview {
  display: grid;
  gap: 3px;
}

.pool-entry-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}

.pool-entry-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-pool-result-item {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  background: color-mix(in srgb, var(--panel) 96%, var(--brand) 4%);
}

.ai-pool-result-top,
.ai-pool-result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-pool-result-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-pool-result-name strong {
  font-size: 16px;
}

.ai-pool-score {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 18%, var(--panel));
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.ai-pool-result-meta {
  color: var(--muted);
  font-size: 12px;
}

.ai-pool-reason {
  font-size: 13px;
  line-height: 1.45;
}

.ai-pool-feedback {
  justify-content: flex-start;
}

.ai-pool-feedback .btn {
  min-width: 72px;
}

.ai-pool-feedback .btn.active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 14%, var(--panel));
}

.ai-pool-empty {
  padding: 20px 16px;
  border: 1px dashed color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  background: color-mix(in srgb, var(--panel) 98%, white 2%);
}

.ai-toolbar {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 10%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 98%, white 2%);
}

.ai-toolbar > div {
  min-width: 0;
}

.ai-toolbar-mode,
.ai-toolbar-prompts {
  display: grid;
  gap: 8px;
  align-content: start;
}

.ai-toolbar-prompts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-toolbar-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.analysis-mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.analysis-mode-btn {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line));
  background: color-mix(in srgb, var(--panel) 97%, white 3%);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.analysis-mode-btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--brand) 48%, var(--line));
}

.analysis-mode-btn.active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 84%, #5eead4 16%) 0%, color-mix(in srgb, var(--brand-2) 92%, #0f766e 8%) 100%);
  border-color: color-mix(in srgb, var(--brand) 54%, var(--line));
  color: color-mix(in srgb, white 92%, var(--panel) 8%);
}

.ai-mode-note {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.ai-status-label {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 9px;
}

.ai-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
}

.ai-status-badge.pending,
.ai-status-badge.mock {
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
}

.chip {
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line));
  background: color-mix(in srgb, var(--panel) 97%, white 3%);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  font-size: 11px;
  line-height: 1.2;
  min-height: 32px;
  text-align: left;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  background: color-mix(in srgb, var(--panel) 78%, var(--brand) 22%);
}

.ai-news-strip {
  display: none;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 10%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 98%, white 2%);
  overflow: hidden;
}

.ai-news-strip-head {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: 0.04em;
}

.ai-news-strip-track-wrap {
  overflow: hidden;
}

.ai-news-strip-track {
  display: flex;
  gap: 10px;
  width: max-content;
  animation: ai-news-marquee 28s linear infinite;
}

.ai-fit-helper {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 10%, var(--line));
  border-radius: 22px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 99%, white 1%) 0%, color-mix(in srgb, var(--panel) 96%, var(--brand) 4%) 100%);
  box-shadow: none;
  overflow: hidden;
}

.ai-fit-helper-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}

.ai-fit-helper-kicker {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.ai-fit-helper-head h3 {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}

.ai-fit-helper-caption {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ai-fit-helper-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--brand) 54%, #7dd3fc 46%) transparent;
}

.ai-fit-query-panel,
.ai-fit-result-shell {
  display: grid;
  gap: 12px;
}

.ai-fit-query-panel {
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 10%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 98%, white 2%);
}

.ai-fit-query-grid {
  display: grid;
  gap: 12px;
}

.ai-fit-helper-grid::-webkit-scrollbar {
  width: 8px;
}

.ai-fit-helper-grid::-webkit-scrollbar-track {
  background: transparent;
}

.ai-fit-helper-grid::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--brand) 46%, #7dd3fc 54%);
  border-radius: 999px;
}

.ai-fit-helper-grid::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--brand) 62%, #67e8f9 38%);
}

.ai-fit-helper-field {
  display: grid;
  gap: 6px;
}

.ai-fit-helper-searchbox {
  padding: 10px 12px 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 10%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 99%, white 1%);
}

.ai-fit-helper-field span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.ai-fit-helper-field input {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 10%, var(--line));
  background: color-mix(in srgb, var(--panel) 99%, white 1%);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}

.ai-fit-helper-searchbox input {
  background: color-mix(in srgb, var(--panel) 99%, white 1%);
}

.ai-fit-helper-grid select {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 10%, var(--line));
  background: color-mix(in srgb, var(--panel) 99%, white 1%);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}

.ai-fit-helper .ai-status-label {
  color: var(--muted);
}

.ai-fit-helper-meta {
  font-size: 12px;
  color: var(--muted);
}

.ai-fit-helper-grid .btn {
  min-height: 44px;
  white-space: nowrap;
  box-shadow: none;
}

.ai-fit-helper-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-fit-helper-status {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 10%, var(--line));
  background: color-mix(in srgb, var(--panel) 98%, white 2%);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.65;
}

.ai-fit-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ai-fit-insight-card,
.ai-fit-evaluation-card,
.ai-fit-shortlist-item,
.ai-fit-example-block {
  border: 1px solid color-mix(in srgb, var(--brand) 10%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 98%, white 2%);
}

.ai-fit-insight-card {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.ai-fit-insight-card.accent {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 10%, var(--panel)) 0%, color-mix(in srgb, var(--panel) 96%, white 4%) 100%);
}

.ai-fit-insight-card.caution {
  background: linear-gradient(180deg, color-mix(in srgb, #fff4df 72%, var(--panel)) 0%, color-mix(in srgb, var(--panel) 96%, white 4%) 100%);
}

.ai-fit-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ai-fit-summary-card {
  padding: 14px;
  display: grid;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--line));
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 98%, white 2%) 0%, color-mix(in srgb, var(--panel) 93%, var(--brand) 7%) 100%);
}

.ai-fit-summary-card.accent {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 12%, var(--panel)) 0%, color-mix(in srgb, var(--panel) 95%, white 5%) 100%);
}

.ai-fit-summary-card span,
.ai-fit-summary-head span {
  color: var(--muted);
  font-size: 12px;
}

.ai-fit-summary-card strong {
  font-size: 22px;
}

.ai-fit-summary-card p,
.ai-fit-summary-head strong {
  margin: 0;
}

.ai-fit-summary-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line));
  background: color-mix(in srgb, var(--panel) 98%, white 2%);
}

.ai-fit-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.ai-fit-summary-head > div {
  display: grid;
  gap: 4px;
}

.ai-fit-insight-card.wide {
  grid-column: 1 / -1;
}

.ai-fit-insight-card span {
  color: var(--muted);
  font-size: 12px;
}

#aiFitDetailBtn {
  justify-self: flex-start;
}

.ai-fit-detail-head {
  align-items: flex-start;
}

.ai-fit-detail-body {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}

.ai-fit-detail-stack {
  display: grid;
  gap: 12px;
}

.ai-fit-insight-card strong {
  font-size: 24px;
}

.ai-fit-insight-card p,
.ai-fit-example-block p,
.ai-fit-shortlist-top p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.ai-fit-shortlist {
  display: grid;
  gap: 12px;
}

.ai-fit-shortlist-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.ai-fit-shortlist-head span {
  color: var(--muted);
  font-size: 12px;
}

.ai-fit-shortlist-list {
  display: grid;
  gap: 10px;
}

.ai-fit-probability-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ai-fit-evaluation-card,
.ai-fit-shortlist-item,
.ai-fit-example-block {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.ai-fit-evaluation-head,
.ai-fit-shortlist-top,
.ai-fit-shortlist-actions,
.ai-fit-reason-list,
.ai-fit-flag-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.ai-fit-reason-list,
.ai-fit-flag-list,
.ai-fit-shortlist-actions {
  justify-content: flex-start;
}

.ai-fit-score-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.ai-fit-score-badge.level-high {
  background: color-mix(in srgb, #dff7ea 88%, var(--panel));
  color: #196b3a;
}

.ai-fit-score-badge.level-mid {
  background: color-mix(in srgb, #fff4df 84%, var(--panel));
  color: #8a5a10;
}

.ai-fit-score-badge.level-low {
  background: color-mix(in srgb, #fde6e6 84%, var(--panel));
  color: #a23333;
}

.ai-fit-empty {
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed color-mix(in srgb, var(--brand) 20%, var(--line));
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 96%, white 4%);
}

.ai-fit-result-shell .ai-fit-helper-status {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 94%, white 6%) 0%, color-mix(in srgb, var(--panel) 98%, white 2%) 100%);
}

.ai-news-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  background: color-mix(in srgb, var(--panel) 94%, var(--brand) 6%);
  color: var(--ink);
  font-size: 10px;
  white-space: nowrap;
}

.ai-news-chip time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@keyframes ai-news-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.chat-log-shell {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid;
}

.chat-log {
  display: grid;
  align-content: start;
  height: 100%;
  min-height: 0;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--brand) 8%, transparent) 0%, transparent 28%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, var(--brand) 4%) 0%, color-mix(in srgb, var(--panel) 92%, #f8fafc 8%) 100%);
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  border-radius: 18px;
  padding: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-padding-bottom: 18px;
  scrollbar-width: auto;
  overscroll-behavior: contain;
  scrollbar-color: color-mix(in srgb, var(--brand) 58%, #7dd3fc 42%) color-mix(in srgb, var(--panel) 84%, #0f172a 16%);
  scrollbar-gutter: stable;
}

.chat-log::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.chat-log::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--panel) 84%, #0f172a 16%);
  border-left: 1px solid color-mix(in srgb, var(--brand) 12%, var(--line));
  border-radius: 999px;
}

.chat-log::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 74%, #67e8f9 26%) 0%, color-mix(in srgb, var(--brand-2) 86%, #22d3ee 14%) 100%);
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--panel) 84%, #0f172a 16%);
}

.chat-log::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 86%, #67e8f9 14%) 0%, color-mix(in srgb, var(--brand-2) 92%, #22d3ee 8%) 100%);
}

.chat-scroll-rail {
  position: relative;
  display: block;
  width: 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 82%, #0f172a 18%);
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line));
}

.chat-scroll-rail.is-disabled {
  opacity: 0.45;
}

.chat-scroll-thumb {
  position: absolute;
  inset: 2px 1px auto;
  width: calc(100% - 2px);
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 84%, #67e8f9 16%) 0%, color-mix(in srgb, var(--brand-2) 90%, #22d3ee 10%) 100%);
  cursor: grab;
}

.chat-log-shell > #chatScrollRail {
  display: none;
}

.session-scroll-rail {
  min-height: 0;
}

.session-scroll-thumb {
  min-height: 44px;
}

.bubble {
  max-width: 86%;
  padding: 11px 13px;
  border-radius: 18px;
  margin-bottom: 8px;
  line-height: 1.5;
  display: grid;
  gap: 8px;
  box-shadow: 0 12px 26px -24px rgba(15, 23, 42, 0.55);
  align-self: start;
}

.bubble:last-child {
  margin-bottom: 0;
}

.bubble.ai {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 98%, white 2%) 0%, color-mix(in srgb, var(--panel) 88%, var(--brand) 12%) 100%);
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
}

.bubble.user {
  margin-left: auto;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
  border: 1px solid color-mix(in srgb, var(--brand) 72%, var(--line));
  color: color-mix(in srgb, white 92%, var(--panel) 8%);
}

.chat-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  position: relative;
  z-index: 1;
  padding: 6px 0 0;
  margin: 0;
  border-radius: 24px;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.chat-composer {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 98%, white 2%) 0%, color-mix(in srgb, var(--panel) 90%, var(--brand) 10%) 100%);
  box-shadow: 0 18px 34px -28px rgba(15, 23, 42, 0.35);
}

.chat-input textarea {
  min-width: 0;
  width: 100%;
  min-height: 72px;
  max-height: 120px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  line-height: 1.5;
  color: var(--ink);
}

.chat-image-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chat-image-tray.hidden {
  display: none;
}

.chat-image-card {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  background: color-mix(in srgb, var(--panel) 82%, var(--brand) 18%);
}

.chat-image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-image-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.74);
  color: #ffffff;
  cursor: pointer;
}

.bubble-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bubble-images img {
  width: min(220px, 100%);
  max-height: 220px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
}

.bubble.ai .bubble-images img {
  border-color: color-mix(in srgb, var(--brand) 20%, var(--line));
  background: var(--panel);
}

.chat-input .btn {
  min-height: 44px;
  align-self: end;
  border-radius: 16px;
  box-shadow: 0 16px 30px -24px rgba(49, 94, 251, 0.65);
}

.chat-input textarea::placeholder {
  color: #7c8a9d;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--line));
  background: color-mix(in srgb, var(--brand) 15%, var(--panel));
  color: var(--ink);
  box-shadow: var(--shadow);
  z-index: 999;
}

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

  .sidebar {
    padding: 14px 14px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 12px;
  }

  .brand {
    margin-bottom: 0;
    padding: 12px 14px;
    border-radius: 14px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand p {
    font-size: 11px;
  }

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

  .menu-item {
    min-height: 44px;
    padding: 10px 10px;
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
  }

  .user-card {
    margin-top: 0;
    padding: 10px 12px;
    border-radius: 14px;
  }

  .user-card h3 {
    font-size: 14px;
  }

  .main {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .topbar p {
    margin-top: 4px;
    font-size: 13px;
  }

  .kpi-grid,
  .split,
  .chat-layout,
  .org-workspace,
  .org-main-grid,
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .org-topbar {
    flex-direction: column;
  }

  .org-topbar-actions {
    justify-content: flex-start;
  }

  .org-member-summary {
    grid-template-columns: 1fr;
  }

  .org-member-row {
    grid-template-columns: 18px 1fr;
  }

  .org-member-username {
    display: none;
  }

  .ai-pool-stage-tabs,
  .ai-pool-grid.ai-pool-grid-six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-pool-grid .span-6 {
    grid-column: span 2;
  }

  .ai-pool-form-panel,
  .ai-pool-result-panel,
  .ai-pool-retained-panel {
    min-height: 0;
  }

  .chat-sidebar {
    order: 2;
  }

  .chat-main {
    order: 1;
  }

  .chat-main-head {
    gap: 8px;
  }

  .ai-fit-summary-grid {
    grid-template-columns: 1fr;
  }

  #aiChatLayout,
  #aiChatLayout.ai-fit-panel-open {
    grid-template-columns: 1fr;
  }

  .login-modal {
    padding: 12px;
  }

  .login-card {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .login-card .form-actions {
    bottom: -18px;
    margin: 2px -18px -18px;
    padding: 12px 18px 18px;
  }

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

  .resume-filters-grid,
  .project-filters,
  #tab-admin .split {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .resume-filters-grid input,
  .resume-filters-grid select,
  .resume-filters-grid > .btn,
  .project-filters input,
  .project-filters select,
  .project-filters > .btn {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .sidebar {
    padding: 12px;
  }

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

  .menu-item {
    font-size: 13px;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-actions #globalSearch,
  .top-actions .btn {
    min-width: 0;
    width: 100%;
  }

  .ai-pool-stage-tabs,
  .ai-pool-grid.ai-pool-grid-six {
    grid-template-columns: 1fr;
  }

  .ai-pool-grid .span-2,
  .ai-pool-grid .span-6 {
    grid-column: auto;
  }

  .org-member-row select {
    grid-column: 1 / -1;
    width: 100%;
  }

  .org-mind-root-layout {
    grid-template-columns: 1fr;
  }

  .org-mind-wing.left,
  .org-mind-wing.right,
  .org-mind-center {
    justify-content: flex-start;
  }

  .org-mind-item.side-left::before,
  .org-mind-item.side-right::before {
    left: -28px;
    right: auto;
    border-left: 2px solid color-mix(in srgb, var(--brand) 24%, var(--line));
    border-top-left-radius: 18px;
    border-right: 0;
    border-top-right-radius: 0;
  }

  .org-mind-viewport {
    min-height: 54vh;
    max-height: 62vh;
  }

  .org-mind-surface {
    min-width: 820px;
    min-height: 560px;
  }

  .org-quick-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-period-switch {
    justify-content: flex-start;
  }

  .ai-toolbar {
    grid-template-columns: 1fr;
  }

  .ai-pool-workbench,
  .ai-pool-grid,
  .ai-pool-stage-tabs,
  .ai-pool-grid.ai-pool-grid-six {
    grid-template-columns: 1fr;
  }

  .ai-pool-grid .span-2,
  .ai-pool-grid .span-6 {
    grid-column: span 1;
  }

  .chat-layout {
    height: auto;
    min-height: 0;
    max-height: none;
    gap: 12px;
  }

  .chat-input {
    grid-template-columns: 1fr;
  }

  .ai-toolbar {
    grid-template-columns: 1fr;
  }

  .ai-toolbar-prompts {
    display: none;
  }

  .ai-mode-note {
    display: none;
  }

  .ai-fit-summary-head {
    flex-direction: column;
  }

  .ai-fit-detail-panel {
    min-height: 420px;
  }

  .chat-sidebar {
    grid-template-rows: auto auto;
  }

  .chat-sessions,
  .ai-fit-helper,
  .chat-log-shell,
  .chat-input,
  .ai-toolbar,
  .ai-news-strip {
    border-radius: 18px;
  }

  .ai-news-strip {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .ai-fit-helper-head,
  .ai-fit-helper-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ai-fit-helper-actions,
  .ai-fit-insight-grid {
    grid-template-columns: 1fr;
  }

  .ai-fit-shortlist-head,
  .ai-fit-evaluation-head,
  .ai-fit-shortlist-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-fit-helper-head .hint {
    text-align: left;
  }

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