:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f4f6f8;
  --surface-3: #eef6f5;
  --ink: #101418;
  --muted: #6b7280;
  --soft: #9aa3af;
  --line: #e6e9ee;
  --line-strong: #d8dde5;
  --green: #0f8a6a;
  --green-soft: #e8f6f2;
  --blue: #2563eb;
  --blue-soft: #edf4ff;
  --amber: #a16207;
  --amber-soft: #fff7df;
  --red: #b42318;
  --red-soft: #fff0ed;
  --shadow: 0 14px 35px rgba(16, 24, 40, 0.06);
  --shadow-soft: 0 8px 22px rgba(16, 24, 40, 0.04);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #f6f8fb;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

.login-panel > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.login-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-panel input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  font-size: 15px;
}

.login-error {
  margin: 0;
  color: #b91c1c;
  font-size: 13px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
a {
  font: inherit;
}

button {
  border: 1px solid #111827;
  background: #111827;
  color: #fff;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  cursor: pointer;
}

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

button:hover {
  background: #000;
}

button.ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink);
}

button.ghost:hover {
  background: var(--surface-2);
}

button.danger-lite {
  border-color: #fecaca;
  color: #b91c1c;
}

button.danger-lite:hover {
  background: #fef2f2;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 6px;
}

.brand h1 {
  font-size: 18px;
  margin: 0;
  letter-spacing: 0;
}

.brand p,
.page-header p,
.metric-card span,
.metric-card small,
.muted {
  color: var(--muted);
}

