:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #eef4f2;
  --ink: #17201c;
  --muted: #66716d;
  --line: #dce3df;
  --teal: #0b7a75;
  --blue: #315fbb;
  --amber: #b8690b;
  --red: #b33636;
  --green: #177245;
  --shadow: 0 12px 32px rgba(27, 36, 32, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button {
  font: inherit;
}

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

.side {
  background: #18211d;
  color: #eef4f2;
  padding: 22px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 24px;
}

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

.brand span {
  color: #afc3bc;
  font-size: 12px;
  margin-top: 3px;
}

.mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: #d6f0e7;
  color: #18211d;
  font-weight: 800;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #cbd8d3;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.main {
  min-width: 0;
  padding: 24px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
}

.topbar p {
  color: var(--muted);
  margin-top: 7px;
  font-size: 13px;
}

.actions,
.job-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.primary-btn,
.icon-btn,
.text-btn,
.danger-btn,
.job-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.icon-btn {
  width: 38px;
  font-size: 18px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--teal);
  padding: 0;
}

.danger-btn {
  padding: 0 12px;
  border-color: #f1c4c4;
  background: #fff7f7;
  color: var(--red);
}

.danger-btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.job-actions button {
  padding: 0 12px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

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

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 126px;
  padding: 18px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 12px 0 9px;
  font-size: 34px;
  line-height: 1;
}

.metric-mini-line {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  padding: 16px;
}

.view > .panel + .panel {
  margin-top: 14px;
}

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

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

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

.bar-row {
  display: grid;
  grid-template-columns: 82px 1fr 42px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--teal);
}

.bar-fill.watch {
  background: var(--blue);
}

.bar-fill.warning {
  background: var(--amber);
}

.bar-fill.critical {
  background: var(--red);
}

.event-list,
.job-list {
  display: grid;
  gap: 10px;
}

.event-list.large,
.job-list.large {
  max-height: none;
}

.event,
.job {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.active-job {
  border-color: #bdd8d5;
  background: #f8fcfb;
}

.job-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.event strong,
.job strong {
  display: block;
  margin-bottom: 4px;
}

.event span,
.job span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pill.healthy,
.pill.success,
.pill.commented {
  background: #dff4e8;
  color: var(--green);
}

.pill.watch,
.pill.running,
.pill.stopping,
.pill.comment_skipped,
.pill.filtered_out {
  background: #e5edff;
  color: var(--blue);
}

.pill.stopped {
  background: #eef1f0;
  color: var(--muted);
}

.pill.warning {
  background: #fff2d8;
  color: var(--amber);
}

.pill.critical,
.pill.failed,
.pill.comment_failed,
.pill.search_failed {
  background: #ffe2e2;
  color: var(--red);
}

.pill.ok,
.pill.opened {
  background: #dff4e8;
  color: var(--green);
}

.pill.profile_unreadable,
.pill.not_logged_in,
.pill.app_not_installed,
.pill.app_update_prompt,
.pill.credential_prompt,
.pill.account_risk,
.pill.launch_failed,
.pill.device_missing_ip {
  background: #fff2d8;
  color: var(--amber);
}

.pill.account_risk,
.pill.launch_failed {
  background: #ffe2e2;
  color: var(--red);
}

.table-wrap {
  overflow-x: auto;
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 12px;
}

.platform-tools {
  margin-bottom: 10px;
}

.search-input {
  width: min(420px, 100%);
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  outline: none;
}

.search-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(11, 122, 117, 0.12);
}

.pager-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.pager-controls button,
.pager-controls select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.pager-controls button {
  padding: 0 10px;
}

.pager-controls select {
  padding: 0 8px;
}

.table-pager {
  margin-top: 10px;
}

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 13px;
}

.bulk-bar select,
.bulk-bar button,
.project-form input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.bulk-bar select,
.project-form input {
  padding: 0 10px;
}

.bulk-bar button {
  padding: 0 12px;
  cursor: pointer;
}

.bulk-bar button:disabled,
.pager-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.checkbox-cell {
  width: 42px;
  text-align: center;
}

.checkbox-cell input {
  width: 16px;
  height: 16px;
}

