:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #f0f2f7;
  --line: #dde3ee;
  --line-strong: #c7d1e0;
  --text: #1a2236;
  --text-soft: #475569;
  --muted: #7a869a;
  --muted-strong: #64748b;
  --accent: #1b4fd8;
  --accent-strong: #1340b0;
  --accent-soft: #ebf4ff;
  --danger: #e03131;
  --danger-soft: #fef2f2;
  --success: #10b981;
  --warning: #f59e0b;
  --sidebar: #0f1f45;
  --sidebar-panel: #1a2f5a;
  --sidebar-line: #1e3366;
  --sidebar-text: #ffffff;
  --sidebar-muted: #cbd5e1;
  --code-bg: #111827;
  --brand-navy: #0f1f45;
  --brand-blue: #1b4fd8;
  --brand-blue-light: #3d8bf8;
  --brand-sky: #ebf4ff;
  --brand-slate: #475569;
  --brand-gray: #94a3b8;
  --brand-success: #10b981;
  --brand-warning: #f59e0b;
  --brand-danger: #e03131;
  --brand-info: #3d8bf8;
  --brand-divider: #dde3ee;
  --shadow-sm: 0 2px 10px rgba(15, 31, 69, 0.08);
  --shadow-md: 0 14px 32px rgba(15, 31, 69, 0.12);
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.8), rgba(244,246,248,0.96) 240px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, "HarmonyOS Sans SC", "MiSans", "Alibaba PuHuiTi 3.0",
    "SF Pro Display", "SF Pro Text", "PingFang SC",
    "Microsoft YaHei UI", "Noto Sans CJK SC", "Source Han Sans SC",
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 480px);
  gap: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(6, 116, 108, 0.18), transparent 32%),
    linear-gradient(135deg, #071017 0%, #0d1924 44%, #f3f6f8 44.1%, #f3f6f8 100%);
}

.login-visual {
  min-height: 100vh;
  padding: 72px;
  display: grid;
  align-content: center;
  gap: 32px;
  color: #f7fbff;
}

.login-brand-mark {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #079489, #0a5f88);
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.login-eyebrow,
.login-panel-label {
  color: #72d6cc;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-visual h1 {
  margin-top: 12px;
  max-width: 620px;
  color: #fff;
  font-size: 54px;
  line-height: 1.06;
}

.login-visual p {
  margin-top: 18px;
  max-width: 560px;
  color: #b8c7d5;
  font-size: 17px;
}

.login-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 760px;
}

.login-insight-grid article {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 16px;
  backdrop-filter: blur(12px);
}

.login-insight-grid strong,
.login-insight-grid span {
  display: block;
}

.login-insight-grid strong {
  color: #fff;
}

.login-insight-grid span {
  margin-top: 5px;
  color: #aab9c8;
  font-size: 12px;
}

.login-panel {
  align-self: center;
  justify-self: center;
  width: min(420px, calc(100vw - 36px));
  display: grid;
  gap: 18px;
  padding: 34px;
  border: 1px solid rgba(216, 224, 232, 0.9);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.16);
}

.login-panel h2 {
  margin-top: 6px;
  color: var(--text);
  font-size: 24px;
}

.login-role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.login-role-switch label {
  cursor: pointer;
}

.login-role-switch input {
  position: absolute;
  opacity: 0;
}

.login-role-switch span {
  min-height: 40px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 800;
}

.login-role-switch input:checked + span {
  background: var(--sidebar);
  color: #fff;
}

.login-field {
  display: grid;
  gap: 7px;
}

.login-field span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.login-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 850;
  background: linear-gradient(135deg, #06746c, #0d5c83);
  box-shadow: 0 16px 34px rgba(6, 116, 108, 0.24);
}

.login-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

#stopBtn:disabled,
.email-mode-switch button:disabled {
  display: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 18px 14px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 11px;
  padding: 8px 6px 16px;
  border-bottom: 1px solid var(--sidebar-line);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #0b766e;
  color: #fff;
  font-weight: 750;
  font-size: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 15px;
  font-weight: 720;
}

.brand span,
.system-card span {
  color: var(--sidebar-muted);
  font-size: 12px;
}

.nav {
  display: grid;
  align-content: start;
  gap: 5px;
}

.nav-item {
  width: 100%;
  min-height: 40px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--sidebar-muted);
  background: transparent;
  text-align: left;
  transition: background 140ms ease, color 140ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
  color: #fff;
  background: var(--sidebar-panel);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-sub-item {
  min-height: 34px;
  margin-left: 18px;
  width: calc(100% - 18px);
  font-size: 13px;
}

.nav-icon {
  width: 24px;
  text-align: center;
  font-size: 15px;
}

.system-card {
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
}

.system-card strong {
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.main {
  min-width: 0;
  padding: 28px;
  display: grid;
  align-content: start;
  gap: 22px;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 750;
}

.user-chip span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--text);
  font-size: 28px;
  line-height: 1.12;
  font-weight: 780;
}

h2 {
  color: var(--text-soft);
  font-size: 16px;
  font-weight: 760;
}

.topbar p,
.section-heading span,
.field span,
.metric span,
.placeholder p {
  color: var(--muted);
}

.topbar p {
  margin-top: 5px;
}