.brand p {
  margin: 3px 0 0;
  font-size: 12px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  min-height: 42px;
  color: #4b5563;
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.nav-item strong {
  font-size: 14px;
  font-weight: 650;
}

.nav-item.active {
  background: var(--surface-3);
  border-color: #cce7df;
  color: #0b4d3e;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-group {
  border-radius: 8px;
}

.nav-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #4b5563;
  cursor: pointer;
  list-style: none;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary strong {
  font-size: 14px;
  font-weight: 650;
}

.nav-group summary span {
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.nav-group[open] summary span {
  transform: rotate(180deg);
}

.nav-group.active summary,
.nav-group summary:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-sub {
  display: grid;
  gap: 3px;
  margin-top: 3px;
  padding-left: 10px;
}

.nav-item.sub {
  min-height: 38px;
  padding-left: 18px;
  border-left: 2px solid var(--line);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.sidebar-note {
  margin-top: auto;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.pulse-dot,
.status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  display: inline-block;
}

.main {
  padding: 30px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  min-height: 78px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--green);
  font-weight: 700;
}

.page-header h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1.18;
}

.page-header p {
  margin: 8px 0 0;
  max-width: 760px;
  line-height: 1.6;
}

.status-pill,
.tag,
.label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.good,
.label.winner,
.label.scaling {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.warn,
.label.testing,
.label.warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.bad,
.label.kill {
  background: var(--red-soft);
  color: var(--red);
}

.tag {
  background: var(--blue-soft);
  color: var(--blue);
}

.hero-band,
.panel,
.metric-card,
.coming-soon,
.empty-state,
.table-wrap,
.timeline-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.hero-band {
  min-height: 142px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.hero-band h3,
.coming-soon h3 {
  margin: 12px 0 8px;
  font-size: 23px;
  letter-spacing: 0;
  line-height: 1.25;
}

.hero-band p,
.coming-soon p,
.body-copy {
  color: var(--muted);
  margin: 0;
  max-width: 720px;
  line-height: 1.7;
}

.mode-chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

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

.metric-card {
  min-height: 122px;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.metric-card strong {
  font-size: 25px;
  letter-spacing: 0;
  line-height: 1.1;
}

.metric-card.positive {
  border-color: #cce7df;
  background: linear-gradient(180deg, #fff, #f5fbf9);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.panel {
  padding: 18px;
}

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

.panel h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.text-link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

.text-link:hover {
  text-decoration: underline;
}

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

.summary-grid div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.mini-feed,
.learning-list {
  display: grid;
  gap: 10px;
}

.mini-feed div,
.learning-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.mini-feed strong,
.learning-list strong {
  display: block;
  margin-bottom: 5px;
}

.mini-feed span,
.learning-list p,
.learning-list small {
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  padding: 16px;
}

.timeline-item time {
  color: var(--muted);
  font-weight: 700;
}

.timeline-item h3 {
  margin: 10px 0 6px;
  font-size: 17px;
  letter-spacing: 0;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

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

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  background: #fbfcfd;
  font-weight: 700;
}

td small {
  color: var(--muted);
}

.reason {
  display: block;
  max-width: 420px;
  line-height: 1.55;
}

.action-buttons,
.mode-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.connect-stack,
.form-grid,
.account-settings {
  display: grid;
  gap: 12px;
}

.form-grid label,
.monitor-field,
.account-settings label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.monitor-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 22px;
}

.monitor-field-head > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #b9ded4;
  border-color: var(--green);
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

.checkbox-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.checkbox-row input {
  min-height: auto;
}

.notice,
.resource-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-2);
}

.notice.good {
  border-color: #cce7df;
  background: var(--green-soft);
  color: #0b4d3e;
}

.notice.warn {
  border-color: #f1d69a;
  background: var(--amber-soft);
  color: var(--amber);
}

.notice.bad {
  border-color: #fac7bd;
  background: var(--red-soft);
  color: var(--red);
}

.notice strong,
.resource-preview strong {
  display: block;
  margin-bottom: 6px;
}

.notice p,
.resource-preview p {
  margin: 0;
  line-height: 1.55;
}

code {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 5px;
}

.account-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.account-row p {
  margin-top: 6px;
}

.account-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.account-bulk-bar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.account-scroll-list {
  max-height: min(640px, 64vh);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.hidden-account-list {
  max-height: min(360px, 42vh);
}

.token-authorization-grid {
  display: grid;
  gap: 8px;
}

.token-authorization-section {
  margin-bottom: 16px;
}

.authorization-guide {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.authorization-guide summary {
  min-height: 58px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.authorization-guide summary::-webkit-details-marker {
  display: none;
}

.authorization-guide summary > span:first-child {
  display: grid;
  gap: 3px;
}

.authorization-guide summary small,
.authorization-guide-body p {
  color: var(--muted);
}

.authorization-guide-action {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.authorization-guide[open] .authorization-guide-action {
  font-size: 0;
}

.authorization-guide[open] .authorization-guide-action::after {
  content: "收起";
  font-size: 13px;
}

.authorization-guide-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.authorization-guide-body section {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.authorization-guide-body h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.authorization-guide-body ol {
  margin: 0;
  padding-left: 20px;
  color: #4b5563;
  line-height: 1.75;
}

.authorization-guide-body > p {
  grid-column: 1 / -1;
  margin: 0;
  line-height: 1.6;
}

.token-authorization-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--surface-2);
}

.token-authorization-strip.good {
  border-color: #b8dfd4;
  border-left-color: #16866d;
  background: var(--green-soft);
}

.token-authorization-strip.warn {
  border-color: #efd18c;
  border-left-color: #b7791f;
  background: var(--amber-soft);
}

.token-authorization-strip.bad {
  border-color: #f2b7ac;
  border-left-color: #c43d2b;
  background: var(--red-soft);
}

.token-authorization-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.token-authorization-summary > span:last-child {
  color: var(--muted);
  font-size: 14px;
}

.token-account-count {
  flex: 0 0 auto;
  text-align: right;
}

.token-authorization-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.token-reauthorize-button {
  min-height: 32px;
  padding: 5px 10px;
  white-space: nowrap;
}

.token-reauthorize-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.token-account-count strong,
.token-account-count span {
  display: block;
  margin: 0;
}

.token-account-count span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 720px) {
  .token-authorization-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .token-account-count {
    text-align: left;
  }

  .token-authorization-actions {
    width: 100%;
    justify-content: space-between;
  }

  .token-reauthorize-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .authorization-guide-body {
    grid-template-columns: 1fr;
  }
}

/* 投放日报 */
.dr-page,
.dr-content {
  display: grid;
  gap: 16px;
}

.dr-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.dr-header h2,
.dr-header p {
  margin: 0;
}

.dr-header h2 {
  font-size: 30px;
}

.dr-header > div > p:last-child {
  margin-top: 8px;
  color: var(--muted);
}

.dr-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  overflow-x: auto;
}

.dr-tabs button {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
}

.dr-tabs button.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: #0b4d3e;
}

.dr-filterbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.dr-summary-grid,
.dr-three-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.dr-currency-card,
.dr-panel,
.dr-empty,
.dr-notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.dr-currency-card,
.dr-panel,
.dr-empty,
.dr-notice {
  padding: 18px;
}

.dr-currency-card header,
.dr-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dr-currency-card header strong {
  font-size: 21px;
}

.dr-currency-card header span,
.dr-panel-head span,
.dr-form p,
.dr-empty p {
  color: var(--muted);
}

.dr-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.dr-metrics div {
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.dr-metrics span,
.dr-metrics strong {
  display: block;
}

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

.dr-metrics strong {
  margin-top: 7px;
  font-size: 17px;
}

.dr-panel h3,
.dr-empty h3,
.dr-notice p {
  margin: 0;
}

.dr-panel-head {
  margin-bottom: 14px;
}

.dr-table {
  min-width: 980px;
}

.dr-table small {
  display: block;
  margin-top: 4px;
}

.dr-form {
  align-content: start;
  display: grid;
  gap: 12px;
}

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

.dr-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #b8dfd4;
  border-radius: 7px;
  background: var(--green-soft);
}

.dr-preview p {
  margin: 0;
}

.dr-notice.error {
  border-color: #fac7bd;
  background: var(--red-soft);
  color: var(--red);
}

@media (max-width: 1120px) {
  .dr-filterbar {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 720px) {
  .dr-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .dr-filterbar,
  .dr-metrics,
  .dr-form-row {
    grid-template-columns: 1fr;
  }
}

.account-action-scroll {
  max-height: min(260px, 30vh);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.account-assets-panel .resource-preview {
  min-height: 82px;
}

.coming-soon,
.empty-state {
  padding: 26px;
}

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

.empty-state strong {
  display: block;
  color: var(--ink);
  margin-bottom: 8px;
}

.ads-manager {
  display: grid;
  gap: 12px;
}

.am-topbar,
.am-alert,
.am-filterbar,
.am-search-row,
.am-actionbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.am-topbar {
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}

.am-account-select {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  border-color: var(--line);
}

.am-square {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #1877f2;
  color: #fff;
  font-weight: 800;
}

.am-caret,
.am-muted {
  color: var(--muted);
}

.am-top-actions,
.am-table-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.am-alert {
  justify-content: space-between;
  border: 1px solid #c9e3d7;
  border-radius: 8px;
  background: #f1fbf6;
  padding: 12px 14px;
  color: #123f2d;
}

.am-alert div {
  display: grid;
  gap: 3px;
}

.am-alert span {
  color: #376552;
  font-size: 13px;
}

.am-filterbar,
.am-search-row,
.am-actionbar {
  flex-wrap: wrap;
}

.am-filterbar .active {
  border-color: #1877f2;
  color: #1877f2;
  background: #f0f6ff;
}

.am-toast {
  position: sticky;
  top: 12px;
  z-index: 20;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #b7d7ff;
  border-radius: 8px;
  background: #edf5ff;
  color: #145db8;
  padding: 10px 12px;
  box-shadow: var(--shadow-soft);
}

.am-search-row input {
  flex: 1 1 320px;
}

.am-date-chip {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
}

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

.am-level-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 14px;
  min-height: 88px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.am-level-card.active {
  border-color: #1877f2;
  box-shadow: inset 0 3px 0 #1877f2;
}

.am-level-card:hover {
  background: #fbfdff;
}

.am-level-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.am-level-card span {
  color: var(--muted);
  font-weight: 700;
}

.am-level-card p {
  margin: 12px 0 0;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.am-actionbar {
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  padding: 10px;
}

.am-create {
  background: #16833a;
  border-color: #16833a;
}

.am-table-tools {
  margin-left: auto;
}

.am-table-tools .active,
.am-actionbar .active {
  border-color: #1877f2;
  color: #1877f2;
  background: #f0f6ff;
}

.am-selection {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.am-popover,
.am-breakdown-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
}

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

.am-popover p {
  margin: 0 0 10px;
  color: var(--muted);
}

.am-column-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px 12px;
}

.am-column-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.am-column-grid input {
  width: 16px;
  min-height: 16px;
}

.am-breakdown-note {
  color: #245a45;
  background: #f1fbf6;
  border-color: #c9e3d7;
}

.am-table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--surface);
}

.am-table {
  min-width: 1420px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.am-table th,
.am-table td {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  vertical-align: middle;
}

.am-table th:last-child,
.am-table td:last-child {
  border-right: 0;
}

.am-table tbody tr.selected {
  background: #f2f8ff;
}

.am-table tbody tr:hover {
  background: #f8fafc;
}

.am-table tbody tr.breakdown {
  background: #fbfcfd;
  color: #4b5563;
}

.am-table tbody tr.draft {
  background: #fffdf4;
}

.am-check-col,
.am-toggle-col {
  width: 62px;
  text-align: center;
}

.am-name-col {
  width: 280px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: inherit;
}

.am-table thead .am-name-col {
  background: #fbfcfd;
  z-index: 2;
}

.am-table a,
.am-name-link {
  color: #145db8;
  font-weight: 700;
  text-decoration: none;
}

.am-name-link {
  border: 0;
  background: transparent;
  min-height: auto;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.am-name-link:hover {
  text-decoration: underline;
  background: transparent;
}

.am-row-actions {
  margin-top: 5px;
  color: #577190;
  font-size: 12px;
}

.am-row-actions button {
  border: 0;
  background: transparent;
  min-height: auto;
  padding: 0 3px 0 0;
  color: #577190;
  font-size: 12px;
}

.am-row-actions button:hover {
  background: transparent;
  color: #145db8;
  text-decoration: underline;
}

.am-draft-badge {
  display: inline-flex;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
}

.am-table .num {
  text-align: right;
  white-space: nowrap;
}

.am-table small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}

.am-checkbox,
.am-checkbox-btn {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: #fff;
  font-size: 12px;
  min-height: 18px;
  padding: 0;
}

.am-checkbox.checked,
.am-checkbox-btn.checked {
  border-color: #1877f2;
  background: #1877f2;
}

.am-toggle {
  display: inline-flex;
  align-items: center;
  width: 38px;
  height: 20px;
  border-radius: 999px;
  padding: 2px;
  background: #c9d1dc;
  border: 0;
  min-height: 20px;
  cursor: pointer;
}

.am-toggle i {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.am-toggle.on {
  justify-content: flex-end;
  background: #1877f2;
}

.am-toggle:hover {
  background: #9aa8bb;
}

.am-toggle.on:hover {
  background: #0f63d6;
}

.am-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--soft);
  margin-right: 6px;
}

.am-dot.on {
  background: #16833a;
}

.am-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, 0.34);
  padding: 18px;
}

