/* ==========================================================================
   风控卫士 · 企业风险核查工作台
   深墨蓝侧栏 / 浅灰工作区 / 青蓝主色 / 克制、清晰、可打印
   ========================================================================== */

:root {
  color-scheme: light;
  --sidebar: #0b1f33;
  --sidebar-deep: #08192a;
  --sidebar-raised: #102941;
  --sidebar-line: rgba(255, 255, 255, 0.085);
  --sidebar-text: #9fb2c5;
  --sidebar-strong: #edf4fa;
  --bg: #f3f5f7;
  --bg-deep: #edf1f4;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-tint: #f3f8fa;
  --line: #e4e9ee;
  --line-strong: #d6dee6;
  --text: #17232f;
  --text-2: #465568;
  --muted: #6c7c8e;
  --faint: #95a3b1;
  --primary: #0d7599;
  --primary-strong: #095f7e;
  --primary-dark: #074f69;
  --primary-soft: #eaf5f8;
  --primary-border: #c7e2e9;
  --high: #bd4545;
  --high-text: #a33333;
  --high-soft: #fdf1f0;
  --high-border: #f0d1ce;
  --suspected: #bd7219;
  --suspected-text: #a45d0f;
  --suspected-soft: #fdf6e9;
  --suspected-border: #efdfc0;
  --minor: #9c7e0d;
  --minor-text: #806708;
  --minor-soft: #fbf8e6;
  --minor-border: #ebe2b9;
  --clear: #2a865f;
  --clear-text: #1f724f;
  --clear-soft: #eff8f3;
  --clear-border: #cfe8db;
  --radius-sm: 6px;
  --radius: 9px;
  --radius-lg: 12px;
  --shadow-xs: 0 1px 2px rgba(16, 38, 57, 0.045);
  --shadow-sm: 0 2px 8px rgba(16, 38, 57, 0.055);
  --shadow-md: 0 12px 30px rgba(16, 38, 57, 0.1);
  --shadow-lg: 0 24px 60px rgba(8, 25, 41, 0.18);
  --sidebar-width: 246px;
  --topbar-height: 64px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-strong);
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
dt,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

svg {
  display: block;
  flex: 0 0 auto;
}

::selection {
  color: #fff;
  background: rgba(13, 117, 153, 0.8);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 8px;
  left: 12px;
  padding: 8px 14px;
  color: #fff;
  background: var(--primary);
  border-radius: var(--radius-sm);
  transform: translateY(-140%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ==========================================================================
   App shell
   ========================================================================== */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 60;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100vh;
  flex-direction: column;
  color: var(--sidebar-text);
  background: var(--sidebar);
  border-right: 1px solid rgba(5, 18, 31, 0.2);
  transition: width 0.22s ease, transform 0.22s ease;
}

.brand {
  display: flex;
  height: 74px;
  flex: 0 0 74px;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border-bottom: 1px solid var(--sidebar-line);
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  color: #8bd0df;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transition: background 0.16s ease, transform 0.16s ease;
}

.brand-mark:hover {
  color: #b3e2eb;
  background: transparent;
  transform: none;
}

.brand-mark svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.brand-text strong {
  display: block;
  color: #f2f7fb;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1.25;
}

.brand-text span {
  display: block;
  margin-top: 3px;
  color: #6f879d;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.22em;
  line-height: 1;
}

.sidebar-context {
  position: relative;
  display: flex;
  min-height: 60px;
  align-items: center;
  gap: 10px;
  margin: 14px 12px 6px;
  padding: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
}

.context-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  color: #8cc4d6;
  background: rgba(13, 117, 153, 0.18);
  border-radius: 7px;
}

.context-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.context-copy {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.context-copy span {
  display: block;
  color: #7890a5;
  font-size: 10px;
  line-height: 1.3;
}

.context-copy strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #dce8f2;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.context-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 1px 5px;
  color: #7fa4b9;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border: 1px solid rgba(124, 172, 193, 0.25);
  border-radius: 3px;
}

.nav {
  min-height: 0;
  flex: 1;
  padding: 5px 12px 18px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.nav::-webkit-scrollbar {
  width: 5px;
}

.nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 10px;
}

.nav-heading {
  margin: 16px 10px 6px;
  color: #617a91;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.4;
  white-space: nowrap;
}

.nav-heading:first-child {
  margin-top: 4px;
}

.nav-link {
  position: relative;
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 11px;
  margin: 2px 0;
  padding: 0 10px;
  color: var(--sidebar-text);
  font-size: 13px;
  border-radius: 7px;
  transition: color 0.14s ease, background 0.14s ease;
}

.nav-link:hover {
  color: #eef6fc;
  background: rgba(255, 255, 255, 0.055);
}

.nav-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
  opacity: 0.83;
}

.nav-link.is-active {
  color: #f5fbff;
  background: rgba(52, 142, 178, 0.17);
  box-shadow: inset 0 0 0 1px rgba(97, 180, 210, 0.07);
}

.nav-link.is-active svg {
  color: #78c2dc;
  opacity: 1;
}

.nav-link.is-active::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -12px;
  width: 3px;
  content: "";
  background: #36a6c9;
  border-radius: 0 3px 3px 0;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-marker {
  width: 4px;
  height: 4px;
  margin-left: auto;
  background: transparent;
  border-radius: 50%;
}

.nav-link.is-active .nav-marker {
  background: #58bcd9;
}

.nav-count {
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  color: #f5fbff;
  background: #b54e4e;
  font-size: 10px;
  font-weight: 650;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
}

.nav-link.is-active .nav-count {
  margin-left: 0;
}

.sidebar-footer {
  flex: 0 0 auto;
  padding: 12px;
  border-top: 1px solid var(--sidebar-line);
}

.source-status {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--sidebar-line);
  border-radius: 7px;
}

.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: #6d8295;
  border-radius: 50%;
}

.status-dot.is-live {
  background: #43b887;
  box-shadow: 0 0 0 3px rgba(67, 184, 135, 0.12);
}

.status-dot.is-demo {
  background: #d6a04a;
  box-shadow: 0 0 0 3px rgba(214, 160, 74, 0.12);
}

.status-dot.is-error {
  background: #cf6464;
  box-shadow: 0 0 0 3px rgba(207, 100, 100, 0.12);
}

.source-copy {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.source-copy span {
  display: block;
  color: #6f879d;
  font-size: 9px;
  line-height: 1.2;
}

.source-copy strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #c7d8e6;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.source-ring {
  width: 18px;
  height: 18px;
  margin-left: auto;
  border: 1px solid rgba(140, 174, 196, 0.2);
  border-radius: 50%;
}

.sidebar-help {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 9px;
  color: #7890a5;
  font-size: 11px;
  border-radius: 6px;
  transition: color 0.14s ease, background 0.14s ease;
}

.sidebar-help:hover {
  color: #d5e3ef;
  background: rgba(255, 255, 255, 0.045);
}

.sidebar-help > svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sidebar-help .help-arrow {
  width: 13px;
  height: 13px;
  margin-left: auto;
}

.sidebar-scrim {
  display: none;
}

.workspace {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.22s ease;
}

body.sidebar-collapsed .sidebar {
  width: 74px;
}

body.sidebar-collapsed .workspace {
  margin-left: 74px;
}

body.sidebar-collapsed .brand {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .context-copy,
body.sidebar-collapsed .context-badge,
body.sidebar-collapsed .nav-heading,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .source-copy,
body.sidebar-collapsed .source-ring,
body.sidebar-collapsed .sidebar-help span,
body.sidebar-collapsed .sidebar-help .help-arrow {
  display: none;
}

body.sidebar-collapsed .sidebar-context {
  justify-content: center;
  min-height: 46px;
  margin: 14px 11px 6px;
  padding: 7px;
}

body.sidebar-collapsed .nav {
  padding-right: 11px;
  padding-left: 11px;
}

body.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .nav-link.is-active::before {
  left: -11px;
}

body.sidebar-collapsed .nav-link .nav-marker {
  display: none;
}

body.sidebar-collapsed .nav-link .nav-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  font-size: 9px;
  line-height: 15px;
}

body.sidebar-collapsed .source-status {
  justify-content: center;
  padding: 12px 0;
}

body.sidebar-collapsed .sidebar-help {
  justify-content: center;
  padding: 9px 0;
}

/* ==========================================================================
   Top bar
   ========================================================================== */

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  height: var(--topbar-height);
  flex: 0 0 var(--topbar-height);
  align-items: center;
  gap: 22px;
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar-left {
  display: flex;
  min-width: 190px;
  flex: 0 0 auto;
  align-items: center;
  gap: 13px;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  padding: 0;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.icon-button:hover {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--line);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.breadcrumb {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
}

.breadcrumb svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  opacity: 0.7;
}

.breadcrumb strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  text-overflow: ellipsis;
}

.global-search-wrap {
  position: relative;
  width: min(100%, 490px);
  margin-right: auto;
}

.global-search {
  display: flex;
  height: 38px;
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 12px;
  background: #f4f7f9;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.global-search:focus-within {
  background: #fff;
  border-color: var(--primary-border);
  box-shadow: 0 0 0 3px rgba(13, 117, 153, 0.08);
}

.global-search > svg {
  width: 17px;
  height: 17px;
  color: var(--faint);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.global-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  font-size: 12.5px;
}

.global-search input::placeholder {
  color: #98a6b5;
}

.global-search input::-webkit-search-cancel-button {
  cursor: pointer;
}

.global-search kbd {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
  color: #8e9baa;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(16, 38, 57, 0.04);
  font-family: var(--font-sans);
  font-size: 10px;
  line-height: 1;
}

.search-popover {
  position: absolute;
  z-index: 90;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  min-width: 380px;
  padding: 6px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

.search-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: var(--text);
  border-radius: 6px;
}

.search-result:hover,
.search-result:focus-visible {
  color: var(--text);
  background: var(--surface-tint);
  outline: none;
}

.search-result-main {
  min-width: 0;
  flex: 1;
}

.search-result-main strong {
  display: block;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-main span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--faint);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.search-result-meta time {
  color: var(--faint);
  font-size: 10px;
}

.search-popover-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding: 8px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  font-size: 10.5px;
}

.search-popover-footer a {
  font-size: 11px;
}

.search-empty {
  padding: 22px 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.search-empty strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text-2);
  font-weight: 550;
}

.search-loading {
  padding: 20px 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.notification-button {
  position: relative;
}

.notification-count {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  color: #fff;
  background: #b84a4a;
  border: 2px solid #fff;
  border-radius: 9px;
  font-size: 8px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
}

.topbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: var(--line);
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px 3px 3px;
  border-radius: 7px;
}

.account-avatar {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 7px;
}

.account-avatar svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.account-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.account-copy strong {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 550;
}

.account-copy span {
  margin-top: 2px;
  color: var(--faint);
  font-size: 9.5px;
}

/* ==========================================================================
   Workspace and page frame
   ========================================================================== */

.view {
  width: 100%;
  max-width: 1620px;
  flex: 1;
  margin: 0 auto;
  padding: 26px 28px 38px;
  outline: none;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 28px 22px;
  color: #9aa7b4;
  font-size: 10.5px;
}