.top-actions,
.section-heading,
.actions,
.switches {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.panel,
.metric,
.placeholder {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(216, 224, 232, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel {
  padding: 22px;
  min-width: 0;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 7px;
  padding: 0 15px;
  border: 1px solid transparent;
  font-weight: 720;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.primary-button {
  background: linear-gradient(135deg, #08796f, #0a658b);
  color: #fff;
  border-color: rgba(6, 116, 108, 0.28);
  box-shadow: 0 10px 20px rgba(8, 118, 111, 0.2);
}

.primary-button:hover {
  background: linear-gradient(135deg, #05665f, #075273);
  box-shadow: 0 12px 24px rgba(8, 118, 111, 0.26);
  transform: translateY(-1px);
}

.secondary-button,
.icon-button {
  color: #17445b;
  background: linear-gradient(180deg, #f7fbff, #eaf2f8);
  border-color: #c9d9e6;
  box-shadow: 0 6px 14px rgba(30, 64, 92, 0.08);
}

.secondary-button:hover,
.icon-button:hover {
  color: #0f3345;
  border-color: #a9bdcc;
  background: linear-gradient(180deg, #fff, #dfeaf3);
  box-shadow: 0 9px 18px rgba(30, 64, 92, 0.13);
  transform: translateY(-1px);
}

.danger-button {
  color: #fff;
  background: linear-gradient(135deg, #c24135, #9f2d24);
  border-color: rgba(180, 35, 24, 0.28);
  box-shadow: 0 10px 20px rgba(180, 35, 24, 0.16);
}

.danger-button:hover {
  background: linear-gradient(135deg, #a9362c, #84231d);
  box-shadow: 0 12px 24px rgba(180, 35, 24, 0.22);
  transform: translateY(-1px);
}

.icon-button {
  width: 36px;
  padding: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 13px;
}

.metric {
  min-height: 86px;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 5px;
  background: var(--surface);
}

.metric span {
  font-size: 12px;
  font-weight: 600;
}

.metric strong {
  color: var(--text);
  font-size: 23px;
  line-height: 1.1;
  font-weight: 760;
}

.dashboard-metrics {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.chart-panel {
  position: relative;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 320px;
}

.pie-chart {
  position: relative;
  width: min(180px, 72vw);
  aspect-ratio: 1;
  margin: 2px auto 0;
  border-radius: 50%;
  background: #e8eef3;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.pie-chart::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 6;
  min-width: 190px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-line;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.pie-chart:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pie-chart::after {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.pie-legend {
  display: none;
}

.legend-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.legend-item span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 650;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-item b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.legend-item em {
  min-width: 42px;
  text-align: right;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.chart-empty {
  position: absolute;
  inset: 96px 18px 18px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(248, 251, 253, 0.86);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.todo-panel {
  display: grid;
  gap: 14px;
}

.todo-list {
  display: grid;
  gap: 12px;
}

.todo-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(216, 225, 232, 0.9);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}

.todo-item strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 14px;
}

.todo-item p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.todo-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.todo-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 132px;
}

.todo-priority,
.todo-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 143, 131, 0.1);
  color: var(--brand);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.todo-priority {
  background: rgba(245, 158, 11, 0.13);
  color: #b45309;
}

.priority-urgent,
.priority-high {
  border-left-color: #e85d75;
}

.priority-low {
  border-left-color: #64748b;
}

.todo-empty {
  display: grid;
  min-height: 118px;
  place-items: center;
  border: 1px dashed rgba(148, 163, 184, 0.7);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.activity-panel,
.result-panel,
.jobs-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 13px;
  min-width: 0;
}

.section-heading {
  min-height: 42px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(216, 225, 232, 0.86);
}

.section-heading > div {
  min-width: 0;
}

.section-heading h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#llmAnalysisDetailMeta {
  display: grid;
  gap: 5px;
  margin-top: 6px;
  line-height: 1.45;
}

#logs {
  margin: 0;
  min-height: 440px;
  max-height: calc(100vh - 340px);
  overflow: auto;
  border-radius: 8px;
  background: var(--code-bg);
  color: #d8e4ee;
  padding: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.pipeline {
  display: grid;
  gap: 10px;
}

.pipeline article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  display: grid;
  gap: 4px;
  background: var(--surface-raised);
}

.pipeline b,
.pipeline span {
  display: block;
}

.pipeline b {
  font-weight: 700;
}

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

.task-panel {
  max-width: 1280px;
}

.acquisition-jobs-panel {
  max-width: 1280px;
  display: grid;
  gap: 14px;
}

.task-list-table {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.task-list-table table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

.task-list-table th,
.task-list-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.task-list-table th:nth-child(1),
.task-list-table td:nth-child(1) {
  width: 13%;
}

.task-list-table th:nth-child(2),
.task-list-table td:nth-child(2) {
  width: 18%;
}

.task-list-table th:nth-child(3),
.task-list-table td:nth-child(3) {
  width: 25%;
}

.task-list-table th:nth-child(4),
.task-list-table td:nth-child(4) {
  width: 28%;
}

.task-list-table th:nth-child(5),
.task-list-table td:nth-child(5) {
  width: 16%;
}

.acquisition-job-row td {
  vertical-align: top;
}

.acquisition-job-row b,
.acquisition-job-row span,
.acquisition-job-row small {
  display: block;
}

.acquisition-job-row td > span,
.job-progress span,
.job-progress small {
  color: var(--muted);
  font-size: 12px;
}

.acquisition-job-row.is-running td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.job-key-info {
  max-width: 360px;
  color: var(--text-soft) !important;
  font-size: 13px !important;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.job-progress {
  display: grid;
  gap: 4px;
  min-width: 220px;
}

.job-progress b {
  color: var(--text);
}

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

.warning-icon-button {
  position: relative;
  min-width: 34px;
  height: 34px;
  border: 1px solid #f2b84b;
  border-radius: 999px;
  background: #fff3d8;
  color: #8a4b00;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(161, 92, 0, 0.14);
}

.warning-icon-button span {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #b45309;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
}

.compact-button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.no-vnc-link,
.no-vnc-action {
  color: #07595c;
  background: linear-gradient(180deg, #effcf8, #dcefeb);
  border-color: #aad3ca;
}

.no-vnc-switches {
  grid-column: span 7;
  justify-content: flex-start;
  padding: 8px 10px;
  border: 1px solid #cfe7df;
  border-radius: 8px;
  background: #f3fbf8;
}

.no-vnc-check {
  min-height: 34px;
}

.no-vnc-link::before,
.no-vnc-action::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 999px;
  background: #0f9f88;
  box-shadow: 0 0 0 4px rgba(15, 159, 136, 0.12);
}

.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 15, 23, 0.56);
}

.log-modal {
  width: min(1040px, 96vw);
  max-height: min(760px, 90vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #0b1118;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.log-modal header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 14px;
  background: #111a23;
}

.log-modal h2 {
  color: #f8fafc;
}

.log-modal header span {
  display: block;
  margin-top: 3px;
  color: #9fb0c2;
  font-size: 12px;
}

.log-modal .icon-button {
  color: #d8e4ee;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  font-size: 20px;
}

#jobModalLogs {
  margin: 0;
  min-height: 420px;
  overflow: auto;
  background: #071018;
  color: #d8e4ee;
  padding: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.state-pill {
  min-height: 28px;
  display: inline-grid;
  align-items: center;
  border: 1px solid rgba(8, 118, 111, 0.22);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px 16px;
  margin-top: 20px;
  align-items: start;
}

.form-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.section-label {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 760;
}

.platform-switch,
.method-switch {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.platform-option,
.method-option {
  min-height: 88px;
  border: 1px solid #cfdbe4;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfcfd);
  padding: 15px 16px;
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.platform-option {
  min-height: 78px;
}

.platform-option:hover,
.method-option:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.07);
}

.platform-option.active,
.method-option.active {
  border-color: rgba(6, 116, 108, 0.42);
  background: linear-gradient(180deg, #f2fbf8, #e7f5f2);
  box-shadow:
    inset 0 0 0 1px rgba(6, 116, 108, 0.12),
    0 10px 22px rgba(6, 116, 108, 0.1);
}

.platform-option.planned {
  background: #f7f9fb;
  color: var(--muted);
  cursor: not-allowed;
}

.platform-option.planned:hover {
  border-color: #cfdbe4;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.platform-option input,
.method-option input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.platform-option input:disabled {
  accent-color: var(--muted);
}

.platform-option b,
.platform-option small,
.method-option b,
.method-option small {
  display: block;
}

.platform-option b,
.method-option b {
  font-weight: 720;
  letter-spacing: 0;
}

.platform-option small,
.method-option small {
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

.advanced-field {
  display: none !important;
}

.field {
  grid-column: span 3;
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.suggested-field,
.keyword-field {
  grid-column: span 6;
}

.domain-field {
  grid-column: span 4;
}

.wide {
  grid-column: span 6;
}

input[type="number"],
input:not([type]),
select,
textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  box-shadow: inset 0 1px 1px rgba(16, 24, 40, 0.03);
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.55;
}

select[multiple] {
  min-height: 92px;
  padding: 7px 9px;
}

.native-multi-select {
  display: none;
}

.multi-select {
  position: relative;
}

.multi-select-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 8px 11px;
  box-shadow: inset 0 1px 1px rgba(16, 24, 40, 0.03);
  font-weight: 620;
}

.multi-select-trigger::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  flex: 0 0 auto;
}

.multi-select.open .multi-select-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(6, 116, 108, 0.08);
}

.multi-select-label {
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-select.empty .multi-select-label {
  color: #9aa8b7;
  font-weight: 500;
}

.multi-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  display: none;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-md);
  padding: 6px;
}

.multi-select.open .multi-select-menu {
  display: grid;
  gap: 2px;
}

.multi-option {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  color: var(--text-soft);
  padding: 0 8px;
  font-weight: 620;
}

.multi-option:hover {
  background: var(--surface-soft);
}

.multi-option input {
  accent-color: var(--accent);
}

input::placeholder,
textarea::placeholder {
  color: #9aa8b7;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(8, 118, 111, 0.18);
  border-color: var(--accent);
  box-shadow:
    inset 0 1px 1px rgba(16, 24, 40, 0.03),
    0 0 0 4px rgba(6, 116, 108, 0.08);
}

.switches {
  grid-column: span 7;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding-top: 4px;
}

.check {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-weight: 600;
}

.check input {
  accent-color: var(--accent);
}

.actions {
  grid-column: span 5;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-self: end;
  padding-top: 4px;
}

.start-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.start-hint.warning {
  color: #b42318;
  font-weight: 700;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-height: 280px;
  max-height: calc(100vh - 470px);
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

#accountTableWrap {
  min-height: 672px;
  height: 672px;
  max-height: none;
}

#llmAnalysisDetailTableWrap {
  min-height: 920px;
  height: 920px;
  max-height: none;
}

#priceTableWrap {
  min-height: 672px;
  height: 672px;
  max-height: none;
}

.table-wrap::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid #fff;
  border-radius: 999px;
  background: rgba(31, 43, 57, 0.24);
}

.table-wrap::-webkit-scrollbar-track {
  background: rgba(242, 245, 247, 0.86);
}

.account-library {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.account-platform-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.platform-tab {
  min-height: 38px;
  border: 1px solid #cbd9e5;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #edf4f8);
  color: #1c3f55;
  padding: 0 16px;
  font-weight: 720;
  box-shadow: 0 5px 12px rgba(30, 64, 92, 0.07);
}

.platform-tab:hover {
  border-color: #a8bccb;
  box-shadow: 0 8px 16px rgba(30, 64, 92, 0.12);
  transform: translateY(-1px);
}

.platform-tab.active {
  border-color: rgba(6, 116, 108, 0.42);
  background: linear-gradient(135deg, #e4f7f4, #d9edf8);
  color: var(--accent-strong);
}

.nav-parent {
  cursor: default;
  opacity: 0.95;
}

.nav-parent.parent-active {
  background: rgba(255, 255, 255, 0.05);
  color: #d9f8f4;
}

.nav-parent.parent-active::before {
  opacity: 0.45;
}

.account-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) minmax(180px, 0.8fr) minmax(120px, 0.45fr);
  gap: 12px;
  align-items: end;
}

.account-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.account-query-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 2px;
}

.account-query-actions > div {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.account-result-tabs {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-top: 2px;
}

.account-result-tab {
  min-height: 36px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 7px 7px 0 0;
  background: #f2f6f9;
  color: #365166;
  padding: 0 12px;
  font-weight: 760;
}

.account-result-tab.active {
  background: #fff;
  border-bottom-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 -1px 8px rgba(15, 23, 42, 0.05);
}

.llm-internal-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  overflow-x: auto;
  padding: 0 2px;
}

.llm-internal-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 7px 7px 0 0;
  background: #f2f6f9;
  color: #365166;
  font-weight: 760;
  padding: 0 6px;
  white-space: nowrap;
}

.llm-internal-tab.active {
  background: #fff;
  border-bottom-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 -1px 8px rgba(15, 23, 42, 0.05);
}

.llm-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.llm-tab-close:hover {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
}

.llm-task-panel {
  margin-top: 12px;
}

#accountResultsPanel {
  min-width: 0;
  overflow: hidden;
}

.llm-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 12px;
  align-items: start;
}

.llm-task-list {
  display: grid;
  gap: 10px;
}

.llm-task-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  border-left: 4px solid rgba(148, 163, 184, 0.6);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.llm-task-item:hover,
.llm-task-item:focus-visible {
  border-color: #b8cbd9;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.llm-task-item.status-running {
  border-left-color: #2563eb;
}

.llm-task-item.status-waiting {
  border-left-color: #a16207;
}

.llm-task-item.status-done {
  border-left-color: #0f8f83;
}

.llm-task-item.status-warning {
  border-left-color: #d97706;
}

.llm-task-item.status-stopped {
  border-left-color: #64748b;
}

.llm-task-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.llm-task-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  border: 1px solid transparent;
}

.status-pill.status-running {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #bfdbfe;
}

.status-pill.status-waiting {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.status-pill.status-done {
  color: #047857;
  background: #d1fae5;
  border-color: #a7f3d0;
}

.status-pill.status-warning {
  color: #b45309;
  background: #ffedd5;
  border-color: #fed7aa;
}

.status-pill.status-stopped,
.status-pill.status-unknown {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.llm-task-meta,
.llm-task-params {
  margin-top: 7px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
}

.semantic-param-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.semantic-param-title {
  flex: 0 0 auto;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  color: var(--muted-strong);
  font-weight: 800;
}

.semantic-param-list {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.semantic-param-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  max-width: 100%;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid #d8e4ec;
  background: #f8fbfd;
  color: #34495c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.semantic-param-label {
  color: #5c6f80;
  font-weight: 760;
  white-space: nowrap;
}

.semantic-param-values {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.semantic-param-values b {
  display: inline-flex;
  align-items: center;
  max-width: 240px;
  min-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #102033;
  font-weight: 850;
}

.semantic-param-platform,
.semantic-param-name {
  background: #e7f5f2;
  border-color: #b9dfd7;
}

.semantic-param-platform .semantic-param-values b,
.semantic-param-name .semantic-param-values b {
  color: #045d57;
}

.semantic-param-domain,
.semantic-param-major {
  background: #eef4ff;
  border-color: #c9d8f7;
}

.semantic-param-domain .semantic-param-values b,
.semantic-param-major .semantic-param-values b {
  color: #1d4f91;
}

.semantic-param-region,
.semantic-param-influence {
  background: #fff4e7;
  border-color: #f5d1a2;
}

.semantic-param-region .semantic-param-values b,
.semantic-param-influence .semantic-param-values b {
  color: #8a4b0d;
}

.semantic-param-language,
.semantic-param-type {
  background: #f1f5f9;
  border-color: #d5e0ea;
}

.semantic-param-language .semantic-param-values b,
.semantic-param-type .semantic-param-values b {
  color: #334155;
}

.semantic-param-requirements {
  border-radius: 8px;
  background: #f5f0ff;
  border-color: #d9c9f5;
}

.semantic-param-requirements .semantic-param-values b {
  max-width: 520px;
  color: #5b3a8f;
}

.semantic-param-score,
.semantic-param-batch {
  background: #ecfdf5;
  border-color: #b8e4cc;
}

.semantic-param-score .semantic-param-values b,
.semantic-param-batch .semantic-param-values b {
  color: #047857;
}

.semantic-empty-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: #f3f6f8;
  border: 1px dashed #cbd7e1;
}

.llm-task-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  cursor: default;
}

.range-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.llm-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.users-panel {
  min-width: 0;
}

.user-management-shell {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}

.customer-management-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}

.customer-table-wrap {
  max-width: 100%;
  min-height: calc(100vh - 210px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.customer-table-wrap table {
  width: 100%;
  min-width: 1120px;
}

.customer-table-wrap td {
  vertical-align: top;
}

.customer-table-wrap td strong,
.customer-table-wrap td small {
  display: block;
}

.customer-table-wrap td small {
  max-width: 260px;
  margin-top: 4px;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: anywhere;
}

.selected-row td {
  background: #f0f8f6;
}

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

.customer-form {
  min-width: 0;
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.customer-modal {
  width: min(760px, 94vw);
  max-height: min(860px, 92vh);
  overflow: auto;
  box-shadow: 0 24px 80px rgba(7, 15, 23, 0.28);
}

.customer-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.project-management-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}

.project-internal-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  padding: 0 2px;
}

.project-internal-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 7px 7px 0 0;
  background: #f2f6f9;
  color: #365166;
  font-weight: 760;
  padding: 0 10px;
  white-space: nowrap;
}

.project-internal-tab.active {
  background: #fff;
  border-bottom-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 -1px 8px rgba(15, 23, 42, 0.05);
}

.project-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.project-tab-close:hover {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
}

.project-list,
.project-detail-panel,
.project-form {
  min-width: 0;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.project-list-item {
  width: 100%;
  min-height: 152px;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.project-list-item:hover,
.project-list-item.active {
  border-color: rgba(6, 116, 108, 0.38);
  background: var(--accent-soft);
}

.project-list-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.project-list-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list-title span {
  flex: 0 0 auto;
  border: 1px solid rgba(6, 116, 108, 0.2);
  border-radius: 999px;
  background: #eef8f6;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  padding: 2px 8px;
}

.project-list-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
}

.project-list-meta span,
.project-list-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list-meta span,
.project-list-summary,
.project-empty span,
.project-detail-head span,
.project-account-heading span {
  color: var(--muted);
  font-size: 12px;
}

.project-list-summary {
  margin: 0;
}

.project-detail-panel,
.project-form {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.project-form:not(.hidden) {
  position: fixed;
  z-index: 82;
  top: 50%;
  left: 50%;
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  transform: translate(-50%, -50%);
  box-shadow: 0 24px 80px rgba(7, 15, 23, 0.28);
}

.project-empty {
  min-height: 240px;
  display: grid;
  place-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.project-empty strong {
  color: var(--text);
  font-size: 18px;
}

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

.project-detail-actions,
.project-account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.project-requirement-upload {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 1fr);
  align-items: end;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.project-requirement-upload span {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.project-description {
  color: var(--text-soft);
  white-space: pre-wrap;
}

.project-platform-field legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.project-platform-field {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px 12px;
  background: var(--surface-raised);
}

.project-platform-field label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 10px;
  font-weight: 720;
}

.project-platform-field input {
  accent-color: var(--accent);
}

.project-detail-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  padding: 0 2px;
}

.project-detail-tab {
  min-height: 38px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 7px 7px 0 0;
  background: #f2f6f9;
  color: #365166;
  font-weight: 760;
  padding: 0 12px;
  white-space: nowrap;
}

.project-detail-tab.active {
  background: #fff;
  border-bottom-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 -1px 8px rgba(15, 23, 42, 0.05);
}

.project-tab-panels,
.project-tab-panel,
.project-info-list,
.project-account-group,
.project-document-section {
  display: grid;
  gap: 12px;
}

.project-info-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.project-info-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.project-info-row:last-child {
  border-bottom: 0;
}

.project-info-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.project-info-row p {
  margin: 0;
  color: var(--text-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.project-account-group,
.project-document-section {
  position: relative;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.project-account-table-wrap {
  overflow: auto;
  max-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-account-table-wrap table {
  min-width: 1420px;
}

.project-account-table-wrap th,
.project-account-table-wrap td {
  vertical-align: top;
}

.project-account-table-wrap td {
  max-width: 220px;
}

.project-account-table-wrap .match-reason {
  display: inline-block;
  min-width: 180px;
  white-space: normal;
}

.account-list-with-import {
  position: relative;
}

.floating-import-button {
  position: sticky;
  right: 12px;
  z-index: 4;
  float: right;
  margin: 8px 8px 8px 0;
}

.selection-column {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.project-import-modal {
  width: min(560px, 94vw);
  display: grid;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
}

.project-import-modal header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  background: var(--surface-soft);
}

.project-import-modal header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.project-import-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.customer-material-list {
  display: grid;
  gap: 8px;
}

.customer-material-item {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  padding: 10px 12px;
  text-decoration: none;
}

.customer-material-item:hover {
  border-color: rgba(6, 116, 108, 0.42);
  background: var(--accent-soft);
}

.customer-material-item span,
.compact-empty {
  color: var(--muted);
  font-size: 12px;
}

.user-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.user-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.user-card.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.user-card strong,
.user-card span {
  display: block;
}

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

.user-status {
  width: max-content;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.user-status.disabled {
  background: var(--danger-soft);
  color: var(--danger);
}

.user-form {
  min-width: 0;
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

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

.user-form-head span,
.permission-editor span,
.user-form-actions span {
  color: var(--muted);
  font-size: 12px;
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.permission-editor {
  display: grid;
  gap: 12px;
}

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

.permission-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-raised);
}

.permission-option input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.permission-option strong,
.permission-option span {
  display: block;
}

.permission-option span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.user-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.account-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.filter-block {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.filter-block.full-row {
  grid-column: 1 / -1;
}

.filter-block span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.filter-block input,
.filter-block select,
.filter-block textarea,
.filter-block .multi-select,
.filter-block .range-row {
  min-width: 0;
}

.filter-block textarea {
  min-height: 38px;
  resize: vertical;
}

.semantic-filter-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 12px;
  align-items: start;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 12px;
  color: var(--text-soft);
  font-weight: 700;
}

.filter-chip input {
  accent-color: var(--accent);
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.sort-header {
  width: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  font: inherit;
  white-space: nowrap;
}

.sort-header.active {
  color: var(--accent);
}

.text-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.match-score {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.match-reason {
  display: inline-block;
  max-width: 360px;
  color: var(--text-soft);
  white-space: normal;
  line-height: 1.45;
}

.price-input {
  width: 120px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 7px 9px;
}

.price-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 143, 131, 0.12);
  outline: none;
}

#priceTableWrap .price-sticky {
  position: sticky;
  z-index: 3;
  background: #fff;
  box-shadow: -1px 0 0 var(--line);
}

#priceTableWrap th.price-sticky {
  z-index: 5;
  background: var(--surface-soft);
}

#priceTableWrap .price-action-column {
  right: 0;
  width: 96px;
  min-width: 96px;
}

#priceTableWrap .price-quote-column {
  right: 96px;
  width: 144px;
  min-width: 144px;
}

#priceTableWrap .price-cost-column {
  right: 240px;
  width: 144px;
  min-width: 144px;
}

#priceTableWrap tbody tr:hover .price-sticky {
  background: #fbfcfd;
}

td {
  max-width: none;
  overflow-wrap: normal;
}

tbody tr:hover td {
  background: #fbfcfd;
}

tbody tr.account-row-viewed td {
  background: #f6f8fa;
  color: #667689;
}

tbody tr.account-row-viewed:hover td {
  background: #eef3f6;
}

.viewed-account-link {
  color: #6f7f91;
  filter: grayscale(0.65);
  opacity: 0.78;
}

.account-row-viewed .match-score {
  background: #e7edf2;
  color: #516171;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 18px;
}

.scroll-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.detail-panel {
  display: grid;
  gap: 16px;
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.account-detail {
  display: grid;
  gap: 18px;
}

.communication-panel {
  display: grid;
  gap: 18px;
}

.communication-shell {
  height: max(1300px, calc(100vh - 160px));
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f5;
}

.conversation-sidebar {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #f7fafb;
  border-right: 1px solid var(--line);
}

.conversation-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border-bottom: 1px solid rgba(216, 225, 232, 0.78);
  padding: 10px;
}

.icon-button-wide {
  min-height: 42px;
  padding: 0 14px;
}

.conversation-list {
  overflow: auto;
}

.conversation-item {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid rgba(216, 225, 232, 0.78);
  background: transparent;
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.conversation-item:hover,
.conversation-item.active {
  background: #e9f3f1;
}

.conversation-select {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.conversation-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 760;
}

.conversation-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.conversation-main b,
.conversation-main small,
.conversation-main em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-main small,
.conversation-side time {
  color: var(--muted);
  font-size: 12px;
}

.conversation-main em {
  color: var(--text-soft);
  font-size: 12px;
  font-style: normal;
}

.conversation-side {
  align-self: start;
  display: grid;
  justify-items: end;
  gap: 6px;
  padding-top: 2px;
}

.unread-badge {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 11px;
  font-weight: 760;
  padding: 0 6px;
}

.conversation-delete {
  align-self: center;
  border: 0;
  background: transparent;
  color: #a34a4a;
  font-size: 12px;
  font-weight: 700;
  padding: 6px;
}

.conversation-delete:hover {
  color: #b42318;
  text-decoration: underline;
}

.chat-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(560px, 1fr) auto;
  background: #edf2f4;
}

.chat-empty {
  min-height: 420px;
  display: grid;
  place-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.chat-empty strong {
  color: var(--text);
  font-size: 18px;
}

.chat-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  padding: 12px 16px;
}

.chat-header strong,
.chat-header span {
  display: block;
}

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

.chat-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 12px 0;
}

.chat-tabs button {
  min-height: 38px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font-weight: 700;
}

.chat-tabs button.active {
  color: var(--accent);
  border-color: var(--accent);
}

.chat-messages {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 18px;
}

.chat-bubble {
  width: min(70%, 680px);
  display: grid;
  gap: 6px;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
}

.chat-bubble.outgoing {
  align-self: flex-end;
  background: #d9f2df;
}

.chat-bubble.incoming {
  align-self: flex-start;
  background: #fff;
}

.chat-bubble.incoming[data-reply-target] {
  cursor: pointer;
}

.chat-bubble.selected-reply {
  outline: 2px solid rgba(6, 116, 108, 0.42);
  box-shadow: 0 0 0 4px rgba(6, 116, 108, 0.1);
}

.chat-bubble.failed {
  background: var(--danger-soft);
}

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

.chat-bubble p {
  margin: 0;
  color: var(--text-soft);
  white-space: pre-wrap;
}

.reply-hint {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.chat-compose {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  padding: 12px;
}

.chat-compose-fields {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(160px, 1fr);
  gap: 10px;
}

.chat-compose textarea {
  min-height: 170px;
  resize: vertical;
}

.chat-compose > .compose-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.email-mode-switch {
  justify-content: flex-start !important;
  gap: 6px !important;
}

.email-mode-switch button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text-soft);
  padding: 0 12px;
  font-weight: 720;
}