.am-modal {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.am-modal h3 {
  margin: 0;
  font-size: 19px;
}

.am-modal label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.am-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.creation-shell {
  display: grid;
  gap: 16px;
}

.creation-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.creation-steps div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.creation-steps span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1877f2;
  color: #fff;
  font-weight: 800;
  margin-bottom: 10px;
}

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

.creation-steps p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.creation-layout {
  align-items: start;
}

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

.creation-form.compact {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

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

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

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

.creation-list-item {
  min-height: 64px;
  display: grid;
  gap: 5px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.creation-list-item span {
  color: var(--muted);
  font-size: 13px;
}

.creation-list-item.active {
  border-color: #1877f2;
  background: #f2f8ff;
}

.creation-summary {
  display: grid;
  gap: 10px;
}

.creation-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
}

.creation-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.creation-summary strong {
  overflow-wrap: anywhere;
}

.creation-summary p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.validation-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.validation-box.good {
  border-color: #c9e3d7;
  background: #f1fbf6;
  color: #123f2d;
}

.validation-box.bad {
  border-color: #fac7bd;
  background: #fff0ed;
  color: #8a1f14;
}

.validation-box p {
  margin: 7px 0 0;
}

.creation-preview {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.creation-preview article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.creation-preview p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.5;
}

pre {
  white-space: pre-wrap;
  background: #111827;
  color: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  overflow: auto;
}

.loading {
  padding: 28px;
  color: var(--muted);
}

/* Ads workbench: Meta Ads Manager-inspired production surface. */
.ads-manager {
  --am-blue: #1877f2;
  --am-green: #008a45;
  --am-border: #d8dfe8;
  --am-header: #f7f8fa;
  --am-hover: #f3f6f9;
  gap: 10px;
}

.ads-manager button {
  min-height: 36px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 650;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 80ms ease,
    opacity 120ms ease;
}

.ads-manager button:active {
  transform: translateY(1px);
}

.ads-manager button.loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0.82;
}

