﻿:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  color: #202733;
  background: #f5f7fa;
  --ink: #202733;
  --muted: #667085;
  --panel: #ffffff;
  --soft: #f8fafc;
  --line: #d9e2ec;
  --rail: #171b22;
  --rail-soft: #222832;
  --accent: #116b5f;
  --accent-soft: #e2f4ef;
  --warn: #b54708;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 247, 250, 0.98)),
    repeating-linear-gradient(90deg, rgba(32, 39, 51, 0.035) 0 1px, transparent 1px 96px);
}

button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100dvh;
}

.side-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100dvh;
  padding: 22px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, #151920, #1b2029 58%, #11151b),
    var(--rail);
  color: #f7fafc;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-block .eyebrow {
  color: #87d4c4;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.15;
}

.side-section {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.side-label,
.subtle {
  display: block;
  color: #aeb8c8;
  font-size: 0.84rem;
}

.side-label {
  margin-bottom: 9px;
}

.side-section strong {
  display: block;
  margin-bottom: 6px;
  line-height: 1.35;
}

.connector-list {
  display: grid;
  gap: 8px;
}

.connector-list span {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #d6dee9;
  font-size: 0.86rem;
}

.connector-list span::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 999px;
  background: #87d4c4;
}

.workspace {
  min-width: 0;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.workspace-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
}

.workspace-header h2 {
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.chip,
.primary-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: #344054;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 120ms ease;
}

.chip:active,
.primary-button:active {
  transform: translateY(1px);
}

.chip {
  padding: 0 12px;
}

.chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.primary-button {
  padding: 0 14px;
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.secondary-button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: #344054;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.business-locked {
  cursor: not-allowed;
  opacity: 0.58;
  filter: grayscale(0.15);
}

.business-locked:active {
  transform: none;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 16px 42px rgba(32, 39, 51, 0.055);
}

.metric-card {
  min-height: 112px;
  padding: 14px;
  border-top: 3px solid rgba(17, 107, 95, 0.28);
}

.metric-card span,
.metric-card p,
.section-head p,
td span,
.empty-state {
  color: var(--muted);
  font-size: 0.84rem;
}

.metric-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 1.85rem;
  line-height: 1;
}

.metric-card p {
  margin-bottom: 0;
  line-height: 1.45;
}

.panel {
  overflow: hidden;
  margin-top: 14px;
}

.data-panel {
  overflow: visible;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
}

.section-head h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.source-heading-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-width: 0;
}

.source-heading-row h3 {
  margin: 0;
}

.source-sync-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
}

.source-sync-meta strong {
  color: #4f5f73;
  font-size: inherit;
  font-weight: 750;
}

.section-head p {
  margin-top: 6px;
  margin-bottom: 0;
  line-height: 1.45;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill.ok {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill.warn {
  background: #fff4e5;
  color: var(--warn);
}

.table-wrap {
  overflow-x: auto;
}

.import-box {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
}

.import-box textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
}

.import-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.source-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 12px 16px 16px;
}

.source-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.interface-status-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.interface-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(201, 216, 230, 0.92);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(31, 44, 60, 0.05);
}

.interface-status span,
.interface-status strong,
.interface-status em {
  display: block;
}

.interface-status strong {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 0.9rem;
}

.interface-status em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.interface-status input {
  width: 38px;
  height: 22px;
  accent-color: var(--accent);
  cursor: pointer;
}

.interface-status.is-disabled {
  opacity: 0.62;
}

.interface-status input:disabled {
  cursor: not-allowed;
}

.interface-status.ok {
  border-color: rgba(93, 185, 151, 0.5);
  background: #f3fbf7;
}

.interface-status.warn {
  border-color: rgba(229, 174, 76, 0.48);
  background: #fffaf0;
}

.interface-status.off {
  border-color: rgba(201, 216, 230, 0.85);
  background: #f8fafc;
}

.account-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.permission-modal[hidden] {
  display: none;
}