.footer-dot {
  width: 3px;
  height: 3px;
  background: #b6c0c9;
  border-radius: 50%;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-head-copy {
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 14px;
  height: 2px;
  content: "";
  background: var(--primary);
}

.page-head h1 {
  color: var(--text);
  font-size: 24px;
  font-weight: 630;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.page-head .page-description {
  max-width: 720px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.page-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.page-loading {
  padding-top: 4px;
}

/* ==========================================================================
   Skeleton
   ========================================================================== */

.skeleton {
  position: relative;
  overflow: hidden;
  background: #e9eef2;
  border-radius: 6px;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-100%);
  animation: skeleton-sweep 1.4s ease-in-out infinite;
}

@keyframes skeleton-sweep {
  to {
    transform: translateX(100%);
  }
}

.skeleton-title {
  width: 230px;
  height: 28px;
  margin-bottom: 10px;
}

.skeleton-subtitle {
  width: 420px;
  max-width: 70%;
  height: 13px;
  margin-bottom: 28px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.skeleton-card {
  height: 126px;
  border-radius: var(--radius-lg);
}

.skeleton-panel {
  height: 310px;
  border-radius: var(--radius-lg);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  box-shadow: 0 1px 1px rgba(16, 38, 57, 0.025);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.2;
  white-space: nowrap;
  transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease,
    box-shadow 0.14s ease, transform 0.14s ease;
}

.btn:hover {
  color: var(--text);
  background: var(--surface-soft);
  border-color: #c6d0d9;
  box-shadow: var(--shadow-xs);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(9, 95, 126, 0.16);
}

.btn-primary:hover {
  color: #fff;
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  box-shadow: 0 3px 8px rgba(9, 95, 126, 0.2);
}

.btn-outline-primary {
  color: var(--primary);
  background: var(--surface);
  border-color: var(--primary-border);
}

.btn-outline-primary:hover {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-color: #a9d3df;
}

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--line);
  box-shadow: none;
}

.btn-danger {
  color: var(--high-text);
  background: var(--high-soft);
  border-color: var(--high-border);
}

.btn-danger:hover {
  color: var(--high-text);
  background: #fbe8e6;
  border-color: #e8bdb8;
}

.btn-sm {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
  border-radius: 6px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-lg {
  min-height: 42px;
  padding: 0 20px;
  font-size: 13px;
}

.btn-icon-only {
  width: 34px;
  min-height: 34px;
  padding: 0;
}

.btn .btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.text-button {
  padding: 0;
  color: var(--primary);
  background: transparent;
  border: 0;
  font-size: 11.5px;
  font-weight: 550;
}

.text-button:hover {
  color: var(--primary-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Surfaces and common components
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
}

.card-heading {
  min-width: 0;
}

.card-heading h2,
.card-heading h3 {
  color: var(--text);
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.card-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.card-action {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 0 20px 20px;
}

.card-body.flush {
  padding: 0;
}

.card-footer {
  padding: 12px 20px;
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.section-divider {
  height: 1px;
  background: var(--line);
}

.stack-sm > * + * {
  margin-top: 8px;
}

.stack-md > * + * {
  margin-top: 14px;
}

.stack-lg > * + * {
  margin-top: 20px;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.text-sm {
  font-size: 11.5px;
}

.text-xs {
  font-size: 10.5px;
}

.nowrap {
  white-space: nowrap;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.94em;
  letter-spacing: -0.02em;
}

.inline-icon,
.ui-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.ui-icon {
  flex: 0 0 auto;
}

.chip {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.chip-soft {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.chip-warn {
  color: var(--suspected-text);
  background: var(--suspected-soft);
  border-color: var(--suspected-border);
}

.chip-danger {
  color: var(--high-text);
  background: var(--high-soft);
  border-color: var(--high-border);
}

.chip-success {
  color: var(--clear-text);
  background: var(--clear-soft);
  border-color: var(--clear-border);
}

.risk-pill {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.risk-pill .risk-glyph {
  font-size: 9px;
  line-height: 1;
}

.risk-pill.high {
  color: var(--high-text);
  background: var(--high-soft);
  border-color: var(--high-border);
}

.risk-pill.suspected {
  color: var(--suspected-text);
  background: var(--suspected-soft);
  border-color: var(--suspected-border);
}

.risk-pill.minor {
  color: var(--minor-text);
  background: var(--minor-soft);
  border-color: var(--minor-border);
}

.risk-pill.clear {
  color: var(--clear-text);
  background: var(--clear-soft);
  border-color: var(--clear-border);
}

.risk-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--faint);
}

.risk-dot.high {
  background: var(--high);
}

.risk-dot.suspected {
  background: var(--suspected);
}

.risk-dot.minor {
  background: var(--minor);
}

.risk-dot.clear {
  background: var(--clear);
}

.level-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
}

.risk-emoji {
  font-size: 10px;
  line-height: 1;
}

.confidence-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.confidence-inline strong {
  color: var(--text-2);
  font-weight: 600;
}

.connection-line {
  position: relative;
}

/* ==========================================================================
   Notifications and inline alerts
   ========================================================================== */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  color: var(--text-2);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.6;
}

.notice svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.notice.info {
  color: #39556a;
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.notice.info svg {
  stroke: var(--primary);
}

.notice.warning {
  color: #76531c;
  background: var(--suspected-soft);
  border-color: var(--suspected-border);
}

.notice.warning svg {
  stroke: var(--suspected);
}

.notice.danger {
  color: #7c3838;
  background: var(--high-soft);
  border-color: var(--high-border);
}

.notice.danger svg {
  stroke: var(--high);
}

.notice.success {
  color: #2b604b;
  background: var(--clear-soft);
  border-color: var(--clear-border);
}

.notice.success svg {
  stroke: var(--clear);
}

.notice-content {
  min-width: 0;
  flex: 1;
}

.notice-content strong {
  color: inherit;
  font-weight: 600;
}

.notice-content p + p {
  margin-top: 3px;
}

.notice-close {
  flex: 0 0 auto;
  padding: 2px;
  color: currentColor;
  background: transparent;
  border: 0;
  opacity: 0.55;
}

.notice-close:hover {
  opacity: 1;
}

.notice-close svg {
  width: 14px;
  height: 14px;
  margin: 0;
}

.mock-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
  padding: 11px 15px;
  color: #70521d;
  background: #fdf8ed;
  border: 1px solid #ede1c8;
  border-radius: 8px;
  font-size: 11.5px;
}

.mock-banner .mock-label {
  padding: 2px 6px;
  color: #8d671e;
  background: rgba(189, 114, 25, 0.1);
  border: 1px solid rgba(189, 114, 25, 0.18);
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.mock-banner p {
  flex: 1;
  line-height: 1.5;
}

.mock-banner a {
  color: #7f5c19;
  font-weight: 550;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Empty and error states
   ========================================================================== */

.empty-state {
  display: flex;
  min-height: 218px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 22px;
  text-align: center;
}

.empty-state.compact {
  min-height: 150px;
  padding: 22px 16px;
}

.empty-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 10px;
}

.empty-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.empty-icon.neutral {
  color: var(--faint);
  background: var(--surface-soft);
  border-color: var(--line);
}

.empty-state h3 {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.empty-state p {
  max-width: 420px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
}

.error-state {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.error-state .empty-icon {
  color: var(--high);
  background: var(--high-soft);
  border-color: var(--high-border);
}

.error-state h2 {
  font-size: 15px;
  font-weight: 600;
}

.error-state p {
  max-width: 480px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

/* ==========================================================================
   Cards, metrics and dashboard
   ========================================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 16px;
}

.stat-card {
  position: relative;
  min-height: 126px;
  padding: 16px 17px 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.stat-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.stat-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 72px;
  height: 72px;
  content: "";
  border-radius: 0 0 0 72px;
  opacity: 0.42;
}

.stat-card.tone-primary::after {
  background: var(--primary-soft);
}

.stat-card.tone-suspected::after {
  background: var(--suspected-soft);
}

.stat-card.tone-high::after {
  background: var(--high-soft);
}

.stat-card.tone-clear::after {
  background: var(--clear-soft);
}

.stat-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.stat-icon {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 7px;
}

.stat-icon.suspected {
  color: var(--suspected);
  background: var(--suspected-soft);
  border-color: var(--suspected-border);
}

.stat-icon.high {
  color: var(--high);
  background: var(--high-soft);
  border-color: var(--high-border);
}

.stat-icon.clear {
  color: var(--clear);
  background: var(--clear-soft);
  border-color: var(--clear-border);
}

.stat-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.stat-value {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  color: var(--text);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-value small {
  margin-left: 4px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.stat-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.4;
}

.stat-foot .trend {
  color: var(--text-2);
  font-weight: 550;
}

.dash-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dash-layout.secondary {
  grid-template-columns: minmax(0, 1.85fr) minmax(270px, 0.65fr);
  align-items: start;
}

.risk-snapshot {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 19px 20px 20px;
}

.risk-donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.risk-donut {
  position: relative;
  width: 148px;
  height: 148px;
}

.risk-donut svg {
  width: 100%;
  height: 100%;
}

.risk-donut-track {
  fill: none;
  stroke: #edf1f4;
  stroke-width: 12;
}

.risk-donut-segment {
  fill: none;
  stroke-width: 12;
  transition: stroke-dasharray 0.5s ease;
}

.risk-donut-segment.high {
  stroke: var(--high);
}

.risk-donut-segment.suspected {
  stroke: var(--suspected);
}

.risk-donut-segment.minor {
  stroke: var(--minor);
}

.risk-donut-segment.clear {
  stroke: var(--clear);
}

.risk-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.risk-donut-center strong {
  color: var(--text);
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.risk-donut-center span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.risk-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.risk-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.risk-legend-copy {
  min-width: 0;
  flex: 1;
}

.risk-legend-copy span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.risk-legend-copy strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.risk-legend-pct {
  color: var(--faint);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.snapshot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.snapshot-head h2 {
  font-size: 14px;
  font-weight: 620;
}

.snapshot-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.risk-snapshot-wrap {
  padding: 18px 20px;
}

.monitor-glance {
  display: flex;
  flex-direction: column;
}

.monitor-glance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 16px 20px 0;
}

.monitor-mini {
  padding: 11px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.monitor-mini span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.monitor-mini strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 20px;
  font-weight: 630;
  letter-spacing: -0.035em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.monitor-next {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 20px 17px;
  padding: 10px 12px;
  color: var(--text-2);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 7px;
  font-size: 10.5px;
}

.monitor-next svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.monitor-next strong {
  color: var(--primary-dark);
  font-weight: 600;
}

.monitor-glance .card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recent-card {
  overflow: hidden;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #c8d2dc transparent;
}

.table-scroll::-webkit-scrollbar {
  height: 6px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: #c8d2dc;
  border-radius: 4px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.data-table th {
  padding: 9px 14px;
  color: var(--faint);
  background: var(--surface-soft);
  border-top: 0;
  border-bottom: 1px solid var(--line);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 0.13s ease;
}

.data-table tbody tr:hover {
  background: #fafcfd;
}

.data-table tbody tr.clickable-row {
  cursor: pointer;
}

.data-table .company-cell {
  min-width: 190px;
}

.company-name {
  color: var(--text);
  font-weight: 550;
  line-height: 1.35;
}

.company-name:hover {
  color: var(--primary);
}

.company-code {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-summary {
  display: -webkit-box;
  max-width: 380px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cell-time {
  color: var(--faint);
  font-size: 10px;
  white-space: nowrap;
}

.table-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 550;
  white-space: nowrap;
}

.table-action svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.report-row-actions {
  display: inline-flex;
  min-width: 92px;
  min-height: 22px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  white-space: nowrap;
}

.data-table .report-hover-action {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.data-table tbody tr:hover .report-hover-action,
.data-table tbody tr:focus-within .report-hover-action,
.data-table .report-hover-action:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none), (pointer: coarse) {
  .data-table .report-hover-action {
    opacity: 1;
    pointer-events: auto;
  }
}

.table-empty {
  padding: 10px 0 4px;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quick-card .card-body {
  padding-top: 0;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
}

.quick-action:last-child {
  border-bottom: 0;
}

.quick-action:hover {
  color: var(--primary);
}

.quick-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 7px;
}

.quick-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.quick-copy {
  min-width: 0;
  flex: 1;
}

.quick-copy strong {
  display: block;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 550;
}

.quick-copy span {
  display: block;
  margin-top: 1px;
  color: var(--faint);
  font-size: 10px;
}

.quick-action > svg {
  width: 14px;
  height: 14px;
  color: var(--faint);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.capability-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.capability-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 10.5px;
}

.capability-row:last-child {
  border-bottom: 0;
}

.capability-name {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.capability-name svg {
  width: 14px;
  height: 14px;
  color: var(--faint);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.capability-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 550;
  white-space: nowrap;
}

.capability-status::before {
  width: 5px;
  height: 5px;
  content: "";
  background: var(--faint);
  border-radius: 50%;
}

.capability-status.on::before {
  background: var(--clear);
}

.capability-status.demo::before {
  background: var(--suspected);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 16px;
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-field {
  min-width: 0;
}

.form-field > label,
.form-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 550;
  line-height: 1.4;
}

.form-label .required {
  color: var(--high);
}

.form-hint {
  margin-top: 5px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.5;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: none;
  font-size: 12px;
  line-height: 1.5;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: #a6b2be;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #c3cdd7;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 117, 153, 0.09);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--high);
  box-shadow: 0 0 0 3px rgba(189, 69, 69, 0.07);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  color: var(--faint);
  background: var(--surface-soft);
  cursor: not-allowed;
}

.textarea {
  min-height: 108px;
  resize: vertical;
}

.textarea.tall {
  min-height: 160px;
}

.select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23718190' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group .input {
  padding-left: 35px;
}

.input-group > svg {
  position: absolute;
  z-index: 1;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--faint);
  pointer-events: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.input-group .input-suffix {
  position: absolute;
  right: 11px;
  color: var(--faint);
  font-size: 11px;
  pointer-events: none;
}

.input-group.has-suffix .input {
  padding-right: 44px;
}

.input-group.has-prefix .input {
  padding-left: 30px;
}

.input-prefix {
  position: absolute;
  left: 11px;
  color: var(--faint);
  font-size: 12px;
  pointer-events: none;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}

.check-row input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.switch-copy {
  min-width: 0;
}

.switch-copy strong {
  display: block;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 550;
}

.switch-copy span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.5;
}

.switch {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 34px;
  margin-top: 1px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  display: block;
  width: 100%;
  height: 100%;
  background: #c7d0d9;
  border-radius: 10px;
  transition: background 0.17s ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  content: "";
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(16, 38, 57, 0.2);
  transition: transform 0.17s ease;
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(14px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #eef2f5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented button,
.segmented a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  transition: color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.segmented button:hover,
.segmented a:hover {
  color: var(--text);
}

.segmented button.is-active,
.segmented a.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(16, 38, 57, 0.08);
}

.segmented .segment-count {
  min-width: 16px;
  padding: 0 4px;
  color: var(--faint);
  background: rgba(108, 124, 142, 0.09);
  border-radius: 3px;
  font-size: 9px;
  line-height: 16px;
  text-align: center;
}

.segmented button.is-active .segment-count {
  color: var(--primary);
  background: var(--primary-soft);
}

.field-row {
  display: flex;
  gap: 9px;
}

.field-row .input {
  flex: 1;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.form-actions.split {
  justify-content: space-between;
}

.form-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 10px;
  padding: 8px 10px;
  color: var(--high-text);
  background: var(--high-soft);
  border: 1px solid var(--high-border);
  border-radius: 6px;
  font-size: 10.5px;
  line-height: 1.5;
}

.form-error svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

/* ==========================================================================
   Query page
   ========================================================================== */

.query-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.query-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.72fr);
  gap: 16px;
  align-items: start;
}

.query-main {
  min-width: 0;
}

.query-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.query-card {
  padding: 22px 24px 20px;
}

.query-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.query-card-head h2 {
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.015em;
}

.query-card-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.query-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 8px;
}

.query-mark svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.query-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.query-submit-note {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.45;
}

.query-submit-note svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.query-submit-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.autocomplete-wrap {
  position: relative;
}

.autocomplete {
  position: absolute;
  z-index: 45;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.autocomplete-state {
  padding: 14px 12px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.autocomplete-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 5px;
  text-align: left;
}

.autocomplete-item:hover,
.autocomplete-item:focus-visible {
  background: var(--surface-tint);
  outline: none;
}

.autocomplete-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.autocomplete-copy {
  min-width: 0;
  flex: 1;
}

.autocomplete-copy strong {
  display: block;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.autocomplete-copy span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--faint);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.autocomplete-item .chip {
  flex: 0 0 auto;
}

.selected-company {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  padding: 9px 11px;
  background: var(--surface-tint);
  border: 1px solid var(--primary-border);
  border-radius: 7px;
}

.selected-company-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--primary-border);
  border-radius: 6px;
}

.selected-company-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.selected-company-copy {
  min-width: 0;
  flex: 1;
}

.selected-company-copy strong {
  display: block;
  color: var(--text);
  font-size: 11px;
  font-weight: 550;
}

.selected-company-copy span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
}

.selected-company button {
  flex: 0 0 auto;
  padding: 3px;
  color: var(--faint);
  background: transparent;
  border: 0;
}

.selected-company button:hover {
  color: var(--text);
}

.selected-company button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.demo-examples {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.demo-examples-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 9.5px;
}

.demo-examples-head .demo-tag {
  padding: 1px 4px;
  color: var(--suspected-text);
  background: var(--suspected-soft);
  border: 1px solid var(--suspected-border);
  border-radius: 3px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.example-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.example-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 3px 9px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 10px;
  text-align: left;
  transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.example-chip .faint {
  margin-left: auto;
  white-space: nowrap;
}

.example-chip:hover {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.example-chip .risk-dot {
  width: 5px;
  height: 5px;
  flex-basis: 5px;
}

.side-info-card {
  padding: 17px 18px;
}

.side-info-card h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.side-info-card h3 svg {
  width: 15px;
  height: 15px;
  color: var(--primary);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.side-info-card > p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.scope-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 11px;
}

.scope-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 10px;
}

.scope-row:last-child {
  border-bottom: 0;
}

.scope-row span {
  color: var(--muted);
}

.scope-row strong {
  color: var(--text-2);
  font-size: 10px;
  font-weight: 550;
  text-align: right;
}

.query-note-card {
  color: var(--muted);
}

.query-note-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}

.query-note-item {
  display: flex;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.query-note-item > span:first-child {
  width: 4px;
  height: 4px;
  flex: 0 0 4px;
  margin-top: 6px;
  background: var(--primary);
  border-radius: 50%;
}

/* Scan progress */

.scan-progress-card {
  margin-top: 16px;
  overflow: hidden;
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
}

.scan-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 20px 14px;
  background: var(--surface-tint);
  border-bottom: 1px solid var(--primary-border);
}

.scan-progress-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.scan-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid var(--primary-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.scan-progress-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.scan-progress-head .scan-company {
  color: var(--text-2);
  font-weight: 550;
}

.scan-progress-body {
  padding: 17px 20px 19px;
}

.progress-track {
  height: 4px;
  margin-bottom: 17px;
  overflow: hidden;
  background: #edf1f4;
  border-radius: 4px;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.35s ease;
}

.progress-bar.indeterminate {
  width: 38% !important;
  animation: progress-slide 1.6s ease-in-out infinite;
}

@keyframes progress-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(300%);
  }
}

.stage-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stage-item {
  position: relative;
  padding: 10px 10px 9px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.stage-item::after {
  position: absolute;
  top: 16px;
  right: -9px;
  width: 8px;
  height: 1px;
  content: "";
  background: var(--line-strong);
}

.stage-item:last-child::after {
  display: none;
}

.stage-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.stage-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--faint);
  background: #e9eef2;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
}

.stage-icon svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.stage-item strong {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  line-height: 1.35;
}

.stage-item.is-active {
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.stage-item.is-active .stage-icon {
  color: #fff;
  background: var(--primary);
}

.stage-item.is-active strong {
  color: var(--primary-dark);
}

.stage-item.is-done {
  background: var(--clear-soft);
  border-color: var(--clear-border);
}

.stage-item.is-done .stage-icon {
  color: var(--clear);
  background: var(--clear-soft);
}

.stage-item.is-done strong {
  color: var(--clear-text);
}

.stage-pulse {
  width: 5px;
  height: 5px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.scan-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  animation: fade-up 0.25s ease both;
}

.scan-fact {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}

.scan-fact strong {
  color: var(--text-2);
  font-weight: 600;
}

.scan-fact svg {
  width: 13px;
  height: 13px;
  color: var(--faint);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

/* Query result summary */

.query-result {
  margin-top: 16px;
  animation: fade-up 0.3s ease both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-banner {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--risk-color, var(--line-strong));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.result-banner.level-high {
  --risk-color: var(--high);
}

.result-banner.level-suspected {
  --risk-color: var(--suspected);
}

.result-banner.level-minor {
  --risk-color: var(--minor);
}

.result-banner.level-clear {
  --risk-color: var(--clear);
}

.result-main {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding: 21px 22px;
}

.result-copy {
  min-width: 0;
  flex: 1;
}

.result-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.result-topline h2 {
  margin-top: 2px;
  color: var(--text);
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.result-code {
  margin-top: 3px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.result-summary {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.7;
}

.result-action {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  color: var(--text-2);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11px;
  line-height: 1.55;
}

.result-action svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
  color: var(--primary);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.result-action strong {
  color: var(--text);
  font-weight: 600;
}

.result-confidence {
  display: flex;
  flex: 0 0 104px;
  flex-direction: column;
  align-items: center;
  padding-top: 1px;
}

.mini-ring {
  position: relative;
  width: 82px;
  height: 82px;
}

.mini-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.mini-ring .ring-track {
  fill: none;
  stroke: #edf1f4;
  stroke-width: 7;
}

.mini-ring .ring-value {
  fill: none;
  stroke: var(--risk-color, var(--primary));
  stroke-width: 7;
  stroke-linecap: butt;
  transition: stroke-dasharray 0.6s ease;
}

.mini-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.mini-ring-center strong {
  color: var(--text);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.mini-ring-center span {
  margin-top: 3px;
  color: var(--faint);
  font-size: 8px;
}

.result-confidence > span {
  margin-top: 7px;
  color: var(--faint);
  font-size: 9.5px;
}

.result-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
}

.result-meta-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  color: var(--faint);
  font-size: 9.5px;
}

.result-meta-mini strong {
  color: var(--text-2);
  font-weight: 550;
}

/* Batch */

.batch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.7fr);
  gap: 16px;
  align-items: start;
}

.batch-card {
  padding: 21px 23px 19px;
}

.batch-upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.batch-upload-head .form-label {
  margin: 0;
}

.file-drop {
  position: relative;
  display: flex;
  min-height: 196px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed #cbd5de;
  border-radius: 8px;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.file-drop:hover,
.file-drop.is-dragging {
  background: var(--surface-tint);
  border-color: #96c5d4;
}

.file-drop textarea {
  width: 100%;
  min-height: 156px;
  padding: 3px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  resize: vertical;
  font-size: 11.5px;
  line-height: 1.8;
}

.file-drop textarea::placeholder {
  color: #9eabb7;
}

.file-drop-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--faint);
  font-size: 10px;
}

.file-drop-hint svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.file-drop-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.file-drop-divider {
  width: 1px;
  height: 14px;
  background: var(--line);
}

.batch-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
}

.batch-options .check-group {
  gap: 15px;
}

.batch-preview {
  margin-top: 14px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.batch-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.batch-preview-head strong {
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
}

.batch-preview-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 8px;
}

.batch-preview-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.batch-preview-index {
  display: grid;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  place-items: center;
  color: var(--faint);
  background: var(--surface-soft);
  border-radius: 3px;
  font-size: 8px;
}

.batch-preview-copy {
  min-width: 0;
  flex: 1;
}

.batch-preview-copy strong {
  display: block;
  overflow: hidden;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-preview-copy span {
  display: block;
  overflow: hidden;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-preview-remove {
  flex: 0 0 auto;
  padding: 2px;
  color: var(--faint);
  background: transparent;
  border: 0;
}

.batch-preview-remove:hover {
  color: var(--high);
}

.batch-preview-remove svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.batch-preview-more {
  margin-top: 7px;
  color: var(--faint);
  font-size: 9.5px;
  text-align: right;
}

.batch-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.batch-submit-count {
  color: var(--muted);
  font-size: 10.5px;
}

.batch-submit-count strong {
  color: var(--text);
  font-weight: 600;
}

.batch-aside .side-info-card {
  padding: 17px 18px;
}

.batch-rules {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.batch-rule {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.batch-rule span:first-child {
  display: grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 3px;
  font-size: 8px;
  font-weight: 650;
}

.batch-progress-card {
  margin-top: 16px;
  overflow: hidden;
  scroll-margin-top: 82px;
  animation: fade-up 0.25s ease both;
}

.batch-progress-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding: 17px 20px 13px;
  border-bottom: 1px solid var(--line);
}

.batch-progress-title {
  min-width: 180px;
  flex: 1;
}

.batch-progress-title h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.batch-progress-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.batch-progress-number {
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: var(--text);
}

.batch-progress-number strong {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.batch-progress-number span {
  color: var(--faint);
  font-size: 9px;
}

.batch-progress-bar-wrap {
  padding: 0 20px 15px;
  border-bottom: 1px solid var(--line);
}

.batch-progress-bar-wrap .progress-track {
  margin: 0;
  height: 5px;
}

.batch-filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 20px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.batch-filterbar .segmented {
  background: #fff;
}

.batch-list {
  padding: 8px 14px 12px;
}

.batch-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.batch-item:last-child {
  border-bottom: 0;
}

.batch-item-status {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin-top: 1px;
  place-items: center;
  color: var(--faint);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 9px;
}

.batch-item-status svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.batch-item-status.running {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.batch-item-status.done {
  color: var(--clear);
  background: var(--clear-soft);
  border-color: var(--clear-border);
}

.batch-item-status.error {
  color: var(--high);
  background: var(--high-soft);
  border-color: var(--high-border);
}

.batch-item-main {
  min-width: 0;
  flex: 1;
}

.batch-item-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.batch-item-company {
  color: var(--text);
  font-size: 11px;
  font-weight: 550;
}

.batch-item-code {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.batch-item-copy {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.batch-item-copy.error {
  color: var(--high-text);
}

.batch-item-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.batch-item-index {
  color: var(--faint);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.batch-done-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
}

.batch-done-footer span {
  color: var(--muted);
  font-size: 10px;
}

.batch-done-footer strong {
  color: var(--text-2);
  font-weight: 550;
}

/* Ledger */

.ledger-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-xs);
}

.ledger-search {
  position: relative;
  width: min(100%, 330px);
}

.ledger-search .input {
  padding-left: 34px;
  background: var(--surface-soft);
}

.ledger-search > svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--faint);
  transform: translateY(-50%);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.ledger-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ledger-filter-label {
  color: var(--faint);
  font-size: 10px;
}

.level-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 10px;
  white-space: nowrap;
}

.level-filter:hover {
  background: var(--surface-soft);
}

.level-filter.is-active {
  color: var(--text);
  background: var(--surface-tint);
  border-color: var(--primary-border);
}

.level-filter .filter-count {
  color: var(--faint);
  font-size: 9px;
}

.ledger-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 10.5px;
}

.ledger-summary strong {
  color: var(--text);
  font-weight: 600;
}

.ledger-card {
  overflow: hidden;
}

.ledger-card .data-table th {
  padding-top: 10px;
  padding-bottom: 10px;
}

.ledger-card .data-table td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ledger-select {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
  cursor: pointer;
}

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  color: var(--text-2);
  background: var(--primary-soft);
  border-bottom: 1px solid var(--primary-border);
  font-size: 10.5px;
}

.bulk-bar strong {
  font-weight: 600;
}

.bulk-bar .bulk-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.collection-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
}

.collection-heading-copy {
  flex: 1;
}

.collection-heading-copy h2 {
  font-size: 13px;
  font-weight: 600;
}

.collection-heading-copy p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.collection-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.collection-card.level-high {
  --risk-color: var(--high);
}

.collection-card.level-suspected {
  --risk-color: var(--suspected);
}

.collection-card.level-minor {
  --risk-color: var(--minor);
}

.collection-card.level-clear {
  --risk-color: var(--clear);
}

.collection-card-body {
  padding: 15px 17px;
}

.collection-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.collection-company {
  min-width: 0;
  flex: 1;
}

.collection-company h3 {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 590;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-company p {
  margin-top: 2px;
  overflow: hidden;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-summary {
  display: -webkit-box;
  margin-top: 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.collection-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   Report detail
   ========================================================================== */

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.report-toolbar-left,
.report-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.report-crumb {
  color: var(--muted);
  font-size: 11px;
}

.report-crumb strong {
  color: var(--text);
  font-weight: 550;
}

.report-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-identity {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.identity-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 17px;
  padding: 20px 22px;
}

.report-identity::after {
  position: absolute;
  top: -65px;
  right: -45px;
  width: 200px;
  height: 200px;
  content: "";
  border: 1px solid rgba(13, 117, 153, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(13, 117, 153, 0.025);
  pointer-events: none;
}

.identity-avatar {
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 11px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.identity-main {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
}

.identity-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.identity-title-row h1 {
  color: var(--text);
  font-size: 20px;
  font-weight: 620;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.identity-code {
  margin-top: 4px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9.5px;
  overflow-wrap: anywhere;
}

.identity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 12px;
  color: var(--faint);
  font-size: 10px;
}

.identity-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.identity-meta strong {
  color: var(--text-2);
  font-weight: 550;
}

.identity-meta svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.identity-side {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  text-align: right;
}

.identity-side-label {
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.identity-side strong {
  display: block;
  margin-top: 3px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 550;
}

.identity-side time {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9.5px;
}

.verdict-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.verdict-card.level-high {
  --risk-color: var(--high);
  --risk-soft: var(--high-soft);
  --risk-border: var(--high-border);
  --risk-text: var(--high-text);
}

.verdict-card.level-suspected {
  --risk-color: var(--suspected);
  --risk-soft: var(--suspected-soft);
  --risk-border: var(--suspected-border);
  --risk-text: var(--suspected-text);
}

.verdict-card.level-minor {
  --risk-color: var(--minor);
  --risk-soft: var(--minor-soft);
  --risk-border: var(--minor-border);
  --risk-text: var(--minor-text);
}

.verdict-card.level-clear {
  --risk-color: var(--clear);
  --risk-soft: var(--clear-soft);
  --risk-border: var(--clear-border);
  --risk-text: var(--clear-text);
}

.verdict-body {
  display: flex;
  align-items: flex-start;
  gap: 26px;
  padding: 23px 24px 21px;
}

.verdict-main {
  min-width: 0;
  flex: 1;
}

.verdict-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  color: var(--risk-text);
  background: var(--risk-soft);
  border: 1px solid var(--risk-border);
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.verdict-main h2 {
  max-width: 800px;
  margin-top: 10px;
  color: var(--text);
  font-size: 19px;
  font-weight: 620;
  letter-spacing: -0.02em;
  line-height: 1.45;
}

.verdict-summary {
  max-width: 880px;
  margin-top: 9px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.75;
}

.verdict-action {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 900px;
  margin-top: 14px;
  padding: 11px 13px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--risk-color);
  border-radius: 0 7px 7px 0;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.6;
}

.verdict-action svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
  color: var(--risk-color);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.verdict-action strong {
  color: var(--text);
  font-weight: 600;
}

.verdict-confidence {
  display: flex;
  flex: 0 0 138px;
  flex-direction: column;
  align-items: center;
  padding-top: 5px;
}

.confidence-ring {
  position: relative;
  width: 116px;
  height: 116px;
}

.confidence-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.confidence-ring .ring-track {
  fill: none;
  stroke: #edf1f4;
  stroke-width: 8;
}

.confidence-ring .ring-value {
  fill: none;
  stroke: var(--risk-color);
  stroke-width: 8;
  stroke-linecap: butt;
  transition: stroke-dasharray 0.7s ease;
}

.confidence-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.confidence-ring-center strong {
  color: var(--text);
  font-size: 31px;
  font-weight: 650;
  letter-spacing: -0.06em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.confidence-ring-center strong small {
  margin-left: 1px;
  font-size: 13px;
  font-weight: 550;
}

.confidence-ring-center span {
  margin-top: 5px;
  color: var(--faint);
  font-size: 9px;
}

.verdict-confidence > p {
  max-width: 138px;
  margin-top: 9px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.5;
  text-align: center;
}

.verdict-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 12px 24px;
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
}

.verdict-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 9.5px;
}

.verdict-meta-item strong {
  color: var(--text-2);
  font-weight: 550;
}

.verdict-meta-item svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.clear-caveat {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 24px 17px;
  padding: 9px 11px;
  color: var(--clear-text);
  background: var(--clear-soft);
  border: 1px solid var(--clear-border);
  border-radius: 6px;
  font-size: 10.5px;
  line-height: 1.55;
}

.clear-caveat svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.report-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.report-grid-2.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-card {
  overflow: hidden;
}

.report-card .card-header {
  padding-bottom: 13px;
}

.report-card .card-header.bordered {
  border-bottom: 1px solid var(--line);
}

.report-card .card-body {
  padding-top: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 20px;
  border-top: 1px solid var(--line);
}

.info-cell {
  min-width: 0;
  padding: 12px 12px 12px 0;
  border-bottom: 1px dashed var(--line);
}

.info-cell:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.info-cell span {
  display: block;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.4;
}

.info-cell strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 550;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-cell strong.multiline {
  display: -webkit-box;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.info-cell .inline-tag {
  display: inline-flex;
  margin-top: 3px;
  padding: 1px 5px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 8px;
  font-weight: 500;
}

.info-footer {
  padding: 12px 20px 17px;
}

.info-footer-label {
  display: block;
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 9px;
}

.info-footer p {
  color: var(--text-2);
  font-size: 10.5px;
  line-height: 1.7;
}

.changes-panel {
  padding: 0 20px 18px;
}

.change-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
}

.change-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.change-item:last-child {
  border-bottom: 0;
}

.change-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  margin-top: 1px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.change-icon svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.change-icon.new {
  color: var(--suspected);
  background: var(--suspected-soft);
  border-color: var(--suspected-border);
}

.change-icon.cleared {
  color: var(--clear);
  background: var(--clear-soft);
  border-color: var(--clear-border);
}

.change-copy {
  min-width: 0;
  flex: 1;
}

.change-copy strong {
  display: block;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 550;
}

.change-copy span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.5;
}

.change-empty {
  padding: 15px 0 3px;
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.changes-panel .btn {
  margin-top: 10px;
}

.decision-panel {
  padding: 0 20px 18px;
}

.decision-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}

.engine-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 550;
}

.engine-chip.guardrail {
  color: var(--suspected-text);
  background: var(--suspected-soft);
  border-color: var(--suspected-border);
}

.engine-chip.off {
  color: var(--muted);
  background: var(--surface-soft);
  border-color: var(--line);
}

.engine-chip svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.decision-reasons {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.decision-reason {
  position: relative;
  display: flex;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--text-2);
  font-size: 10.5px;
  line-height: 1.6;
}

.decision-reason:last-child {
  border-bottom: 0;
}

.reason-number {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  margin-top: 1px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 4px;
  font-size: 8px;
  font-weight: 650;
}

.confidence-note {
  margin-top: 11px;
  padding: 8px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 9.5px;
  line-height: 1.6;
}

/* Findings and tabs */

.findings-card {
  overflow: hidden;
}

.risk-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 20px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.risk-tabs::-webkit-scrollbar {
  display: none;
}

.risk-tab {
  position: relative;
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
}

.risk-tab:hover {
  color: var(--text);
}

.risk-tab::after {
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 2px;
  content: "";
  background: transparent;
}

.risk-tab.is-active {
  color: var(--text);
}

.risk-tab.is-active::after {
  background: var(--primary);
}

.risk-tab .tab-count {
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  color: var(--faint);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 8.5px;
  line-height: 15px;
  text-align: center;
}

.risk-tab.is-active .tab-count {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.risk-tab .tab-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--faint);
}

.risk-tab .tab-dot.high {
  background: var(--high);
}

.risk-tab .tab-dot.suspected {
  background: var(--suspected);
}

.risk-tab .tab-dot.minor {
  background: var(--minor);
}

.risk-tab .tab-dot.clear {
  background: var(--clear);
}

.findings-list {
  padding: 8px 14px 14px;
}

.finding {
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.finding:hover {
  border-color: var(--line-strong);
}

.finding.is-open {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}

.finding.level-high {
  border-left: 1px solid var(--line);
}

.finding.level-suspected {
  border-left: 1px solid var(--line);
}

.finding.level-minor {
  border-left: 1px solid var(--line);
}

.finding.level-clear {
  border-left: 1px solid var(--line);
}

.finding-head {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  background: var(--surface);
  border: 0;
  text-align: left;
}

.finding-head:hover {
  background: #fbfcfd;
}

.finding-level-mark {
  width: 3px;
  height: 35px;
  flex: 0 0 3px;
  margin-top: 2px;
  background: var(--faint);
  border-radius: 3px;
}

.finding.level-high .finding-level-mark {
  background: var(--high);
}

.finding.level-suspected .finding-level-mark {
  background: var(--suspected);
}

.finding.level-minor .finding-level-mark {
  background: var(--minor);
}

.finding.level-clear .finding-level-mark {
  background: var(--clear);
}

.finding-main {
  min-width: 0;
  flex: 1;
}

.finding-titleline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.finding-titleline h3,
.finding-title-text {
  color: var(--text);
  font-size: 12px;
  font-weight: 590;
  line-height: 1.45;
}

.finding.filtered-out {
  display: none;
}

.finding-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
  margin-top: 4px;
  color: var(--faint);
  font-size: 9px;
}

.finding-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.finding-meta svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.finding-summary {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.finding-chevron {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  margin-top: 1px;
  color: var(--faint);
  border-radius: 5px;
  transition: background 0.14s ease, transform 0.2s ease;
}

.finding-head:hover .finding-chevron {
  background: var(--surface-soft);
}

.finding-chevron svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.finding.is-open .finding-chevron {
  transform: rotate(180deg);
}

.finding-body {
  padding: 0 14px 14px 27px;
  background: var(--surface);
  border-top: 1px solid transparent;
}

.finding.is-open .finding-body {
  border-top-color: var(--line);
}

.finding-body-inner {
  padding-top: 12px;
}

.finding-guidance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.guidance-box {
  padding: 9px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.guidance-box span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--faint);
  font-size: 8.5px;
  font-weight: 550;
}

.guidance-box span svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.guidance-box p {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.6;
}

.pending-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}

.pending-checks-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  color: var(--faint);
  font-size: 8.5px;
  font-weight: 550;
}

.finding-evidence-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--text-2);
  font-size: 9.5px;
  font-weight: 600;
}