.am-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: am-spin 720ms linear infinite;
}

@keyframes am-spin {
  to {
    transform: rotate(360deg);
  }
}

.am-topbar {
  min-height: 58px;
  padding: 10px 12px;
  border-color: var(--am-border);
  border-radius: 7px;
  box-shadow: none;
}

.am-account-select {
  min-width: 300px;
  justify-content: flex-start;
  border-color: #ccd6e2;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(24, 119, 242, 0);
}

.am-account-select:hover,
.am-account-select:focus-visible {
  border-color: var(--am-blue);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.14);
}

.am-square {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--am-blue);
}

.am-top-actions .primary,
.am-actionbar .primary {
  background: #111827;
  border-color: #111827;
}

.am-top-actions .primary:hover,
.am-actionbar .primary:hover {
  background: #050b16;
}

.am-icon-btn {
  font-size: 17px;
  line-height: 1;
}

.am-alert {
  border-color: #bfe6d4;
  border-radius: 7px;
  background: #eefaf4;
  color: #0d3d2a;
  box-shadow: none;
}

.am-alert strong {
  font-size: 16px;
}

.am-alert button {
  border-color: #cbd6e2;
  color: #111827;
}

.am-filterbar {
  gap: 8px;
}

.am-filterbar button {
  min-height: 38px;
  border-color: #cfd8e3;
  background: #fff;
  color: #111827;
}

.am-filterbar button:hover {
  background: #f7faff;
  border-color: #aebdcd;
}

.am-filterbar .active {
  border-color: var(--am-blue);
  background: #f1f7ff;
  color: #0b5ed7;
  box-shadow: inset 0 0 0 1px var(--am-blue);
}

.am-search-row {
  gap: 10px;
}

.am-search-row input,
.am-date-chip {
  min-height: 40px;
  border-color: #cfd8e3;
  border-radius: 6px;
  background: #fff;
}

.am-search-row input:focus {
  outline: 0;
  border-color: var(--am-blue);
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.14);
}

.am-level-grid {
  gap: 10px;
}

.am-level-card {
  min-height: 89px;
  border-color: var(--am-border);
  border-radius: 7px;
  background: #fff;
  box-shadow: none;
}