.permission-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.permission-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.38);
  backdrop-filter: blur(2px);
}

.permission-modal__panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  width: min(360px, 100%);
  padding: 22px;
  border: 1px solid rgba(201, 216, 230, 0.95);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(31, 44, 60, 0.22);
  text-align: center;
}

.permission-modal__panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
}

.permission-modal__actions {
  display: flex;
  justify-content: center;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
  line-height: 1.5;
}

th {
  background: var(--soft);
  color: #475467;
  font-size: 0.78rem;
  white-space: nowrap;
}

td strong,
td span {
  display: block;
}

.company-link {
  display: inline-grid;
  gap: 2px;
  color: var(--ink);
}

.company-link strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(17, 107, 95, 0.25);
  text-underline-offset: 3px;
}

.company-link strong::after {
  content: "↗";
  color: #5d6b7a;
  font-size: 0.72rem;
  font-weight: 900;
}

.company-link:hover strong {
  color: #0b4f46;
  text-decoration-color: currentColor;
}

.company-link.compact {
  display: inline-flex;
}

tbody tr {
  background: #ffffff;
}

tbody tr:hover {
  background: #fbfdfc;
}

td:first-child {
  width: 170px;
}

td:nth-child(2) {
  width: 150px;
}

td:nth-child(3),
td:nth-child(4),
td:nth-child(5) {
  width: 118px;
}

td:nth-child(6) {
  width: 248px;
}

td:nth-child(7) {
  width: 124px;
}

.reply-policy {
  display: grid;
  gap: 7px;
}

.reply-policy span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid #cfe8df;
  border-radius: 6px;
  background: #f0faf6;
  color: #166353;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.jd-cell {
  color: #344054;
  min-width: 260px;
}

.manual-actions {
  display: grid;
  gap: 7px;
}

.manual-actions button {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.manual-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  gap: 14px;
}

.insight-grid.single {
  grid-template-columns: 1fr;
}

.timeline,
.timeline-row,
.empty-state {
  background: #ffffff;
}

.timeline-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.timeline-row strong {
  display: block;
  margin-bottom: 4px;
}

.timeline-row span,
.timeline-row time {
  color: var(--muted);
  font-size: 0.84rem;
}