.finding-evidence-title span {
  color: var(--faint);
  font-weight: 500;
}

/* Evidence */

.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.evidence-card {
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.evidence-card-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
}

.evidence-source-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--primary-border);
  border-radius: 5px;
}

.evidence-source-icon.judicial {
  color: #83653b;
  background: #fbf7ef;
  border-color: #e9dfcc;
}

.evidence-source-icon.news,
.evidence-source-icon.web {
  color: #5f6f91;
  background: #f5f7fb;
  border-color: #dde3ef;
}

.evidence-source-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.evidence-main {
  min-width: 0;
  flex: 1;
}

.evidence-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.evidence-topline strong {
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 580;
  line-height: 1.45;
}

.evidence-topline .chip {
  white-space: normal;
  line-height: 1.4;
}

.evidence-source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 9px;
  margin-top: 3px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.5;
}

.evidence-source span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.evidence-summary {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.evidence-details {
  border-top: 1px dashed var(--line);
}

.evidence-details summary {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 8.5px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.evidence-details summary::-webkit-details-marker {
  display: none;
}

.evidence-details summary svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 0.15s ease;
}

.evidence-details[open] summary svg {
  transform: rotate(90deg);
}

.evidence-detail-body {
  padding: 0 11px 10px;
}

.evidence-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 12px;
  padding: 8px 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.evidence-fact {
  display: flex;
  gap: 5px;
  min-width: 0;
  font-size: 8.5px;
  line-height: 1.5;
}

.evidence-fact span {
  flex: 0 0 auto;
  color: var(--faint);
}

.evidence-fact strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-2);
  font-weight: 500;
}