.am-level-card:hover {
  border-color: #b6c2d0;
  background: #fbfcfe;
}

.am-level-card.active {
  border-color: var(--am-blue);
  background: #fff;
  box-shadow: inset 3px 0 0 var(--am-blue), 0 0 0 1px rgba(24, 119, 242, 0.12);
}

.am-level-card strong {
  font-size: 17px;
}

.am-level-card p {
  margin-top: 13px;
  font-size: 15px;
}

.am-actionbar {
  min-height: 58px;
  padding: 10px;
  border-color: var(--am-border);
  border-radius: 7px 7px 0 0;
  background: #fff;
  box-shadow: none;
}

.am-create {
  background: var(--am-green);
  border-color: var(--am-green);
  padding-inline: 17px;
}

.am-create:hover {
  background: #007a3d;
  border-color: #007a3d;
}

.am-actionbar .ghost,
.am-table-tools .ghost,
.am-top-actions .ghost {
  border-color: #d1dae5;
  background: #fff;
  color: #111827;
}

.am-actionbar .ghost:hover,
.am-table-tools .ghost:hover,
.am-top-actions .ghost:hover {
  background: var(--am-hover);
}

.am-actionbar .active,
.am-table-tools .active {
  border-color: var(--am-blue);
  background: #eef5ff;
  color: #0b5ed7;
}

.am-selection {
  align-self: center;
  color: #607083;
}

.am-toast.inline {
  position: fixed;
  top: 18px;
  right: 28px;
  z-index: 200;
  border-color: #d1dae5;
  background: #fff;
  color: #1d2733;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.14);
  animation: am-toast-in 160ms ease-out;
}

@keyframes am-toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.am-popover,
.am-breakdown-note {
  border-color: var(--am-border);
  border-radius: 7px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
}

.am-table-shell {
  border-color: var(--am-border);
  border-radius: 0 0 7px 7px;
  box-shadow: none;
}

.am-table {
  min-width: 1480px;
  font-size: 13px;
}

.am-table th {
  height: 42px;
  background: var(--am-header);
  color: #516070;
  font-size: 12px;
  font-weight: 750;
  border-color: #dfe5ec;
}

.am-table td {
  height: 56px;
  border-color: #dfe5ec;
  background: #fff;
}

.am-table tbody tr:hover td {
  background: #f8fafc;
}

.am-table tbody tr.selected td {
  background: #eef5ff;
}

.am-table tbody tr.draft td {
  background: #fffaf0;
}

.am-name-col {
  width: 292px;
  box-shadow: 1px 0 0 #dfe5ec;
}

.am-table thead .am-name-col {
  background: var(--am-header);
}

.am-name-link {
  max-width: 255px;
  color: #0b5ed7;
  font-size: 13px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.am-row-actions {
  margin-top: 4px;
  color: #607083;
}

.am-row-actions button {
  color: #52657a;
}

.am-row-actions button:hover {
  color: #0b5ed7;
}

.am-checkbox-btn {
  width: 18px;
  height: 18px;
  min-height: 18px;
  border-color: #cbd5e1;
  border-radius: 4px;
  color: #fff;
}

.am-checkbox-btn:hover {
  border-color: var(--am-blue);
  background: #fff;
}

.am-checkbox-btn.checked {
  border-color: var(--am-blue);
  background: var(--am-blue);
}

.am-toggle {
  width: 40px;
  height: 20px;
  min-height: 20px;
  border-radius: 999px;
  background: #c7d1de;
  transition: background 140ms ease;
}

.am-toggle i {
  width: 16px;
  height: 16px;
  transition: transform 140ms ease;
}

.am-toggle.on {
  justify-content: flex-start;
  background: var(--am-blue);
}

.am-toggle.on i {
  transform: translateX(20px);
}

.am-dot {
  background: #9aa8b8;
}

.am-dot.on {
  background: var(--am-green);
}

.am-draft-badge,
.label.testing {
  background: #fff4d6;
  color: #9a6700;
}

.label.winner,
.label.scaling {
  background: #e8f6ee;
  color: #0c7a43;
}

.label.kill {
  background: #ffe9e5;
  color: #b42318;
}

.am-modal-backdrop {
  background: rgba(31, 41, 55, 0.36);
}

.am-modal {
  border-radius: 7px;
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.18);
  animation: am-modal-in 120ms ease-out;
}

@keyframes am-modal-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.monitor-shell {
  display: grid;
  gap: 14px;
}

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

.monitor-summary div {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 15px;
  box-shadow: var(--shadow-soft);
}

.monitor-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.monitor-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.15;
}