.email-mode-switch button.active {
  border-color: rgba(6, 116, 108, 0.42);
  background: var(--accent-soft);
  color: var(--accent);
}

.email-mode-switch button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.readonly-contact {
  display: grid;
  gap: 6px;
}

.readonly-contact span,
.email-compose-grid label span,
.new-conversation-panel label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.readonly-contact input[readonly] {
  background: #f3f7f8;
  color: var(--text-soft);
}

.email-compose-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.4fr);
  gap: 10px;
}

.email-compose-grid label {
  display: grid;
  gap: 6px;
}

.reply-selection {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(6, 116, 108, 0.2);
  border-radius: 8px;
  background: rgba(228, 245, 242, 0.72);
  padding: 9px 10px;
}

.reply-selection span,
.reply-selection small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.reply-selection b {
  min-width: 0;
  overflow: hidden;
  color: var(--accent);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-tools {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.compose-tools label {
  min-width: 180px;
  display: grid;
  gap: 6px;
}

.compose-tools label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.primary-button:disabled,
.primary-button.is-sending,
.secondary-button:disabled,
.secondary-button.is-sending {
  background: #8b99a7;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.78;
}

.new-conversation-panel {
  max-width: 620px;
  display: grid;
  gap: 14px;
  padding: 22px;
}

.new-conversation-panel label {
  display: grid;
  gap: 6px;
}

.account-pick-list {
  display: grid;
  gap: 8px;
}

.account-pick-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.account-pick-item:hover {
  border-color: rgba(6, 116, 108, 0.42);
  background: var(--accent-soft);
}

.account-pick-item span {
  color: var(--muted);
  font-size: 12px;
}

.communication-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.communication-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.communication-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.communication-history {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.message-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 250px);
  overflow: auto;
  padding-right: 4px;
}

.message-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 12px;
}

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

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