.evidence-content {
  margin-top: 7px;
  color: var(--text-2);
  font-size: 9.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.evidence-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 7px;
  color: var(--primary);
  font-size: 9px;
  font-weight: 550;
}

.evidence-link svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.evidence-unavailable {
  padding: 10px 11px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 6px;
  font-size: 9.5px;
}

.finding-none {
  padding: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 6px;
  font-size: 9.5px;
  line-height: 1.6;
}

.finding-empty-state {
  padding: 34px 20px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.finding-empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}

.finding-empty-state p {
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.65;
}

/* Key evidence section */

.evidence-section {
  padding: 0 20px 19px;
}

.evidence-section .evidence-card {
  background: var(--surface);
}

.evidence-section .evidence-list {
  gap: 8px;
}

/* Coverage matrix */

.coverage-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.coverage-legends {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.coverage-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.coverage-legend::before {
  width: 6px;
  height: 6px;
  content: "";
  background: var(--faint);
  border-radius: 50%;
}

.coverage-legend.checked::before {
  background: var(--clear);
}

.coverage-legend.partial::before {
  background: var(--suspected);
}

.coverage-legend.unavailable::before {
  background: #aab5c0;
}

.coverage-bar {
  display: flex;
  height: 5px;
  margin-bottom: 13px;
  overflow: hidden;
  background: #edf1f4;
  border-radius: 4px;
}

.coverage-bar span {
  height: 100%;
}

.coverage-bar .checked {
  background: var(--clear);
}

.coverage-bar .partial {
  background: var(--suspected);
}

.coverage-bar .unavailable {
  background: #c2ccd5;
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.coverage-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  padding: 6px 7px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 9px;
}

.coverage-item.unavailable {
  color: var(--faint);
}

.coverage-status-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  background: var(--clear);
  border-radius: 50%;
}