.monitor-summary p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.monitor-actions {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.monitor-interval {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.monitor-interval span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.monitor-interval select {
  min-height: 38px;
}

.monitor-auto-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.monitor-auto-note.enabled {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.monitor-auto-note span {
  color: var(--muted);
  font-size: 13px;
}

.monitor-account-bar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(280px, 520px) 1fr;
  gap: 14px;
  align-items: end;
  box-shadow: var(--shadow-soft);
}

.monitor-account-bar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.monitor-account-bar p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.monitor-layout {
  align-items: start;
  height: calc(200vh - 340px);
  min-height: 1440px;
  overflow: hidden;
}

.monitor-layout > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.monitor-layout > .panel > .panel-head {
  flex: 0 0 auto;
}

.monitor-rule-list,
.monitor-events {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  padding-right: 8px;
  scrollbar-gutter: stable;
}

.monitor-rule {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.monitor-rule.enabled {
  border-color: #bfe6d4;
  background: #fbfffd;
}

.monitor-copy-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 360px) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
}

.monitor-copy-panel strong {
  display: block;
  font-size: 14px;
}

.monitor-copy-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.monitor-copy-panel select {
  min-height: 38px;
}

.monitor-protection-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.monitor-protection-row strong {
  display: block;
  font-size: 14px;
}

.monitor-protection-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.monitor-protection-row.compact {
  margin: 10px 0;
}

.monitor-budget-module {
  display: grid;
  gap: 14px;
}

.monitor-budget-group {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.monitor-budget-group h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--text);
}

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

.budget-tier-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.budget-tier-add {
  width: 100%;
  margin-top: 10px;
}

.icon-danger {
  width: 38px;
  height: 38px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff;
  color: #dc2626;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.icon-danger:hover {
  background: #fef2f2;
}

.monitor-rule-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.monitor-rule-head strong {
  display: block;
  font-size: 15px;
}

.monitor-rule-head p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.monitor-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 22px;
  cursor: pointer;
}

.monitor-switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.monitor-switch span {
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: #c7d1de;
  padding: 3px;
  transition: background 140ms ease;
}

.monitor-switch span::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 140ms ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.monitor-switch input:checked + span {
  background: #1877f2;
}

.monitor-switch input:checked + span::before {
  transform: translateX(20px);
}

.monitor-events article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.monitor-events article div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.monitor-events p {
  margin: 8px 0;
  color: var(--ink);
  line-height: 1.5;
}

.monitor-events small {
  color: var(--muted);
  line-height: 1.5;
}

.monitor-event-detail {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.monitor-event-detail summary {
  cursor: pointer;
  color: #0b5ed7;
  font-size: 13px;
  font-weight: 700;
}

.event-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.event-detail-grid div {
  display: grid;
  gap: 3px;
  align-items: start;
  justify-content: stretch;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.event-detail-grid span {
  color: var(--muted);
  font-size: 12px;
}

.event-detail-grid strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.today-board {
  display: grid;
  gap: 16px;
}

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

.today-summary div,
.today-focus,
.today-account-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.today-datebar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
}

.today-datebar label {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.today-datebar input {
  min-height: 38px;
}

.today-date-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.today-summary div {
  min-height: 112px;
  padding: 15px;
}

.today-summary span,
.today-account-metrics span,
.today-table small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.today-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.15;
}

.today-summary p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.today-focus {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 14px;
  border-left: 4px solid #eab308;
}

.today-focus.healthy {
  border-left-color: #16a34a;
}

.today-focus > strong {
  font-size: 15px;
}

.today-focus ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.today-focus li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.today-focus li strong {
  color: var(--ink);
}

.today-account-list {
  display: grid;
  gap: 14px;
}

.today-account-card {
  overflow: hidden;
}

.today-account-card summary {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(560px, 2fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  cursor: pointer;
}

.today-account-card.risk {
  border-left: 4px solid #dc2626;
}

.today-account-card.watch {
  border-left: 4px solid #eab308;
}

.today-account-card.healthy {
  border-left: 4px solid #16a34a;
}

.today-account-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.today-account-title strong,
.today-table strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-account-title small,
.today-table small {
  display: block;
  margin-top: 3px;
}

.today-status,
.today-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
}

.today-status.healthy,
.today-pill.normal {
  color: #166534;
  background: #dcfce7;
}

.today-status.watch,
.today-pill.watch {
  color: #854d0e;
  background: #fef3c7;
}

.today-status.risk,
.today-pill.risk {
  color: #991b1b;
  background: #fee2e2;
}

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

.today-account-metrics div {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 9px;
}

.today-account-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
}

.today-account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px 14px;
}

.today-ad-group {
  border-top: 1px solid var(--line);
}

.today-ad-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
}

.today-ad-group summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.today-table-wrap {
  overflow-x: auto;
  padding: 0 16px 16px;
}

.today-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 13px;
}

.today-table th {
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  background: var(--surface-2);
}

.today-table th,
.today-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 9px;
  vertical-align: top;
}

.today-table td:first-child {
  max-width: 360px;
}

.today-empty-line,
.today-muted-tail {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 13px;
}