.message-card p {
  max-height: 120px;
  overflow: auto;
  margin: 0;
  color: var(--text-soft);
  white-space: pre-wrap;
}

.state-pill.success {
  color: var(--success);
  background: #e9f7ef;
}

.state-pill.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.persona-panel,
.detail-fields {
  display: grid;
  gap: 12px;
}

.detail-section-title {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 780;
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.persona-card,
.detail-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 12px;
}

.persona-card span,
.detail-field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.persona-card strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

.detail-fields {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.detail-field.long {
  grid-column: 1 / -1;
}

.detail-field p {
  margin: 6px 0 0;
  color: var(--text-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
}

.placeholder {
  min-height: 164px;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 10px;
  background: var(--surface);
}

.jobs-list {
  display: grid;
  gap: 10px;
}

.job-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1.4fr) repeat(3, minmax(90px, 0.7fr));
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: var(--surface-raised);
}

.job-row b {
  font-weight: 720;
}

.job-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.level-error {
  color: #ffb4ab;
}

.level-warning {
  color: #ffd18a;
}

.level-success {
  color: #a8e6bd;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

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

  .brand div:last-child,
  .nav-item span:last-child,
  .system-card {
    display: none;
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .metric-grid,
  .dashboard-chart-grid,
  .dashboard-grid,
  .placeholder-grid {
    grid-template-columns: 1fr 1fr;
  }

  .account-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .account-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .llm-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .user-management-shell {
    grid-template-columns: 1fr;
  }

  .customer-management-shell {
    grid-template-columns: 1fr;
  }

  .project-management-shell {
    grid-template-columns: 1fr;
  }

  .project-info-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .project-requirement-upload {
    grid-template-columns: 1fr;
  }

  .user-form-grid,
  .customer-form-grid,
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .semantic-filter-row {
    grid-template-columns: 1fr;
  }

  .account-query-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .account-query-actions > div {
    justify-content: stretch;
  }

  .account-query-actions button {
    flex: 1;
  }

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

  .method-switch {
    grid-template-columns: 1fr;
  }

  .method-switch,
  .wide,
  .suggested-field,
  .keyword-field,
  .domain-field,
  .switches,
  .actions {
    grid-column: 1 / -1;
  }

  .field {
    grid-column: span 3;
  }
}

@media (max-width: 760px) {
  .login-screen {
    grid-template-columns: 1fr;
    background: linear-gradient(180deg, #071017 0%, #102131 45%, #f3f6f8 45.1%, #f3f6f8 100%);
  }

  .login-visual {
    min-height: auto;
    padding: 38px 22px 26px;
  }

  .login-visual h1 {
    font-size: 34px;
  }

  .login-insight-grid {
    grid-template-columns: 1fr;
  }

  .login-panel {
    margin: 0 0 28px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto;
    align-items: center;
    padding: 10px;
  }

  .brand {
    border: 0;
    padding: 0;
  }

  .nav {
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .main {
    padding: 14px;
  }

  .topbar,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .dashboard-chart-grid,
  .dashboard-grid,
  .form-grid,
  .placeholder-grid {
    grid-template-columns: 1fr;
  }

  .account-toolbar {
    grid-template-columns: 1fr;
  }

  .account-filter-grid {
    grid-template-columns: 1fr;
  }

  .llm-filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-block {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .semantic-filter-row {
    grid-template-columns: 1fr;
  }

  .detail-fields {
    grid-template-columns: 1fr;
  }

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

  .communication-shell {
    height: max(1360px, calc(100vh - 120px));
    grid-template-columns: 1fr;
  }

  .conversation-sidebar {
    min-height: 320px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chat-compose {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    min-height: 0;
  }

  .chat-messages {
    min-height: 0;
  }

  .email-compose-grid,
  .reply-selection {
    grid-template-columns: 1fr;
  }

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

  .method-switch,
  .field,
  .wide,
  .suggested-field,
  .keyword-field,
  .domain-field,
  .switches,
  .actions {
    grid-column: 1 / -1;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button {
    flex: 1;
  }
}

/* Standard UI design system overrides */
body {
  background: var(--bg);
}

.login-screen {
  background:
    radial-gradient(circle at 16% 18%, rgba(61, 139, 248, 0.28), transparent 34%),
    linear-gradient(135deg, #08142f 0%, #0f1f45 44%, var(--bg) 44.1%, var(--bg) 100%);
}

.login-brand-mark,
.brand-mark {
  background: var(--brand-blue);
  border-radius: var(--radius);
  box-shadow: 0 16px 34px rgba(27, 79, 216, 0.22);
}

.login-eyebrow,
.login-panel-label {
  color: #93b4f5;
}

.login-panel {
  border: 1px solid var(--brand-divider);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(15, 31, 69, 0.16);
}

.login-role-switch input:checked + span,
.login-button {
  background: var(--brand-blue);
  color: #fff;
}

.login-button {
  border-radius: var(--radius);
  box-shadow: 0 14px 28px rgba(27, 79, 216, 0.24);
}

.login-button:hover {
  background: var(--accent-strong);
}

.sidebar {
  background: var(--brand-navy);
  border-right: 1px solid var(--sidebar-line);
}

.nav-item {
  border-radius: var(--radius);
  font-weight: 650;
}

.nav-item:hover {
  background: rgba(61, 139, 248, 0.14);
}

.nav-item.active {
  background: var(--sidebar-panel);
  box-shadow: inset 3px 0 0 var(--brand-blue-light);
}

.main {
  padding: 24px;
  gap: 20px;
}

.topbar {
  min-height: 64px;
}

h1 {
  color: var(--text);
  font-size: 28px;
  font-weight: 800;
}

h2 {
  color: var(--text-soft);
  font-size: 15px;
}

.panel,
.metric,
.placeholder,
.chart-panel,
.todo-item,
.llm-task-item,
.customer-table-wrap,
.task-list-table,
.table-wrap {
  border: 1px solid var(--brand-divider);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel {
  padding: 20px;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button,
.warning-icon-button,
.compact-button,
.account-result-tab,
.llm-internal-tab,
.platform-tab,
.log-pagination button,
.table-actions button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius);
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.primary-button {
  border: 1px solid var(--brand-blue);
  background: var(--brand-blue);
  color: #fff;
  box-shadow: 0 10px 20px rgba(27, 79, 216, 0.18);
}

.primary-button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 14px 24px rgba(27, 79, 216, 0.22);
  transform: translateY(-1px);
}

.secondary-button,
.icon-button,
.compact-button,
.log-pagination button {
  border: 1px solid var(--brand-divider);
  background: var(--surface-soft);
  color: var(--text-soft);
  box-shadow: none;
}

.secondary-button:hover,
.icon-button:hover,
.compact-button:hover,
.log-pagination button:hover {
  border-color: #c7d1e0;
  background: #fff;
  color: var(--brand-blue);
  box-shadow: 0 8px 18px rgba(15, 31, 69, 0.09);
  transform: translateY(-1px);
}

.danger-button {
  border: 1px solid var(--brand-danger);
  background: var(--brand-danger);
  color: #fff;
  box-shadow: 0 10px 20px rgba(224, 49, 49, 0.14);
}

.danger-button:hover {
  background: #c92a2a;
  border-color: #c92a2a;
  box-shadow: 0 14px 24px rgba(224, 49, 49, 0.18);
  transform: translateY(-1px);
}

.icon-button,
.warning-icon-button {
  width: 36px;
  padding: 0;
}

.warning-icon-button {
  color: var(--brand-warning);
  background: #fffbeb;
  border-color: #fde68a;
}

button:focus-visible,
.nav-item:focus-visible,
.platform-tab:focus-visible,
.account-result-tab:focus-visible,
.llm-internal-tab:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.multi-select-trigger:focus-visible {
  outline: 2px solid rgba(61, 139, 248, 0.46);
  outline-offset: 2px;
}

input[type="number"],
input:not([type]),
select,
textarea,
.multi-select-trigger {
  min-height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--brand-divider);
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  box-shadow: none;
}

textarea {
  min-height: 84px;
}

.multi-select.open .multi-select-trigger,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(61, 139, 248, 0.16);
}

input::placeholder,
textarea::placeholder,
.multi-select.empty .multi-select-label {
  color: var(--brand-gray);
}

.multi-select-menu {
  border-color: var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.multi-option {
  border-radius: var(--radius);
}

.multi-option:hover {
  background: var(--brand-sky);
  color: var(--brand-blue);
}

.multi-option input,
.platform-option input,
.method-option input,
.check input {
  accent-color: var(--brand-blue);
}

.table-wrap,
.customer-table-wrap,
.task-list-table {
  overflow: auto;
}

.table-wrap table,
.customer-table-wrap table,
.task-list-table table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td,
th {
  border-bottom-color: var(--brand-divider);
}

tr:hover td {
  background: var(--brand-sky);
}

.selected-row td {
  background: var(--brand-sky);
}

.account-platform-tabs,
.account-result-tabs,
.llm-internal-tabs {
  gap: 8px;
  border-bottom: 1px solid var(--brand-divider);
}

.platform-tab {
  border: 1px solid var(--brand-divider);
  border-radius: 999px;
  background: #fff;
  color: var(--text-soft);
  padding: 0 16px;
  box-shadow: none;
}

.platform-tab:hover {
  border-color: #b7c7df;
  background: var(--brand-sky);
  color: var(--brand-blue);
}

.platform-tab.active {
  border-color: var(--brand-blue);
  background: var(--brand-sky);
  color: var(--brand-blue);
  box-shadow: inset 0 0 0 1px rgba(27, 79, 216, 0.12);
}

.account-result-tab,
.llm-internal-tab {
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.account-result-tab.active,
.llm-internal-tab.active {
  background: #fff;
  border-color: var(--brand-divider);
  border-bottom-color: var(--brand-blue);
  color: var(--brand-blue);
}

.status-pill {
  min-height: 24px;
  gap: 6px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.status-pill.status-running {
  color: var(--brand-blue);
  background: var(--brand-sky);
  border-color: #bfdbfe;
}

.status-pill.status-waiting {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.status-pill.status-done {
  color: var(--brand-success);
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.status-pill.status-warning {
  color: var(--brand-warning);
  background: #fffbeb;
  border-color: #fde68a;
}

.status-pill.status-stopped,
.status-pill.status-unknown {
  color: var(--brand-slate);
  background: var(--surface-soft);
  border-color: var(--brand-divider);
}

.llm-task-item {
  border-left-width: 4px;
  padding: 14px;
}

.llm-task-item:hover,
.llm-task-item:focus-visible {
  border-color: #b7c7df;
  box-shadow: var(--shadow-md);
}

.llm-task-item.status-running {
  border-left-color: var(--brand-blue);
}

.llm-task-item.status-waiting {
  border-left-color: var(--brand-warning);
}

.llm-task-item.status-done {
  border-left-color: var(--brand-success);
}

.llm-task-item.status-warning {
  border-left-color: var(--brand-warning);
}

.semantic-param-chip,
.todo-priority,
.todo-status {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.semantic-param-chip {
  border-color: rgba(221, 227, 238, 0.95);
  background: #fff;
  box-shadow: none;
}

.semantic-param-platform,
.semantic-param-name {
  background: var(--brand-sky);
  border-color: #bfdbfe;
}

.semantic-param-platform .semantic-param-values b,
.semantic-param-name .semantic-param-values b {
  color: var(--brand-blue);
}

.semantic-param-domain,
.semantic-param-major {
  background: #eef4ff;
  border-color: #c9d8f7;
}

.semantic-param-region,
.semantic-param-influence {
  background: #fffbeb;
  border-color: #fde68a;
}

.semantic-param-language,
.semantic-param-type {
  background: var(--surface-soft);
  border-color: var(--brand-divider);
}

.semantic-param-requirements {
  border-radius: 6px;
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.semantic-param-score,
.semantic-param-batch {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.metric {
  min-height: 88px;
}

.metric strong {
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.todo-item {
  border-left-color: var(--brand-blue);
  background: #fff;
}

.todo-priority {
  background: #fffbeb;
  color: #b45309;
}

.todo-status {
  background: var(--brand-sky);
  color: var(--brand-blue);
}

.pie-chart {
  background: var(--brand-divider);
}

.pie-chart::before {
  background: rgba(15, 31, 69, 0.96);
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(15, 31, 69, 0.24);
}

.table-wrap::-webkit-scrollbar-thumb {
  border-color: #fff;
  background: rgba(71, 85, 105, 0.3);
}

@media (max-width: 760px) {
  .login-screen {
    background: linear-gradient(180deg, #08142f 0%, #0f1f45 45%, var(--bg) 45.1%, var(--bg) 100%);
  }
}