.coverage-item.partial .coverage-status-dot {
  background: var(--suspected);
}

.coverage-item.unavailable .coverage-status-dot {
  background: #b2bdc7;
}

.coverage-item-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coverage-item.unavailable .coverage-item-name {
  color: var(--faint);
}

.coverage-item-count {
  color: var(--faint);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.coverage-note {
  margin-top: 11px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.6;
}

.gaps-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.gap-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 9px;
  color: var(--muted);
  background: var(--suspected-soft);
  border: 1px solid var(--suspected-border);
  border-radius: 5px;
  font-size: 9.5px;
  line-height: 1.6;
}

.gap-item svg {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  margin-top: 1px;
  color: var(--suspected);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.gaps-empty {
  padding: 13px;
  color: var(--clear-text);
  background: var(--clear-soft);
  border: 1px solid var(--clear-border);
  border-radius: 5px;
  font-size: 9.5px;
  text-align: center;
}

.report-disclaimer {
  padding: 13px 16px;
  color: var(--faint);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 9.5px;
  line-height: 1.7;
}

.report-disclaimer strong {
  color: var(--muted);
  font-weight: 550;
}

/* Report recheck bar */

.recheck-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 13px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 7px;
  font-size: 10.5px;
}

.recheck-strip .scan-spinner {
  width: 13px;
  height: 13px;
}

.recheck-strip strong {
  font-weight: 600;
}

.recheck-strip span {
  color: var(--muted);
}

/* ==========================================================================
   Monitoring
   ========================================================================== */

.monitor-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}

.monitor-kpi {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-xs);
}

.monitor-kpi-icon {
  display: grid;
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 7px;
}

.monitor-kpi-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.monitor-kpi span {
  display: block;
  color: var(--faint);
  font-size: 9.5px;
}

.monitor-kpi strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 18px;
  font-weight: 640;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.monitor-layout {
  display: grid;
  grid-template-columns: minmax(265px, 0.7fr) minmax(0, 1.55fr);
  gap: 16px;
  align-items: start;
}

.group-list-card {
  overflow: hidden;
}

.group-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 17px 13px;
  border-bottom: 1px solid var(--line);
}

.group-list-header h2 {
  font-size: 13px;
  font-weight: 600;
}

.group-list-header span {
  color: var(--faint);
  font-size: 9.5px;
}

.group-list {
  padding: 6px;
}

.group-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 11px 11px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  text-align: left;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.group-item + .group-item {
  margin-top: 2px;
}

.group-item:hover {
  background: var(--surface-soft);
}

.group-item.is-active {
  background: var(--surface-tint);
  border-color: var(--primary-border);
}

.group-item.is-active::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -6px;
  width: 2px;
  content: "";
  background: var(--primary);
  border-radius: 2px;
}

.group-item-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.group-item-name {
  min-width: 0;
  flex: 1;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 570;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.group-status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  margin-top: 5px;
  background: var(--clear);
  border-radius: 50%;
}

.group-status-dot.running {
  background: var(--primary);
  animation: pulse 1.2s infinite;
}

.group-status-dot.paused {
  background: #aab5c0;
}

.group-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 9px;
  margin-top: 6px;
  color: var(--faint);
  font-size: 8.5px;
}

.group-item-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.group-item-meta svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.group-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  color: var(--faint);
  font-size: 8.5px;
}

.group-item-foot strong {
  color: var(--text-2);
  font-weight: 550;
}

.group-item.is-paused .group-item-name {
  color: var(--muted);
}

.group-detail-card {
  overflow: hidden;
  min-height: 420px;
}

.group-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 20px 15px;
  border-bottom: 1px solid var(--line);
}

.group-detail-title {
  min-width: 0;
}

.group-detail-title h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.group-detail-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.group-detail-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.schedule-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0 20px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.schedule-cell {
  padding: 11px 0 11px 14px;
  border-left: 1px solid var(--line);
}

.schedule-cell:first-child {
  padding-left: 0;
  border-left: 0;
}

.schedule-cell span {
  display: block;
  color: var(--faint);
  font-size: 8.5px;
}

.schedule-cell strong {
  display: block;
  margin-top: 3px;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 550;
  line-height: 1.4;
}

.schedule-cell strong.is-running {
  color: var(--primary);
}

.entity-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px 10px;
}

.entity-toolbar h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.entity-toolbar h3 span {
  min-width: 18px;
  padding: 1px 5px;
  color: var(--faint);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 8.5px;
  font-weight: 550;
}

.entity-toolbar-right {
  display: flex;
  align-items: center;
  gap: 7px;
}

.entity-filters {
  display: flex;
  gap: 6px;
}

.entity-filter {
  min-height: 26px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 9px;
}

.entity-filter.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.entity-table-wrap {
  padding: 0 20px 8px;
}

.entity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.entity-table th {
  padding: 7px 8px;
  color: var(--faint);
  border-top: 0;
  border-bottom: 1px solid var(--line);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
}

.entity-table td {
  padding: 9px 8px;
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.entity-table tr:last-child td {
  border-bottom: 0;
}

.entity-table tbody tr:hover {
  background: #fafcfd;
}

.entity-table .entity-company {
  min-width: 145px;
}

.entity-company strong {
  display: block;
  color: var(--text);
  font-size: 10.5px;
  font-weight: 550;
  line-height: 1.35;
}

.entity-company span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7.5px;
}

.relation-tag {
  display: inline-flex;
  padding: 1px 6px;
  color: var(--text-2);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 8.5px;
}

.owner-cell {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 88px;
}

.owner-avatar {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 50%;
  font-size: 8px;
  font-weight: 600;
}

.owner-cell span {
  color: var(--muted);
  font-size: 9.5px;
}

.owner-cell .unassigned {
  color: var(--faint);
}

.entity-actions-cell {
  text-align: right;
  vertical-align: middle !important;
}