.today-muted-tail {
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

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

  .sidebar {
    position: relative;
    height: auto;
  }

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

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

  .two-col {
    grid-template-columns: 1fr;
  }

  .am-level-grid {
    grid-template-columns: 1fr;
  }

  .monitor-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-account-card summary,
  .today-focus {
    grid-template-columns: 1fr;
  }

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

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

  .monitor-layout {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .monitor-layout > .panel {
    max-height: none;
    overflow: visible;
  }

  .monitor-rule-list,
  .monitor-events {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .monitor-auto-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .am-table-tools {
    margin-left: 0;
  }

  .am-column-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creation-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .main {
    padding: 18px;
  }

  .page-header,
  .hero-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-header h2 {
    font-size: 26px;
  }

  .metric-grid,
  .nav,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .account-row {
    flex-direction: column;
  }

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

  .account-scroll-list,
  .hidden-account-list,
  .account-action-scroll {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .am-topbar,
  .am-alert {
    align-items: flex-start;
    flex-direction: column;
  }

  .am-account-select strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .am-column-grid {
    grid-template-columns: 1fr;
  }

  .creation-steps,
  .budget-tier-row,
  .form-grid.two,
  .monitor-copy-panel,
  .monitor-summary,
  .today-summary,
  .today-account-metrics {
    grid-template-columns: 1fr;
  }

  .today-account-actions,
  .today-datebar,
  .today-focus li {
    align-items: stretch;
    flex-direction: column;
  }
}

/* 投放日报 */
.dr-page, .dr-content { display: grid; gap: 16px; }
.dr-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.dr-header h2, .dr-header p { margin: 0; }
.dr-header h2 { font-size: 30px; }
.dr-header > div > p:last-child { margin-top: 8px; color: var(--muted); }
.dr-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 10px; overflow-x: auto; }
.dr-tabs button { border-color: var(--line-strong); background: #fff; color: var(--ink); white-space: nowrap; }
.dr-tabs button.active { border-color: var(--green); background: var(--green-soft); color: #0b4d3e; }
.dr-filterbar { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)) auto; align-items: end; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.dr-filterbar label, .dr-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.dr-summary-grid, .dr-three-col, .dr-two-col, .dr-account-grid, .dr-user-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.dr-currency-card, .dr-panel, .dr-empty, .dr-notice { border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-soft); padding: 18px; }
.dr-currency-card header, .dr-panel-head, .dr-account-card header, .dr-user-grid article > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dr-currency-card header strong { font-size: 21px; }
.dr-currency-card header span, .dr-panel-head span, .dr-form p, .dr-empty p { color: var(--muted); }
.dr-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.dr-metrics div { min-height: 78px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.dr-metrics span, .dr-metrics strong { display: block; }
.dr-metrics span { color: var(--muted); font-size: 12px; }
.dr-metrics strong { margin-top: 7px; font-size: 17px; }
.dr-panel h3, .dr-empty h3, .dr-notice p { margin: 0; }
.dr-panel-head { margin-bottom: 14px; }
.dr-table { min-width: 980px; }
.dr-table small { display: block; margin-top: 4px; }
.dr-form { align-content: start; display: grid; gap: 12px; }
.dr-form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dr-preview { display: grid; gap: 8px; padding: 12px; border: 1px solid #b8dfd4; border-radius: 7px; background: var(--green-soft); }
.dr-preview p { margin: 0; }
.dr-notice.error { border-color: #fac7bd; background: var(--red-soft); color: var(--red); }
.dr-account-card { display: grid; gap: 14px; }
.dr-account-card header h3, .dr-account-card header p, .dr-user-grid header h3, .dr-user-grid header p { margin: 0; }
.dr-account-balance { padding: 14px; border-radius: 8px; background: var(--surface-2); }
.dr-account-balance span, .dr-account-balance strong, .dr-account-balance small { display: block; }
.dr-account-balance strong { margin: 6px 0; font-size: 25px; }
.dr-account-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.dr-account-card dl div { padding: 8px; border: 1px solid var(--line); border-radius: 7px; }
.dr-account-card dt { color: var(--muted); font-size: 12px; }
.dr-account-card dd { margin: 5px 0 0; }
.dr-zero-form { border-top: 1px solid var(--line); padding-top: 12px; }
.dr-report-text { min-height: 280px; margin: 0; white-space: pre-wrap; font-family: inherit; line-height: 1.8; }
.dr-danger-zone { margin-top: 18px; padding: 14px; border: 1px solid #fac7bd; border-radius: 8px; background: var(--red-soft); }
.dr-danger-zone p { color: var(--red); }

.dr-legacy-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dr-legacy-metric { min-height: 126px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-soft); }
.dr-legacy-metric span, .dr-legacy-metric strong, .dr-legacy-metric small { display: block; }
.dr-legacy-metric span { color: var(--muted); font-size: 13px; font-weight: 700; }
.dr-legacy-metric strong { margin: 16px 0 8px; font-size: 29px; letter-spacing: -.03em; }
.dr-legacy-metric small { color: var(--muted); }
.dr-legacy-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: 14px; }
.dr-account-performance { min-width: 620px; }
.dr-bar-list { display: grid; gap: 14px; }
.dr-bar-row { display: grid; gap: 7px; }
.dr-bar-copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dr-bar-copy span, .dr-bar-row small, .dr-spend-board .dr-panel-head p { color: var(--muted); }
.dr-bar-track { height: 9px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.dr-bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0f766e, #34d399); }
.dr-spend-board .dr-panel-head { align-items: flex-start; }
.dr-spend-board .dr-panel-head h3, .dr-spend-board .dr-panel-head p { margin: 0; }
.dr-spend-board .dr-panel-head p { margin-top: 5px; font-size: 13px; }
.dr-spend-board-total { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.dr-spend-board-total div { min-width: 180px; padding: 14px 18px; border-radius: 8px; background: var(--surface-2); }
.dr-spend-board-total small, .dr-spend-board-total strong { display: block; }

/* Daily report account ledger: preserve the original report app structure. */
.dr-account-metrics { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 14px; }
.dr-account-metric { display: grid; gap: 8px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-soft); }
.dr-account-metric span, .dr-account-metric small { color: var(--muted); }
.dr-account-metric span { font-size: 13px; font-weight: 800; }
.dr-account-metric strong { overflow-wrap: anywhere; font-size: 24px; line-height: 1.1; }
.dr-account-metric strong.good, .dr-money-good { color: #047857; }
.dr-account-metric strong.warn, .dr-money-warn { color: #b45309; }
.dr-collapsible { padding: 0; }
.dr-collapsible > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; cursor: pointer; list-style: none; }
.dr-collapsible > summary::-webkit-details-marker { display: none; }
.dr-collapsible > summary > span:first-child { display: grid; gap: 4px; }
.dr-collapsible > summary strong { color: var(--text); font-size: 17px; }
.dr-collapsible > summary small { color: var(--muted); font-size: 13px; font-weight: 400; }
.dr-collapsible-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.dr-collapsible-meta b { min-width: 64px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); text-align: center; }
.dr-collapsible[open] .dr-collapsible-meta b::before { content: "收起"; }
.dr-collapsible[open] .dr-collapsible-meta b { font-size: 0; }
.dr-collapsible[open] .dr-collapsible-meta b::before { font-size: 13px; }
.dr-collapsible-body { margin: 0 18px 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.dr-form-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 14px; }
.dr-form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.dr-accounts-table { min-width: 1320px; }
.dr-accounts-table th { white-space: nowrap; }
.dr-accounts-table td:not(:nth-child(10)) { white-space: nowrap; }
.dr-accounts-table th:nth-child(1), .dr-accounts-table td:nth-child(1) { min-width: 240px; text-align: left; }
.dr-accounts-table th:nth-child(4), .dr-accounts-table td:nth-child(4), .dr-accounts-table th:nth-child(5), .dr-accounts-table td:nth-child(5), .dr-accounts-table th:nth-child(6), .dr-accounts-table td:nth-child(6) { text-align: right; }
.dr-accounts-table th:nth-child(10), .dr-accounts-table td:nth-child(10) { min-width: 220px; text-align: left; white-space: normal; }
.dr-accounts-table th:last-child, .dr-accounts-table td:last-child { min-width: 220px; }
.dr-recharges-table { min-width: 1080px; }
.dr-account-disabled { opacity: .72; }
.dr-notes-cell { max-width: 280px; white-space: normal; overflow-wrap: anywhere; }
.dr-row-actions { display: flex; align-items: center; justify-content: center; gap: 7px; }
.dr-row-actions button, .dr-row-editor > summary { min-height: 34px; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.dr-row-editor { position: relative; }
.dr-row-editor > summary { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; list-style: none; }
.dr-row-editor > summary::-webkit-details-marker { display: none; }
.dr-row-editor[open] > .dr-form { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; width: min(360px, calc(100vw - 80px)); padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 16px 40px rgba(15, 23, 42, .18); text-align: left; }
.dr-row-editor .dr-zero-form { border-top: 1px solid var(--line); }
.dr-spend-board-total small { color: var(--muted); }
.dr-spend-board-total strong { margin-top: 5px; font-size: 22px; }

@media (max-width: 1120px) { .dr-filterbar { grid-template-columns: repeat(3, minmax(150px, 1fr)); } }
@media (max-width: 720px) {
  .dr-header { align-items: flex-start; flex-direction: column; }
  .dr-filterbar, .dr-metrics, .dr-form-row, .dr-account-card dl, .dr-legacy-metrics, .dr-legacy-split, .dr-account-metrics, .dr-form-grid { grid-template-columns: 1fr; }
}