.empty-state {
  margin: 0;
  padding: 16px;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-rail {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .brand-block {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .metrics-grid,
  .insight-grid,
  .source-box {
    grid-template-columns: 1fr;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .side-rail,
  .workspace {
    padding: 14px;
  }

  .side-rail,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .workspace-header h2 {
    font-size: 1.5rem;
  }

  .section-head,
  .timeline-row {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

.job-sections {
  display: grid;
  gap: 14px;
}

.mode-panel {
  border-color: #c9dde8;
}

.mode-controls,
.sub-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.mode-controls label,
.sub-switches label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.mode-controls input {
  accent-color: var(--accent);
}

.sub-switches {
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.message-ops {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 16px 16px;
  padding: 12px;
  border: 1px solid rgba(201, 216, 230, 0.95);
  border-radius: var(--radius);
  background: #f8fafc;
}

.message-ops strong,
.message-ops span,
.message-ops small {
  display: block;
}

.message-ops strong {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 0.94rem;
}

.message-ops span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.message-ops small {
  margin-top: 5px;
  color: #667085;
  font-size: 0.78rem;
  line-height: 1.4;
}

.message-ops-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.panel-tools {
  display: grid;
  grid-template-columns: minmax(240px, 320px) auto auto auto;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  align-self: center;
}

.compact-tools {
  min-width: fit-content;
}

.panel-tools:not(:has(.panel-action-menu)) {
  grid-template-columns: minmax(240px, 320px) auto auto;
}

.panel-tools button,
.job-actions button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 850;
  line-height: 1.2;
}

.panel-tools button:hover,
.job-actions button:hover,
.button-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.source-tools,
.source-tools.panel-tools,
.source-tools.panel-tools:not(:has(.panel-action-menu)) {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: fit-content;
}

.source-tools .source-action-button {
  display: inline-flex;
  min-width: 96px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 120ms ease;
}

.source-tools .source-action-button:hover {
  border-color: #0e5f54;
  background: #0e5f54;
  color: #ffffff;
}

.source-tools .source-action-button:active {
  transform: translateY(1px);
}

.source-tools .source-action-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.panel-search {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.panel-action-menu {
  position: relative;
  min-height: 34px;
  min-width: 98px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 850;
  line-height: 1.2;
}

.panel-action-menu summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 26px 7px 10px;
  list-style: none;
}

.panel-action-menu summary::-webkit-details-marker {
  display: none;
}

.panel-action-menu summary::after {
  content: "";
  position: absolute;
  right: 10px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #667085;
}

.panel-action-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 12;
  display: grid;
  min-width: 112px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(31, 44, 60, 0.14);
}

.panel-action-options button {
  justify-content: flex-start;
  min-height: 30px;
  border: 0;
  background: transparent;
}

.panel-action-options button[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.panel-count {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.panel-collapse-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
  cursor: pointer;
}

.panel-collapse-toggle::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(2px) rotate(225deg);
  transition: transform 160ms ease;
}

.panel-collapse-toggle[data-collapsed="true"]::before {
  transform: translateY(-2px) rotate(45deg);
}

.panel-collapse-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.panel-search:focus,
.panel-action-menu:focus-within,
.panel-collapse-toggle:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgba(17, 107, 95, 0.12);
}

.panel-body {
  display: grid;
  gap: 10px;
}

.panel-body.collapsed {
  display: none;
}

.job-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.job-card.closed {
  background: #fffaf5;
  border-color: #fed7aa;
}

.job-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.job-main > strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.job-main span,
.job-main p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.job-main p {
  margin: 0;
}

.communication-footnote {
  color: #8a98a8;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
}

.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.status-pill.warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: var(--warn);
}

.data-panel .empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

@media (max-width: 760px) {
  .panel-tools,
  .compact-tools,
  .job-card,
  .job-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .panel-tools,
  .job-actions {
    width: 100%;
  }

  .panel-search,
  .panel-action-menu,
  .panel-tools button,
  .job-actions button,
  .button-link {
    width: 100%;
  }

  .panel-tools .panel-collapse-toggle {
    width: 34px;
    min-width: 34px;
  }

  .sub-switches {
    width: 100%;
    padding-left: 0;
    border-left: 0;
  }

  .message-ops {
    align-items: stretch;
    flex-direction: column;
    width: auto;
  }

  .message-ops-actions {
    flex-direction: row;
    justify-content: flex-start;
    width: auto;
  }

  .message-ops-actions button {
    width: auto;
  }

  .mode-controls label,
  .sub-switches label {
    width: 100%;
  }
}

body {
  background: #f7f9fb;
}

.app-shell {
  grid-template-columns: minmax(0, 1fr);
}

.side-rail {
  display: none;
}

.workspace {
  width: min(1488px, 100%);
  padding: 28px;
}

.workspace-header {
  align-items: center;
  padding: 22px 0;
  margin-bottom: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-header .eyebrow {
  margin-bottom: 6px;
  color: #6b778c;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: none;
}

.workspace-header h2 {
  color: #1f2937;
  font-size: 1.72rem;
  font-weight: 900;
}

.toolbar {
  gap: 10px;
}

.workspace-header .primary-button {
  display: none;
}

.chip {
  min-height: 38px;
  padding: 0 16px;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
  color: #5d6b82;
  font-size: 0.92rem;
  font-weight: 850;
}

.chip:hover {
  background: #f2f6fa;
  color: #233044;
}

.chip.active {
  border-color: transparent;
  background: #eef7f4;
  color: #116b5f;
}

.metrics-grid {
  display: block;
  margin-bottom: 20px;
}

.workspace > .panel + .metrics-grid {
  margin-top: 20px;
}

.metric-feature-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.metric-detail-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric-feature-card,
.metric-card-compact {
  display: grid;
  place-items: center;
  min-height: 136px;
  border: 1px solid rgba(201, 216, 230, 0.95);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 18px 52px rgba(31, 44, 60, 0.07);
}

.metric-feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #1f2937;
  text-align: center;
}

.metric-feature-card.mint {
  background: linear-gradient(135deg, #dff7ed, #c7efdf);
}

.metric-feature-card.blue {
  background: linear-gradient(135deg, #e1efff, #c8e0ff);
}

.metric-feature-card span {
  color: #3f556a;
  font-size: 1.05rem;
  font-weight: 900;
}

.metric-feature-card strong {
  font-size: 3rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.job-card[hidden],
.panel-filter-empty[hidden] {
  display: none !important;
}

.metric-card-compact {
  min-height: 128px;
  padding: 18px;
  border-top: 1px solid rgba(201, 216, 230, 0.95);
  background: #ffffff;
  text-align: center;
}

.metric-card-compact span {
  color: #64748b;
  font-size: 0.94rem;
  font-weight: 800;
}

.metric-card-compact strong {
  margin: 10px 0 0;
  color: #1f2937;
  font-size: 1.75rem;
  font-weight: 950;
}

.filter-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 14px 16px 16px;
  border-top: 1px solid #edf2f7;
  background: #ffffff;
}

.filter-rules strong,
.filter-rules span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  line-height: 1;
}

.filter-rules strong {
  padding-left: 0;
  color: #1f2937;
  font-weight: 900;
}

.filter-rules span {
  border: 1px solid #e3ebf2;
  background: #f8fafc;
  color: #64748b;
  font-weight: 800;
}

.job-filter-bar {
  padding: 12px;
  border-top: 1px solid #edf2f7;
  background: #eaf5f7;
}

.filter-title {
  margin-bottom: 10px;
  color: #1f2937;
  font-size: 0.95rem;
  font-weight: 950;
}

.filter-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-field {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  min-height: 40px;
  padding: 0 5px;
  border-radius: 7px;
  background: #ffffff;
}

.filter-label,
.filter-field > span {
  display: none;
}

.filter-field input,
.filter-field select {
  width: auto;
  min-width: 82px;
  min-height: 32px;
  padding: 0 14px 0 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1f2937;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 400;
}

.filter-field input::placeholder {
  color: #667085;
  font-size: 0.86rem;
  font-weight: 400;
}

.filter-field:has([name="cityMode"]) select {
  max-width: 58px;
}

.filter-field:has([name="published"]) input {
  max-width: 70px;
}

.filter-field:has([name="monthlyMin"]) input,
.filter-field:has([name="annualMin"]) input {
  max-width: 88px;
}

.filter-field:has([name="funding"]) select {
  max-width: 92px;
}

.filter-field:has([name="companySize"]) select {
  max-width: 104px;
}

.operator-field select {
  min-width: 44px;
  max-width: 48px;
}

.filter-field input:focus,
.filter-field select:focus {
  outline: 2px solid rgba(17, 107, 95, 0.14);
}

.filter-field input:disabled {
  color: #475467;
}

.filter-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  min-height: 38px;
}

.filter-actions .primary-button,
.filter-actions .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.82rem;
  text-align: center;
  white-space: nowrap;
}

.filter-actions .visible-primary {
  display: inline-flex;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid #d7e2ec;
  border-radius: 10px;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 18px 52px rgba(31, 44, 60, 0.16);
  font-weight: 850;
}

@media (max-width: 1280px) {
  .filter-grid {
    flex-wrap: nowrap;
  }

  .filter-actions {
    width: auto;
    margin-left: auto;
  }
}

@media (max-width: 760px) {
  .filter-grid {
    flex-wrap: nowrap;
  }

  .filter-field,
  .filter-actions {
    width: auto;
  }

  .filter-actions {
    margin-left: auto;
  }

  .interface-status-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 980px) {
  .metric-feature-row,
  .metric-detail-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .workspace {
    padding: 14px;
  }

  .workspace-header {
    align-items: flex-start;
    padding: 18px 0;
  }

  .metric-feature-row,
  .metric-detail-row {
    grid-template-columns: 1fr;
  }
}

/* Mobile H5 overrides: keep desktop rules untouched above 760px. */
@media (max-width: 760px) {
  html {
    font-size: clamp(14px, 4vw, 16px);
  }

  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .app-shell,
  .workspace,
  .panel,
  .section-head,
  .section-head > div {
    min-width: 0;
    max-width: 100%;
  }

  .workspace {
    width: 100%;
    padding: clamp(0.75rem, 3.75vw, 1rem);
  }

  .workspace-header {
    gap: 1rem;
    padding: 1rem 0;
    border-radius: 0.75rem;
  }

  .workspace-header h2 {
    font-size: clamp(1.35rem, 6vw, 1.65rem);
    overflow-wrap: anywhere;
  }

  .toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 0.375rem;
  }

  .chip {
    min-width: 0;
    padding: 0 0.35rem;
  }

  .metric-feature-row,
  .metric-detail-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .metric-feature-card,
  .metric-card-compact {
    min-width: 0;
    min-height: 7.25rem;
    padding: 0.875rem;
    border-radius: 0.75rem;
  }

  .metric-feature-card strong {
    font-size: clamp(2.1rem, 11vw, 2.75rem);
  }

  .section-head {
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem;
  }

  .section-head h3,
  .section-head p,
  .source-sync-meta,
  .job-main > strong,
  .job-main span,
  .job-main p,
  .communication-footnote {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .panel-tools,
  .compact-tools,
  .panel-tools:not(:has(.panel-action-menu)) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    width: 100%;
    min-width: 0;
    gap: 0.5rem;
  }

  .source-tools,
  .source-tools.panel-tools,
  .source-tools.panel-tools:not(:has(.panel-action-menu)) {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
  }

  .source-tools .source-action-button {
    flex: 1 1 8rem;
    min-width: 0;
  }

  .panel-tools:has(.panel-action-menu) {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .panel-tools:has(.panel-action-menu) .panel-search {
    grid-column: 1 / -1;
  }

  .panel-action-menu {
    min-width: 0;
    width: 100%;
  }

  .panel-action-options {
    max-width: calc(100vw - 2rem);
  }

  .panel-search,
  .panel-tools button {
    min-width: 0;
  }

  .job-filter-bar {
    padding: 0.75rem;
  }

  .filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .filter-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    padding: 0.35rem 0.5rem;
  }

  .filter-field input,
  .filter-field select {
    width: 100%;
    min-width: 0;
    max-width: none !important;
    min-height: 2.125rem;
    padding-right: 1rem;
  }

  .filter-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    margin-left: 0;
    gap: 0.5rem;
  }

  .filter-actions .primary-button,
  .filter-actions .secondary-button {
    width: 100%;
    min-width: 0;
  }

  .interface-status-grid,
  .source-box {
    grid-template-columns: minmax(0, 1fr);
  }

  .source-heading-row {
    gap: 0.35rem 0.65rem;
  }

  .source-sync-meta {
    font-size: 0.78rem;
  }

  .interface-status {
    min-width: 0;
  }

  .message-ops-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    white-space: normal;
  }

  .message-ops-actions button {
    width: 100%;
    min-width: 0;
  }

  .job-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .company-link,
  .company-link strong {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .job-actions {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-self: start;
    justify-content: flex-start;
    width: auto;
  }

  .job-actions button,
  .button-link {
    width: auto;
    min-width: 5.25rem;
    flex: 0 0 auto;
    white-space: nowrap;
    overflow-wrap: normal;
  }
}

@media (max-width: 360px) {
  .filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .message-ops-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-header {
    padding: 0.875rem 0;
  }
}