.entity-actions {
  display: flex;
  min-height: 22px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.entity-actions .text-button {
  font-size: 9px;
}

/* 保留操作列宽度，悬停或键盘进入该行时再显示破坏性操作。 */
.entity-table .entity-remove-action {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.entity-table tbody tr:hover .entity-remove-action,
.entity-table tbody tr:focus-within .entity-remove-action,
.entity-table .entity-remove-action:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

/* 触屏没有可靠的悬停状态，必须始终提供可见操作。 */
@media (hover: none), (pointer: coarse) {
  .entity-table .entity-remove-action {
    opacity: 1;
    pointer-events: auto;
  }
}

.monitor-empty {
  padding: 48px 20px;
}

/* ==========================================================================
   Notifications / users
   ========================================================================== */

.notification-layout {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.notification-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-xs);
}

.owner-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.owner-filter {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 10px;
}

.owner-filter:hover {
  background: var(--surface-soft);
}

.owner-filter.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.owner-filter-count {
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  color: inherit;
  background: rgba(13, 117, 153, 0.08);
  border-radius: 3px;
  font-size: 8px;
  line-height: 15px;
  text-align: center;
}

.notification-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-empty-card {
  padding: 20px;
}

.owner-group {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.owner-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.owner-avatar-lg {
  display: grid;
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
}

.owner-group-copy {
  min-width: 0;
  flex: 1;
}

.owner-group-copy strong {
  display: block;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
}

.owner-group-copy span {
  display: block;
  margin-top: 1px;
  color: var(--faint);
  font-size: 9px;
}

.owner-group-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.owner-unread {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 9px;
  font-weight: 550;
}

.owner-unread::before {
  width: 5px;
  height: 5px;
  content: "";
  background: var(--primary);
  border-radius: 50%;
}

.notification-list {
  padding: 0 16px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-level {
  width: 3px;
  height: 31px;
  flex: 0 0 3px;
  margin-top: 2px;
  background: var(--faint);
  border-radius: 3px;
}

.notification-level.high {
  background: var(--high);
}

.notification-level.suspected {
  background: var(--suspected);
}

.notification-level.minor {
  background: var(--minor);
}

.notification-level.mixed {
  background: var(--primary);
}

.notification-main {
  min-width: 0;
  flex: 1;
}

.notification-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.notification-topline strong {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 570;
  line-height: 1.45;
}

.notification-item.is-unread .notification-topline strong::after {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 6px;
  vertical-align: 2px;
  content: "";
  background: var(--primary);
  border-radius: 50%;
}

.notification-content {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notification-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.notification-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 7px;
  color: var(--faint);
  font-size: 8.5px;
}

.notification-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.notification-meta svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.notification-actions-mini {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.notification-actions-mini .text-button {
  font-size: 9px;
  white-space: nowrap;
}

.owner-empty {
  padding: 28px 16px;
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
}

/* ==========================================================================
   Integration
   ========================================================================== */

.integration-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 16px;
  padding: 24px 26px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.integration-hero::after {
  position: absolute;
  top: -90px;
  right: 10%;
  width: 250px;
  height: 250px;
  content: "";
  border: 1px solid rgba(13, 117, 153, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 35px rgba(13, 117, 153, 0.02);
}

.integration-hero-main {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
}

.integration-hero h2 {
  max-width: 640px;
  color: var(--text);
  font-size: 22px;
  font-weight: 620;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.integration-hero p {
  max-width: 700px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

.integration-endpoint {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding: 6px 9px;
  color: var(--text-2);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.integration-endpoint .method {
  padding: 2px 5px;
  color: #fff;
  background: var(--primary);
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 700;
}

.integration-hero-mark {
  position: relative;
  z-index: 1;
  display: grid;
  width: 98px;
  height: 98px;
  flex: 0 0 98px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 20px;
}

.integration-hero-mark svg {
  width: 46px;
  height: 46px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.integration-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  padding: 0 2px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.integration-tabs::-webkit-scrollbar {
  display: none;
}

.integration-tab {
  position: relative;
  min-height: 40px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
}

.integration-tab:hover {
  color: var(--text);
}

.integration-tab.is-active {
  color: var(--primary);
}

.integration-tab.is-active::after {
  position: absolute;
  right: 9px;
  bottom: -1px;
  left: 9px;
  height: 2px;
  content: "";
  background: var(--primary);
}

.integration-tab-panel {
  animation: fade-up 0.22s ease both;
}

.integration-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 16px;
  align-items: start;
}

.integration-main,
.integration-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.scene-card {
  padding: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.scene-icon {
  display: grid;
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  place-items: center;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--primary-border);
  border-radius: 6px;
}

.scene-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.scene-card strong {
  display: block;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
}

.scene-card p {
  margin-top: 3px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.55;
}

.flow-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 15px 10px;
}

.flow-node {
  flex: 1;
  padding: 8px 5px;
  color: var(--text-2);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 550;
  text-align: center;
}

.flow-node.active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.flow-arrow {
  flex: 0 0 15px;
  color: var(--faint);
}

.flow-arrow svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.integration-principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.principle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.principle > svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
  color: var(--primary);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.principle strong {
  display: block;
  color: var(--text-2);
  font-size: 9.5px;
  font-weight: 600;
}

.principle p {
  margin-top: 2px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.55;
}

.doc-section + .doc-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.doc-section h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
}

.doc-section h3 svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.doc-section > p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.field-table {
  width: 100%;
  margin-top: 9px;
  border-collapse: collapse;
  font-size: 9.5px;
}

.field-table th {
  padding: 7px 8px;
  color: var(--faint);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 8.5px;
  font-weight: 600;
  text-align: left;
}

.field-table td {
  padding: 7px 8px;
  color: var(--text-2);
  border: 1px solid var(--line);
  line-height: 1.5;
  vertical-align: top;
}

.field-table td:first-child {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  white-space: nowrap;
}

.field-table .required-mark {
  color: var(--high);
}

.code-block {
  position: relative;
  margin-top: 9px;
  overflow: hidden;
  background: #0c1e2e;
  border: 1px solid #18364d;
  border-radius: 8px;
}

.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 11px;
  color: #7f9ab0;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 8.5px;
}

.code-block-head span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  color: #9db5c6;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  font-size: 8px;
}

.code-copy:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.code-copy svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.code-block pre {
  max-height: 310px;
  margin: 0;
  padding: 12px 13px;
  overflow: auto;
  color: #c6d8e5;
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.7;
  tab-size: 2;
  white-space: pre;
}

.code-block code {
  font-family: inherit;
}

.code-key {
  color: #83c7dd;
}

.code-string {
  color: #b9d69b;
}

.code-comment {
  color: #658198;
}

.integration-demo {
  padding: 20px 22px;
}

.integration-demo h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 620;
}

.integration-demo h2 svg {
  width: 17px;
  height: 17px;
  color: var(--primary);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.demo-warning {
  margin-top: 12px;
}

.demo-party-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.demo-party-row {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 0.8fr 30px;
  gap: 7px;
  align-items: center;
}

.demo-party-row .input {
  min-height: 34px;
  font-size: 10.5px;
}

.icon-mini {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  padding: 0;
  color: var(--faint);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.icon-mini:hover {
  color: var(--high);
  background: var(--high-soft);
  border-color: var(--high-border);
}

.icon-mini svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.integration-response {
  margin-top: 15px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  scroll-margin-top: 82px;
}

.integration-response-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

.integration-response-head strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.integration-response-body {
  padding: 13px;
}

.integration-result-badge {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.integration-result-badge.high {
  background: var(--high-soft);
  border-color: var(--high-border);
}

.integration-result-badge.suspected {
  background: var(--suspected-soft);
  border-color: var(--suspected-border);
}

.integration-result-badge.minor {
  background: var(--minor-soft);
  border-color: var(--minor-border);
}

.integration-result-badge.clear {
  background: var(--clear-soft);
  border-color: var(--clear-border);
}

.integration-result-badge strong {
  display: block;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.integration-result-badge p {
  margin-top: 3px;
  color: var(--text-2);
  font-size: 9.5px;
  line-height: 1.6;
}

.integration-result-parties {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 9px;
}

.integration-result-party {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 9px;
}

.integration-result-party strong {
  color: var(--text-2);
  font-size: 9.5px;
  font-weight: 550;
}

.integration-result-party span {
  color: var(--faint);
}

.integration-result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}

.raw-json {
  position: relative;
  margin-top: 10px;
}

.raw-json summary {
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.raw-json pre {
  max-height: 340px;
  margin: 7px 0 0;
  padding: 11px;
  overflow: auto;
  color: #3d5061;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.embed-steps {
  counter-reset: embed-step;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.embed-step {
  position: relative;
  padding-left: 30px;
  counter-increment: embed-step;
}

.embed-step::before {
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  content: counter(embed-step);
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 50%;
  font-size: 8.5px;
  font-weight: 650;
}

.embed-step strong {
  display: block;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 600;
}

.embed-step p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.widget-style-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 5px;
  font-size: 9px;
  line-height: 1.5;
}

.widget-style-note strong {
  color: var(--text-2);
  font-weight: 550;
}

/* ==========================================================================
   Settings
   ========================================================================== */

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 16px;
  align-items: start;
}

.settings-main,
.settings-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-card {
  padding: 20px 22px;
}

.settings-card-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.settings-card-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 7px;
}

.settings-card-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.settings-card-head h2 {
  color: var(--text);
  font-size: 13px;
  font-weight: 620;
}

.settings-card-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.settings-callout {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 13px;
  padding: 9px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 9.5px;
  line-height: 1.6;
}

.settings-callout svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-top: 1px;
  color: var(--primary);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.system-status-list {
  display: flex;
  flex-direction: column;
}

.system-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 10px;
}

.system-status:last-child {
  border-bottom: 0;
}

.system-status-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.system-status-label svg {
  width: 13px;
  height: 13px;
  color: var(--faint);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.status-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  font-size: 9.5px;
  font-weight: 550;
  text-align: right;
}

.status-text::before {
  width: 5px;
  height: 5px;
  content: "";
  background: var(--faint);
  border-radius: 50%;
}

.status-text.on::before {
  background: var(--clear);
}

.status-text.off::before {
  background: #aab5c0;
}

.status-text.demo::before {
  background: var(--suspected);
}

.settings-links {
  display: flex;
  flex-direction: column;
}

.settings-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  color: var(--text-2);
  border-bottom: 1px dashed var(--line);
  font-size: 10px;
}

.settings-link:last-child {
  border-bottom: 0;
}

.settings-link > svg:first-child {
  width: 15px;
  height: 15px;
  color: var(--muted);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.settings-link span {
  flex: 1;
}

.settings-link > svg:last-child {
  width: 12px;
  height: 12px;
  color: var(--faint);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.settings-save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.settings-save-bar p {
  color: var(--faint);
  font-size: 9.5px;
}

.settings-save-bar p strong {
  color: var(--text-2);
  font-weight: 550;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 23, 37, 0.48);
  backdrop-filter: blur(2px);
  animation: modal-fade 0.16s ease both;
}

@keyframes modal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  display: flex;
  width: min(100%, 560px);
  max-height: min(86vh, 850px);
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  animation: modal-rise 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal.modal-lg {
  width: min(100%, 780px);
}

.modal.modal-xl {
  width: min(100%, 980px);
}

.modal.modal-sm {
  width: min(100%, 430px);
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head-copy {
  min-width: 0;
  flex: 1;
}

.modal-head-copy h2 {
  color: var(--text);
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.015em;
}

.modal-head-copy p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.modal-close {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  padding: 0;
  color: var(--faint);
  background: transparent;
  border: 0;
  border-radius: 5px;
}

.modal-close:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.modal-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.modal-body {
  min-height: 0;
  flex: 1;
  padding: 18px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #c9d3dd transparent;
}

.modal-body.no-pad {
  padding: 0;
}

.modal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
}

.modal-foot.split {
  justify-content: space-between;
}

.modal-foot-note {
  color: var(--faint);
  font-size: 9px;
}

.modal-confirm-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 13px;
  place-items: center;
  color: var(--suspected);
  background: var(--suspected-soft);
  border: 1px solid var(--suspected-border);
  border-radius: 50%;
}

.modal-confirm-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.confirm-copy {
  text-align: center;
}

.confirm-copy h3 {
  font-size: 14px;
  font-weight: 600;
}

.confirm-copy p {
  max-width: 370px;
  margin: 7px auto 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.confirm-copy p strong {
  color: var(--text-2);
  font-weight: 550;
}

/* Add entities rows */

.entity-editor {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.entity-editor-head {
  display: grid;
  grid-template-columns: 1.2fr 1.35fr 0.75fr 0.9fr 28px;
  gap: 7px;
  padding: 7px 9px;
  color: var(--faint);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  font-size: 8px;
  font-weight: 600;
}

.entity-editor-row {
  display: grid;
  grid-template-columns: 1.2fr 1.35fr 0.75fr 0.9fr 28px;
  gap: 7px;
  align-items: center;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}

.entity-editor-row:last-child {
  border-bottom: 0;
}

.entity-editor-row .input,
.entity-editor-row .select {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 10px;
  border-radius: 5px;
}

.entity-editor-row .select {
  padding-right: 25px;
  background-position: right 7px center;
}

.entity-editor-empty {
  padding: 18px 12px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.editor-remove {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  padding: 0;
  color: var(--faint);
  background: transparent;
  border: 0;
  border-radius: 4px;
}

.editor-remove:hover {
  color: var(--high);
  background: var(--high-soft);
}

.editor-remove svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.bulk-paste {
  margin-bottom: 13px;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.bulk-paste .textarea {
  min-height: 68px;
  background: var(--surface);
  font-size: 10.5px;
}

.bulk-paste-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
}

.bulk-paste-actions span {
  color: var(--faint);
  font-size: 8.5px;
}

.form-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
}

.form-section-title small {
  color: var(--faint);
  font-size: 8.5px;
  font-weight: 400;
}

.frequency-preview {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  padding: 7px 9px;
  color: var(--muted);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 5px;
  font-size: 9px;
  line-height: 1.5;
}

.frequency-preview svg {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  color: var(--primary);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

/* Toast */

.toast-root {
  position: fixed;
  z-index: 160;
  right: 22px;
  bottom: 22px;
  display: flex;
  width: min(100% - 32px, 380px);
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  color: #eaf3f8;
  background: #10283e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(8, 23, 37, 0.22);
  font-size: 11px;
  line-height: 1.55;
  animation: toast-in 0.22s ease both;
  pointer-events: auto;
}

.toast.is-leaving {
  animation: toast-out 0.18s ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(5px);
  }
}

.toast-icon {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  margin-top: 0;
  place-items: center;
  color: #8ed4ec;
  background: rgba(76, 169, 199, 0.16);
  border-radius: 4px;
}

.toast.success .toast-icon {
  color: #8adaaf;
  background: rgba(63, 170, 118, 0.15);
}

.toast.error .toast-icon {
  color: #ed9b9b;
  background: rgba(194, 82, 82, 0.16);
}

.toast.warning .toast-icon {
  color: #e9be75;
  background: rgba(189, 114, 25, 0.16);
}

.toast-icon svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.toast-copy {
  min-width: 0;
  flex: 1;
}

.toast-copy strong {
  display: block;
  color: #f4f9fc;
  font-size: 11px;
  font-weight: 600;
}

.toast-copy span {
  display: block;
  margin-top: 2px;
  color: #9fb5c7;
  font-size: 10px;
  line-height: 1.5;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1320px) {
  .view {
    padding-right: 24px;
    padding-left: 24px;
  }

  .topbar {
    padding-right: 22px;
    padding-left: 22px;
  }

  .account-copy {
    display: none;
  }

  .account-chip {
    padding-right: 3px;
  }

  .risk-snapshot {
    grid-template-columns: 154px minmax(0, 1fr);
    gap: 16px;
  }

  .risk-donut {
    width: 132px;
    height: 132px;
  }

  .coverage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scene-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .sidebar {
    width: 232px;
  }

  .workspace {
    margin-left: 232px;
  }

  .topbar-left {
    min-width: 158px;
  }

  .breadcrumb span {
    display: none;
  }

  .breadcrumb > svg {
    display: none;
  }

  .global-search-wrap {
    max-width: 410px;
  }

  .dash-layout,
  .dash-layout.secondary {
    grid-template-columns: 1fr;
  }

  .side-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
  }

  .query-layout,
  .batch-layout {
    grid-template-columns: 1fr;
  }

  .query-side,
  .batch-aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .query-side .query-note-card:nth-last-child(1):nth-child(odd) {
    grid-column: span 2;
  }

  .report-grid-2 {
    grid-template-columns: 1fr;
  }

  .report-grid-2.equal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monitor-layout {
    grid-template-columns: 1fr;
  }

  .group-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .group-item + .group-item {
    margin-top: 0;
  }

  .group-item.is-active::before {
    left: -6px;
  }

  .integration-grid,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .integration-side,
  .settings-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 1080px) {
  .sidebar {
    width: 246px;
    box-shadow: 14px 0 34px rgba(5, 19, 32, 0.22);
    transform: translateX(-102%);
  }

  .workspace,
  body.sidebar-collapsed .workspace {
    margin-left: 0;
  }

  body.sidebar-collapsed .sidebar {
    width: 246px;
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 55;
    inset: 0;
    display: block;
    padding: 0;
    background: rgba(8, 23, 37, 0.4);
    border: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.mobile-nav-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .context-copy,
  body.sidebar-collapsed .context-badge,
  body.sidebar-collapsed .nav-heading,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .source-copy,
  body.sidebar-collapsed .source-ring,
  body.sidebar-collapsed .sidebar-help span,
  body.sidebar-collapsed .sidebar-help .help-arrow {
    display: block;
  }

  body.sidebar-collapsed .brand {
    justify-content: flex-start;
    padding: 0 18px;
  }

  body.sidebar-collapsed .sidebar-context {
    justify-content: flex-start;
    min-height: 60px;
    margin: 14px 12px 6px;
    padding: 10px;
  }

  body.sidebar-collapsed .nav {
    padding-right: 12px;
    padding-left: 12px;
  }

  body.sidebar-collapsed .nav-link {
    justify-content: flex-start;
    padding: 0 10px;
  }

  body.sidebar-collapsed .nav-link .nav-marker {
    display: block;
  }

  body.sidebar-collapsed .nav-link .nav-count {
    position: static;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    line-height: 18px;
  }

  body.sidebar-collapsed .source-status {
    justify-content: flex-start;
    padding: 8px 9px;
  }

  body.sidebar-collapsed .sidebar-help {
    justify-content: flex-start;
    padding: 7px 9px;
  }

  .topbar {
    gap: 16px;
  }

  .topbar-left {
    min-width: auto;
  }

  .global-search-wrap {
    max-width: none;
  }

  .global-search kbd {
    display: none;
  }

  .app-footer {
    padding-bottom: 18px;
  }
}

@media (max-width: 900px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monitor-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-cell:nth-last-child(-n + 3) {
    border-bottom: 1px dashed var(--line);
  }

  .info-cell:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .coverage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .verdict-body {
    gap: 18px;
    padding: 20px;
  }

  .verdict-confidence {
    flex-basis: 118px;
  }

  .confidence-ring {
    width: 100px;
    height: 100px;
  }

  .confidence-ring-center strong {
    font-size: 27px;
  }

  .schedule-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .schedule-cell {
    padding: 9px 0 9px 12px;
  }

  .schedule-cell:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .entity-table-wrap {
    overflow-x: auto;
  }

  .entity-table {
    min-width: 610px;
  }
}

@media (max-width: 760px) {
  .view {
    padding: 18px 16px 30px;
  }

  .topbar {
    height: 58px;
    flex-basis: 58px;
    gap: 10px;
    padding: 0 14px;
  }

  .topbar-left {
    gap: 7px;
  }

  .breadcrumb {
    display: none;
  }

  .global-search-wrap {
    flex: 1;
  }

  .global-search {
    height: 35px;
  }

  .global-search input {
    font-size: 11.5px;
  }

  .topbar-divider {
    display: none;
  }

  .account-chip {
    display: none;
  }

  .topbar-actions {
    gap: 2px;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 17px;
  }

  .page-head h1 {
    font-size: 21px;
  }

  .page-head .page-description {
    font-size: 11.5px;
  }

  .page-head-actions {
    flex-wrap: wrap;
  }

  .page-head-actions .btn {
    flex: 1;
  }

  .stat-grid {
    gap: 9px;
    margin-bottom: 12px;
  }

  .stat-card {
    min-height: 116px;
    padding: 13px 13px 12px;
  }

  .stat-value {
    font-size: 24px;
  }

  .stat-foot {
    font-size: 9px;
  }

  .dash-layout,
  .dash-layout.secondary {
    gap: 12px;
    margin-bottom: 12px;
  }

  .side-stack,
  .query-side,
  .batch-aside,
  .integration-side,
  .settings-side {
    grid-template-columns: 1fr;
  }

  .query-side .query-note-card:nth-last-child(1):nth-child(odd) {
    grid-column: auto;
  }

  .risk-snapshot-wrap {
    padding: 16px;
  }

  .risk-snapshot {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0;
    text-align: center;
  }

  .risk-donut {
    width: 142px;
    height: 142px;
  }

  .risk-legend {
    text-align: left;
  }

  .monitor-glance-grid {
    margin: 14px 16px 0;
  }

  .monitor-next {
    margin: 12px 16px 15px;
  }

  .card-header {
    padding: 15px 16px 12px;
  }

  .card-body {
    padding: 0 16px 16px;
  }

  .card-action .btn {
    min-height: 30px;
    padding: 0 9px;
    font-size: 10px;
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody {
    display: block;
  }

  .data-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--line);
  }

  .data-table tr:last-child {
    border-bottom: 0;
  }

  .data-table td {
    display: block;
    padding: 0;
    border: 0;
  }

  .data-table td[data-mobile="hide"] {
    display: none;
  }

  .data-table td.company-cell {
    grid-column: 1 / -1;
    padding-bottom: 2px;
  }

  .data-table td.level-cell {
    grid-column: 1;
  }

  .data-table td.action-cell {
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: center;
    text-align: right;
  }

  .data-table td.summary-cell {
    grid-column: 1 / -1;
  }

  .data-table td.time-cell {
    grid-column: 1 / -1;
  }

  .cell-summary {
    max-width: none;
    -webkit-line-clamp: 2;
  }

  .query-card,
  .batch-card {
    padding: 17px 16px 16px;
  }

  .query-card-head {
    margin-bottom: 15px;
    padding-bottom: 13px;
  }

  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .query-submit-row {
    flex-direction: column;
    align-items: stretch;
    gap: 11px;
  }

  .query-submit-actions {
    width: 100%;
  }

  .query-submit-actions .btn {
    flex: 1;
  }

  .query-submit-note {
    order: 2;
  }

  .batch-preview-list {
    grid-template-columns: 1fr;
  }

  .batch-submit-row {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
  }

  .batch-submit-row .btn {
    width: 100%;
  }

  .batch-progress-summary {
    gap: 11px 17px;
    padding: 15px 16px 12px;
  }

  .batch-progress-title {
    flex-basis: 100%;
  }

  .batch-progress-bar-wrap {
    padding: 0 16px 13px;
  }

  .batch-filterbar {
    padding: 10px 16px;
  }

  .batch-list {
    padding: 6px 10px 10px;
  }

  .batch-item {
    padding: 10px 6px;
  }

  .batch-item-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 84px;
  }

  .ledger-toolbar {
    align-items: stretch;
  }

  .ledger-search {
    width: 100%;
  }

  .ledger-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .collection-grid {
    grid-template-columns: 1fr;
  }

  .report-toolbar {
    margin-bottom: 12px;
  }

  .report-toolbar-right {
    width: 100%;
  }

  .report-toolbar-right .btn {
    flex: 1;
  }

  .identity-header {
    gap: 12px;
    padding: 16px;
  }

  .identity-avatar {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    font-size: 17px;
  }

  .identity-title-row h1 {
    font-size: 17px;
  }

  .identity-side {
    display: none;
  }

  .identity-meta {
    gap: 5px 12px;
  }

  .verdict-body {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 18px 16px;
  }

  .verdict-main h2 {
    font-size: 16px;
  }

  .verdict-confidence {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 13px;
    padding: 0;
  }

  .confidence-ring {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
  }

  .confidence-ring .ring-track,
  .confidence-ring .ring-value {
    stroke-width: 7;
  }

  .confidence-ring-center strong {
    font-size: 22px;
  }

  .verdict-confidence > p {
    max-width: 210px;
    margin: 0;
    align-self: center;
    font-size: 9px;
    text-align: left;
  }

  .verdict-meta {
    gap: 7px 13px;
    padding: 10px 16px;
  }

  .clear-caveat {
    margin: 0 16px 14px;
  }

  .verdict-card .card-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .info-grid {
    margin: 0 16px;
  }

  .info-footer,
  .changes-panel,
  .decision-panel,
  .evidence-section {
    padding-right: 16px;
    padding-left: 16px;
  }

  .risk-tabs {
    padding: 0 10px;
  }

  .risk-tab {
    padding: 0 9px;
  }

  .finding-head {
    padding: 12px 10px;
  }

  .finding-body {
    padding: 0 10px 12px 13px;
  }

  .finding-guidance {
    grid-template-columns: 1fr;
  }

  .coverage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-grid-2.equal {
    grid-template-columns: 1fr;
  }

  .report-identity::after {
    display: none;
  }

  .monitor-kpis {
    gap: 8px;
  }

  .monitor-kpi {
    padding: 10px 11px;
  }

  .monitor-kpi strong {
    font-size: 16px;
  }

  .group-list {
    grid-template-columns: 1fr;
  }

  .group-detail-head {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .group-detail-actions {
    width: 100%;
  }

  .group-detail-actions .btn {
    flex: 1;
  }

  .schedule-strip {
    padding-right: 16px;
    padding-left: 16px;
  }

  .entity-toolbar {
    padding-right: 16px;
    padding-left: 16px;
  }

  .entity-table-wrap {
    padding-right: 16px;
    padding-left: 16px;
  }

  .notification-toolbar {
    align-items: stretch;
  }

  .owner-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .notification-actions {
    width: 100%;
  }

  .notification-actions .btn {
    flex: 1;
  }

  .owner-group-head {
    flex-wrap: wrap;
  }

  .owner-group-meta {
    width: 100%;
    padding-left: 43px;
  }

  .notification-item {
    gap: 8px;
  }

  .notification-actions-mini {
    flex-direction: column;
    align-items: flex-end;
  }

  .integration-hero {
    align-items: flex-start;
    padding: 19px 18px;
  }

  .integration-hero h2 {
    font-size: 18px;
  }

  .integration-hero-mark {
    display: none;
  }

  .scene-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .integration-principles {
    grid-template-columns: 1fr;
  }

  .integration-demo {
    padding: 17px 16px;
  }

  .demo-party-row {
    grid-template-columns: 1fr 1fr 0.9fr 28px;
  }

  .flow-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    padding: 12px 0;
  }

  .flow-node {
    flex: 0 0 calc(50% - 18px);
  }

  .flow-arrow {
    display: none;
  }

  .settings-card {
    padding: 17px 16px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal,
  .modal.modal-lg,
  .modal.modal-xl,
  .modal.modal-sm {
    width: 100%;
    max-height: 92vh;
    border-radius: 12px 12px 0 0;
    border-bottom: 0;
  }

  .modal-head {
    padding: 16px 16px 12px;
  }

  .modal-body {
    padding: 15px 16px;
  }

  .modal-foot {
    padding: 11px 16px calc(11px + env(safe-area-inset-bottom));
  }

  .modal-foot .btn {
    flex: 1;
  }

  .entity-editor-head {
    display: none;
  }

  .entity-editor-row {
    grid-template-columns: 1fr 1fr 26px;
    gap: 6px;
    padding: 9px;
  }

  .entity-editor-row .input:nth-child(1) {
    grid-column: span 2;
  }

  .entity-editor-row .input:nth-child(2) {
    grid-column: 1 / span 2;
  }

  .entity-editor-row .select:nth-child(3) {
    grid-column: 1;
  }

  .entity-editor-row .select:nth-child(4) {
    grid-column: 2;
  }

  .entity-editor-row .editor-remove {
    grid-column: 3;
    grid-row: 1;
  }

  .demo-party-row {
    grid-template-columns: 1fr 1fr 28px;
  }

  .demo-party-row .input:nth-child(1) {
    grid-column: span 2;
  }

  .demo-party-row .select:nth-child(3) {
    grid-column: 1;
  }

  .demo-party-row .icon-mini {
    grid-column: 3;
    grid-row: 1;
  }

  .toast-root {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
  }

  .app-footer {
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 18px;
    font-size: 9.5px;
    text-align: center;
  }

  .search-popover {
    position: fixed;
    top: 64px;
    right: 12px;
    left: 12px;
    width: auto;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card {
    min-height: 105px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-icon {
    width: 26px;
    height: 26px;
  }

  .risk-legend {
    grid-template-columns: 1fr 1fr;
  }

  .risk-legend-item {
    padding: 7px;
  }

  .risk-legend-copy span {
    font-size: 9px;
  }

  .risk-legend-copy strong {
    font-size: 14px;
  }

  .page-head-actions .btn {
    min-height: 34px;
    font-size: 11px;
  }

  .topbar {
    padding: 0 10px;
  }

  .global-search {
    padding-left: 9px;
  }

  .monitor-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .monitor-kpi-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .monitor-kpi strong {
    font-size: 15px;
  }

  .schedule-strip {
    grid-template-columns: 1fr 1fr;
  }

  .coverage-grid {
    grid-template-columns: 1fr 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .identity-meta span:nth-child(n + 4) {
    display: none;
  }

  .verdict-meta-item:nth-child(n + 5) {
    display: none;
  }

  .scene-grid {
    grid-template-columns: 1fr;
  }

  .example-chips {
    display: grid;
    grid-template-columns: 1fr;
  }

  .example-chip {
    white-space: normal;
  }

  .example-chip {
    justify-content: flex-start;
  }

  .stage-list {
    grid-template-columns: 1fr 1fr;
  }

  .stage-item:nth-child(2)::after {
    display: none;
  }

  .segmented {
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  @page {
    size: A4;
    margin: 14mm 12mm;
  }

  body {
    color: #111;
    background: #fff;
    font-size: 10.5pt;
  }

  .sidebar,
  .sidebar-scrim,
  .topbar,
  .app-footer,
  .report-toolbar,
  .report-toolbar-right,
  .recheck-strip,
  .toast-root,
  .modal-backdrop,
  .skip-link,
  .finding-chevron {
    display: none !important;
  }

  .workspace {
    margin-left: 0 !important;
  }

  .view {
    max-width: none;
    padding: 0;
  }

  .report-layout {
    gap: 10px;
  }

  .report-identity,
  .verdict-card,
  .report-card,
  .report-disclaimer {
    break-inside: avoid;
    box-shadow: none;
  }

  .report-card {
    break-inside: auto;
  }

  .verdict-body {
    padding: 14px;
  }

  .verdict-main h2 {
    font-size: 15pt;
  }

  .finding {
    break-inside: avoid;
  }

  .finding.filtered-out {
    display: block !important;
  }

  .finding-body[hidden] {
    display: block !important;
  }

  .finding-body {
    display: block !important;
  }

  .finding-chevron {
    display: none !important;
  }

  .risk-tabs {
    display: none;
  }

  .findings-list {
    display: block;
  }

  .risk-donut,
  .confidence-ring {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .risk-pill,
  .chip,
  .level-filter,
  .badge,
  .verdict-eyebrow {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  a {
    color: #111;
    text-decoration: none;
  }

  .evidence-link {
    color: #0d5f7b;
  }

  .coverage-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .data-table {
    font-size: 8.5pt;
  }

  .report-card .card-header,
  .card-header {
    break-after: avoid;
  }

  .app-shell,
  .report-layout {
    display: block;
  }

  .report-layout > * {
    margin-bottom: 10px;
  }
}

/* ==========================================================================
   经营导向与克制的视觉口径：大容器不使用风险色描边
   ========================================================================== */

:where(.card, .stat-card, .report-identity, .verdict-card, .verdict-action,
       .finding, .quick-card, .monitor-group-card, .integration-card,
       .notice-card, .result-card) {
  border-color: var(--line) !important;
}

.verdict-card {
  border-top-width: 1px;
}

.verdict-action {
  border-left-width: 1px;
  border-radius: 7px;
}

.finding.level-high,
.finding.level-suspected,
.finding.level-minor,
.finding.level-clear {
  border-left-width: 1px;
}

.basic-details {
  margin: 0 20px;
  border-top: 1px solid var(--line);
}

.basic-details:last-child {
  padding-bottom: 16px;
}

.basic-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
  font-size: 11.5px;
  font-weight: 600;
}

.basic-details > summary::-webkit-details-marker {
  display: none;
}

.basic-details > summary::after {
  content: "+";
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.basic-details[open] > summary::after {
  content: "−";
}

.basic-details > summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.basic-details > p {
  padding: 0 0 14px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.8;
}

.basic-details .change-list {
  padding-bottom: 12px;
}

.operating-loop {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  flex-wrap: wrap;
}

.operating-loop strong {
  color: var(--text-2);
  font-weight: 600;
  margin-right: 6px;
}

.operating-loop i {
  color: var(--faint);
  font-style: normal;
}

.decision-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 20px 12px;
}

.decision-metrics > div {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.decision-metrics span,
.decision-metrics strong {
  display: block;
}

.decision-metrics span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.decision-metrics strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
  font-weight: 620;
}

.model-explainer {
  margin: 0 20px 14px;
  padding: 10px 12px;
  color: var(--text-2);
  background: var(--surface-soft);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.75;
}

.improvement-list {
  padding: 0 20px 18px;
}

.improvement-item {
  display: flex;
  gap: 13px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.improvement-number {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 650;
}

.improvement-content h3 {
  color: var(--text);
  font-size: 13px;
  font-weight: 620;
}

.improvement-content p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.improvement-content ol {
  margin: 9px 0 0 18px;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.85;
}

.coverage-bar .not-listed {
  background: #d8dde2;
}

.coverage-legend.not-listed,
.coverage-item.not_listed {
  color: var(--muted);
}

.coverage-item.not_listed .coverage-status-dot {
  background: #c5ccd3;
}

.coverage-neutral-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

@media (max-width: 640px) {
  .decision-metrics {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .decision-metrics > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
  }

  .decision-metrics strong {
    margin-top: 0;
  }

  .operating-loop {
    gap: 6px;
  }
}

/* 风险事件与双模型状态 */
.finding .finding-level-mark {
  background: var(--line-strong) !important;
}

.model-run-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 10px 20px 0;
  color: var(--muted);
  font-size: 10.5px;
}

.report-grid-2.equal {
  align-items: stretch;
}

.report-grid-2.equal > .card,
.report-grid-2.equal > .side-stack,
.report-grid-2.equal > .side-stack > .card {
  height: 100%;
}

.event-timeline {
  margin: 14px 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.event-timeline > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text-2);
  font-size: 11px;
}

.event-timeline-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  padding: 5px 0;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.6;
}

.event-timeline-item time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .event-timeline-item {
    grid-template-columns: 1fr;
    gap: 1px;
  }
}

/* 组织、接收规则与可追踪监控 */
.schedule-day-checks,
.recipient-checks,
.user-group-stats,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  color: var(--text-2);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
}

.check-pill:has(input:checked) {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.recipient-checks {
  display: grid;
  max-height: 150px;
  padding: 8px;
  overflow-y: auto;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.recipient-checks.is-large { max-height: 220px; }
.recipient-checks label { font-size: 11px; line-height: 1.7; cursor: pointer; }
.recipient-checks input { margin-right: 7px; accent-color: var(--primary); }

.schedule-recipients {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 20px 12px;
  color: var(--muted);
  font-size: 11px;
}
.schedule-recipients svg { width: 14px; height: 14px; }

.monitor-run-history { margin: 0 20px 14px; border-top: 1px solid var(--line); }
.monitor-run-history > summary { padding: 11px 0; color: var(--text-2); cursor: pointer; font-size: 11.5px; font-weight: 600; }
.monitor-run-history > summary span { margin-left: 5px; color: var(--muted); font-weight: 400; }
.monitor-run-history .entity-table-wrap { margin-bottom: 10px; }
.monitor-history-empty { margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.danger-text { color: var(--high-text) !important; }
.table-actions { align-items: center; white-space: nowrap; }
.user-actions-cell { text-align: right; vertical-align: middle !important; }
.user-actions-cell .table-actions { min-height: 22px; flex-wrap: nowrap; justify-content: flex-end; }
.delivery-error { display: flex; gap: 5px; margin-top: 7px; color: var(--high-text); font-size: 10.5px; }
.delivery-error svg { width: 13px; height: 13px; flex: 0 0 13px; }

.user-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
}
.user-group-card { padding: 18px; }
.user-group-stats { margin: 14px 0; }
.user-group-members { padding: 12px; background: var(--surface-soft); border-radius: var(--radius-sm); }
.user-group-members strong { color: var(--text-2); font-size: 11.5px; }
.user-group-members p { margin: 7px 0; color: var(--muted); font-size: 11px; line-height: 1.7; }

@media (max-width: 720px) {
  .schedule-recipients { align-items: flex-start; }
  .user-group-grid { grid-template-columns: 1fr; }
}