.project-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(130px, 0.9fr) minmax(130px, 0.8fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.project-layout {
  grid-template-columns: minmax(620px, 1.35fr) minmax(360px, 0.85fr);
  align-items: start;
}

.project-layout .panel {
  min-width: 0;
}

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

.project-layout .panel-head h2 {
  flex: 0 0 auto;
  white-space: nowrap;
}

.project-layout > .panel:last-child .panel-head {
  align-items: stretch;
  flex-direction: column;
}

.project-layout > .panel:last-child .pager-controls {
  justify-content: flex-start;
  margin-left: 0;
}

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

.project-metrics .metric {
  min-height: 112px;
  padding: 16px;
}

.project-metrics .metric strong {
  font-size: 30px;
}

.project-table {
  min-width: 0;
  table-layout: fixed;
}

.project-table th,
.project-table td {
  padding: 11px 8px;
}

.project-table th:nth-child(1),
.project-table td:nth-child(1) {
  width: 21%;
}

.project-table th:nth-child(2),
.project-table td:nth-child(2) {
  width: 25%;
}

.project-table th:nth-child(3),
.project-table td:nth-child(3) {
  width: 15%;
}

.project-table th:nth-child(4),
.project-table td:nth-child(4) {
  width: 56px;
}

.project-table th:nth-child(5),
.project-table td:nth-child(5) {
  width: 58px;
}

.project-table th:nth-child(6),
.project-table td:nth-child(6) {
  width: 116px;
}

.project-table .account-name,
.project-table .compact-text {
  max-width: 100%;
}

.table-action {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.table-action.danger-btn {
  border-color: #f1c4c4;
  background: #fff7f7;
  color: var(--red);
}

.project-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.project-name-text {
  max-width: 150px;
}

.project-id-text {
  display: block;
  max-width: 100%;
  margin-top: 4px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab {
  display: inline-flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
  min-width: 112px;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.tab span {
  font-weight: 700;
  line-height: 1.2;
}

.tab small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.tab.active {
  border-color: var(--teal);
  background: #e7f4f1;
  color: var(--teal);
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

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

td {
  vertical-align: middle;
}

a {
  color: var(--teal);
}

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

.truncate {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.account-name {
  max-width: 210px;
}

.profile-link {
  max-width: 260px;
}

.compact-text {
  max-width: 120px;
}

.reason-text {
  max-width: 220px;
}

.outreach-runs-table {
  min-width: 1180px;
  table-layout: fixed;
}

.outreach-runs-table th,
.outreach-runs-table td {
  height: 46px;
  padding-top: 0;
  padding-bottom: 0;
  white-space: nowrap;
}

.outreach-runs-table th:nth-child(1),
.outreach-runs-table td:nth-child(1) {
  width: 76px;
}

.outreach-runs-table th:nth-child(2),
.outreach-runs-table td:nth-child(2) {
  width: 112px;
}

.outreach-runs-table th:nth-child(3),
.outreach-runs-table td:nth-child(3) {
  width: 118px;
}

.outreach-runs-table th:nth-child(4),
.outreach-runs-table td:nth-child(4) {
  width: 86px;
}

.outreach-runs-table th:nth-child(5),
.outreach-runs-table td:nth-child(5) {
  width: 180px;
}

.outreach-runs-table th:nth-child(6),
.outreach-runs-table td:nth-child(6) {
  width: 120px;
}

.outreach-runs-table th:nth-child(7),
.outreach-runs-table td:nth-child(7) {
  width: 180px;
}

.outreach-runs-table th:nth-child(8),
.outreach-runs-table td:nth-child(8) {
  width: 96px;
}

.outreach-runs-table th:nth-child(9),
.outreach-runs-table td:nth-child(9) {
  width: 220px;
}

.outreach-runs-table th:nth-child(10),
.outreach-runs-table td:nth-child(10) {
  width: 150px;
}

.outreach-runs-table .profile-link,
.outreach-runs-table .compact-text,
.outreach-runs-table .reason-text {
  max-width: 100%;
}

.outreach-runs-table .placeholder-row td {
  color: transparent;
}

.schedule {
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.section-label {
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.analytics-panel {
  overflow: hidden;
}

.analytics-head {
  align-items: flex-start;
  background: #fbfcfb;
}

.analytics-head p {
  color: var(--muted);
  font-size: 13px;
  margin: 5px 0 0;
}

.analytics-overview-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.analytics-kpi {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 18px 20px;
}

.analytics-kpi span,
.analytics-diagnostic span {
  color: var(--muted);
  font-size: 13px;
}

.analytics-kpi strong {
  color: var(--ink);
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
}

.analytics-kpi small,
.analytics-diagnostic small {
  color: var(--muted);
  line-height: 1.45;
}

.analytics-panel .job-actions {
  justify-content: flex-end;
}

.analytics-panel .job-actions button {
  min-height: 34px;
  border-color: #d6e2dd;
  background: #ffffff;
  color: #24332e;
}

.analytics-panel .job-actions .primary-btn {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

#trendCanvas {
  display: block;
  width: 100%;
  height: 320px;
  background: #ffffff;
}

.analytics-controls {
  align-items: center;
  background: #f8fbf9;
  border: 1px solid #dfe8e3;
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(136px, 0.9fr) 128px 112px auto minmax(170px, 1fr);
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px;
}

.analytics-controls select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.analytics-controls select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(11, 122, 117, 0.12);
  outline: 0;
}

.analytics-controls .primary-btn {
  min-height: 38px;
  justify-content: center;
}

.analytics-controls .muted {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 10px;
  border-left: 1px solid #dfe8e3;
  font-size: 13px;
  white-space: nowrap;
}

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

.analytics-diagnostic {
  background: #fbfcfb;
  border: 1px solid #dfe8e3;
  border-radius: 8px;
  display: grid;
  gap: 7px;
  min-height: 142px;
  padding: 14px;
}

.analytics-diagnostic strong {
  color: var(--ink);
  font-size: 18px;
}

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

.platform-card {
  background: #ffffff;
  border: 1px solid #dfe8e3;
  border-top: 4px solid #64748b;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  min-height: 320px;
  padding: 14px;
}

.platform-tiktok {
  border-top-color: #0f766e;
}

.platform-instagram {
  border-top-color: #c13584;
}

.platform-facebook {
  border-top-color: #2563eb;
}

.platform-x {
  border-top-color: #111827;
}

.platform-card-head {
  align-items: start;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.platform-card-head span,
.platform-card-head small,
.platform-metric span,
.platform-metric small,
.platform-note,
.platform-actions {
  color: var(--muted);
}

.platform-card-head strong {
  color: var(--ink);
  display: block;
  font-size: 20px;
  margin-top: 4px;
}

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

.platform-metric-group {
  display: grid;
  gap: 8px;
}

.platform-metric-group h3 {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  margin: 0;
}

.platform-metric {
  background: #f8fbf9;
  border: 1px solid #e4ece8;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 10px;
}

.platform-metric strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.platform-metric span,
.platform-metric small {
  font-size: 12px;
}

.platform-empty {
  align-items: center;
  background: #fbfcfb;
  border: 1px dashed #d6e2dd;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  grid-column: 1 / -1;
  min-height: 92px;
  padding: 12px;
}

.platform-note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
  padding: 8px 10px;
}

.platform-actions {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.platform-actions li {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.platform-actions li span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-chip-row,
.analytics-platforms {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.analytics-chip {
  align-items: center;
  background: #eef6f3;
  border: 1px solid #d6e2dd;
  border-radius: 999px;
  color: #24332e;
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  min-height: 24px;
  padding: 0 9px;
}

.analytics-chip.warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.analytics-chip.bad {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.analytics-performance-grid {
  margin: 0 0 12px;
}

.analytics-content-panel[hidden] {
  display: none;
}

.analytics-content-head {
  align-items: flex-start;
  gap: 12px;
}

.analytics-content-head > div:first-child {
  min-width: 0;
}

.analytics-content-controls {
  flex-wrap: wrap;
}

.analytics-content-controls select {
  min-height: 34px;
  padding: 0 8px;
}

.analytics-content-table {
  table-layout: fixed;
  min-width: 1120px;
}

.analytics-content-table th:nth-child(1),
.analytics-content-table td:nth-child(1) {
  width: 30%;
}

.analytics-content-table th:nth-child(2),
.analytics-content-table td:nth-child(2) {
  width: 16%;
}

.analytics-content-table th:nth-child(3),
.analytics-content-table td:nth-child(3),
.analytics-content-table th:nth-child(4),
.analytics-content-table td:nth-child(4),
.analytics-content-table th:nth-child(5),
.analytics-content-table td:nth-child(5),
.analytics-content-table th:nth-child(6),
.analytics-content-table td:nth-child(6),
.analytics-content-table th:nth-child(7),
.analytics-content-table td:nth-child(7) {
  width: 78px;
}

.analytics-content-table th:nth-child(8),
.analytics-content-table td:nth-child(8),
.analytics-content-table th:nth-child(9),
.analytics-content-table td:nth-child(9) {
  width: 132px;
}

.analytics-content-table .num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.analytics-content-table .analytics-chip {
  margin-right: 6px;
}

.content-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.content-cell strong,
.content-cell small {
  display: block;
}

.content-cell small {
  color: var(--muted);
  font-size: 12px;
}

.text-link {
  font-weight: 700;
}

.analytics-action-panel .panel-head {
  align-items: center;
}

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

.analytics-action-item {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 108px minmax(0, 1fr) 170px;
  min-height: 58px;
  padding: 10px 12px;
}

.analytics-action-item strong,
.analytics-action-item span,
.analytics-action-item small {
  display: block;
}

.analytics-action-item strong {
  color: var(--ink);
  font-size: 14px;
}

.analytics-action-item span,
.analytics-action-item small {
  color: var(--muted);
  font-size: 12px;
}

.analytics-account-picker {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-bottom: 12px;
  max-height: 172px;
  overflow: auto;
}

.analytics-account-tools {
  grid-template-columns: 140px minmax(260px, 1fr) auto auto auto;
}

.analytics-modal-panel {
  width: min(1060px, 100%);
}

.public-collect-panel {
  width: min(560px, calc(100vw - 24px));
}

.public-collect-panel .field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.public-collect-panel select {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
}

.public-collect-summary {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.public-collect-summary strong,
.public-collect-summary span,
.public-collect-summary small {
  display: block;
}

.public-collect-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.analytics-account-list {
  max-height: min(520px, 58vh);
}

.analytics-target-row {
  grid-template-columns: auto 88px minmax(0, 1fr) 128px;
}

.mini-check {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: auto 58px minmax(0, 1fr) 78px;
  min-height: 38px;
  padding: 6px 8px;
}

.mini-check span,
.mini-check small {
  color: var(--muted);
}

.trend-wrap {
  border: 1px solid #dfe8e3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  overflow: hidden;
  position: relative;
}

.trend-tooltip {
  background: rgba(16, 35, 29, 0.96);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(12, 28, 22, 0.22);
  color: #f7fffb;
  display: grid;
  font-size: 12px;
  gap: 5px;
  line-height: 1.42;
  max-width: 300px;
  padding: 10px 12px;
  pointer-events: none;
  position: absolute;
  z-index: 4;
}

.trend-tooltip strong {
  font-size: 12px;
}

.empty {
  min-height: 68px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  min-width: 240px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #18211d;
  color: #ffffff;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 18, 16, 0.46);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(980px, 100%);
  max-height: min(860px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-modal-panel {
  width: min(1320px, calc(100vw - 24px));
  max-height: min(820px, calc(100vh - 20px));
}

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

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: #fbfcfb;
}

.modal-actions button,
.target-tools button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.modal-body {
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding: 16px;
}

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

.project-dialog-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.project-dialog-grid input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
}

.project-dialog-grid input:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.form-grid label:nth-child(2) {
  grid-column: span 2;
}

.form-grid input,
.form-grid textarea,
.target-tools select,
.target-tools input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
}

.form-grid input,
.target-tools select,
.target-tools input {
  min-height: 38px;
  padding: 0 10px;
}

.form-grid textarea {
  resize: vertical;
  padding: 9px 10px;
}

.target-tools {
  display: grid;
  grid-template-columns: 160px minmax(220px, 1fr) auto auto;
  gap: 8px;
  margin: 16px 0 10px;
}

.project-account-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 0;
}

.project-account-column {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
  overflow: hidden;
}

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

.project-account-column-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
}

.project-account-column-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.project-account-column .target-tools {
  margin: 0;
  padding: 10px;
  border: 1px solid #e7eeea;
  border-radius: 8px;
  background: #ffffff;
}

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

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

#projectModalAccountSearch,
#projectModalBoundAccountSearch {
  grid-column: span 2;
}

.project-account-column .target-tools select,
.project-account-column .target-tools input,
.project-account-column .target-tools button {
  min-width: 0;
  min-height: 34px;
  font-size: 13px;
}

.project-account-column .target-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #cbd8d3;
  background: #f6faf8;
}

.project-account-column .target-tools button:hover,
.pager-controls button:hover,
.modal-actions button:not(.primary-btn):not(.danger-btn):not(:disabled):hover {
  border-color: #a9c8bf;
  background: #eef7f3;
}

.project-account-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0;
  min-width: 0;
}

.project-account-toolbar .pager-controls {
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 6px;
}

.project-account-toolbar .pager-controls button,
.project-account-toolbar .pager-controls select {
  min-height: 32px;
  font-size: 12px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.inline-check input {
  width: 16px;
  height: 16px;
}

.outreach-panel {
  gap: 16px;
}

.outreach-platform-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.outreach-platform {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #f8faf9;
  font-size: 13px;
}

.outreach-platform small {
  color: var(--muted);
  font-size: 12px;
}

.outreach-platform.connected {
  border-color: #b7dbc9;
  background: #effaf4;
}

.outreach-platform.pending {
  border-color: #e1e6ea;
  background: #f7f8fa;
  color: #6b7280;
}

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

.outreach-scenario {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.outreach-scenario strong,
.outreach-scenario span {
  display: block;
}

.outreach-scenario strong {
  color: var(--ink);
  font-size: 14px;
}

.outreach-scenario span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.outreach-modal-panel {
  width: min(860px, calc(100vw - 32px));
}

.outreach-base-grid {
  grid-template-columns: minmax(180px, 240px) minmax(260px, 1fr);
  margin-bottom: 8px;
}

.outreach-config-note {
  margin: 6px 0 12px;
  padding: 9px 11px;
  border: 1px solid #d9e7e2;
  border-radius: 8px;
  color: #3f5f56;
  background: #f7fbf9;
  font-size: 12px;
  line-height: 1.45;
}

.outreach-config-group {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e0e9e5;
  border-radius: 8px;
  background: #fbfdfc;
}

.outreach-config-group[hidden] {
  display: none;
}

.outreach-config-group .section-label {
  margin-top: 0;
  margin-bottom: 10px;
}

.outreach-form-grid label.wide {
  grid-column: span 2;
}

.outreach-field[hidden] {
  display: none;
}

.field-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.info-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid #b9c8c3;
  border-radius: 50%;
  color: #45655c;
  background: #f5faf8;
  font-size: 11px;
  line-height: 1;
  cursor: help;
  user-select: none;
}

.outreach-account-tools {
  grid-template-columns: minmax(220px, 1fr) auto auto;
}

.outreach-account-list {
  max-height: 260px;
}

.target-row.outreach-actor-row {
  grid-template-columns: 28px 90px minmax(0, 1fr) 80px 130px;
}

.target-summary {
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
}

.target-list {
  display: grid;
  gap: 6px;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fbfcfb;
}

.target-row {
  display: grid;
  grid-template-columns: 28px 90px 1fr 90px 130px;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #ffffff;
}

.target-row:hover {
  border-color: #d5e6df;
  background: #f8fcfa;
}

.target-row span,
.target-row small {
  min-width: 0;
}

.target-row small {
  color: var(--muted);
}

.project-account-list {
  max-height: min(330px, 38vh);
  background: #ffffff;
}

.project-account-list .target-row {
  grid-template-columns: 24px minmax(64px, 76px) minmax(120px, 1.25fr) minmax(68px, 0.55fr) minmax(92px, 0.7fr);
}

@media (max-width: 1280px) {
  .analytics-platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .side {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 12px;
  }

  .brand {
    padding-bottom: 12px;
  }

  .nav {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    min-width: 94px;
    text-align: center;
  }

  .main {
    padding: 16px;
  }

  .topbar,
  .panel-head,
  .table-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-actions {
    justify-content: flex-start;
  }

  .form-grid,
  .project-dialog-grid,
  .project-account-columns,
  .target-tools,
  .project-account-tools,
  .project-bound-tools,
  .analytics-account-tools,
  .outreach-scenarios,
  .target-row,
  .analytics-target-row,
  .project-account-list .target-row,
  .project-form {
    grid-template-columns: 1fr;
  }

  .outreach-form-grid label.wide {
    grid-column: auto;
  }

  .target-row.outreach-actor-row {
    grid-template-columns: 1fr;
  }

  .project-account-column-head,
  .project-account-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  #projectModalAccountSearch,
  #projectModalBoundAccountSearch {
    grid-column: auto;
  }

  .project-account-column .target-tools button,
  .project-account-toolbar .pager-controls,
  .project-account-toolbar .pager-controls button,
  .project-account-toolbar .pager-controls select {
    width: 100%;
  }

  .bulk-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .analytics-controls {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .analytics-controls select,
  .analytics-controls button {
    width: 100%;
  }

  .analytics-controls .muted {
    width: 100%;
    border-left: 0;
    padding-left: 0;
    white-space: normal;
  }

  .analytics-overview-grid,
  .analytics-diagnostics,
  .analytics-platform-grid,
  .analytics-action-item {
    grid-template-columns: 1fr;
  }

  .mini-check {
    grid-template-columns: auto 52px minmax(0, 1fr);
  }

  .mini-check small {
    grid-column: 3;
  }

  .form-grid label:nth-child(2) {
    grid-column: auto;
  }

  .pager-controls {
    flex-wrap: wrap;
    justify-content: flex-start;
    white-space: normal;
  }

  .project-account-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid,
  .metric-grid.compact,
  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .project-layout {
    grid-template-columns: 1fr;
  }
}
