:root {
  --green-950: #102d25;
  --green-900: #16392f;
  --green-800: #225044;
  --green-700: #34695a;
  --green-100: #dfece6;
  --green-050: #edf4f0;
  --ivory: #f7f5ef;
  --paper: #fffefa;
  --surface: #ffffff;
  --ink: #1c2823;
  --muted: #69756f;
  --soft-muted: #8b958f;
  --line: #dfe4e1;
  --strong-line: #cbd3ce;
  --gold: #aa7d31;
  --gold-soft: #f0e6cf;
  --amber: #a8642b;
  --amber-soft: #f4e6d9;
  --blue: #356b88;
  --blue-soft: #e3edf2;
  --red: #9a4741;
  --red-soft: #f3e4e2;
  --purple: #675887;
  --purple-soft: #ece8f3;
  --shadow: 0 16px 42px rgba(23, 43, 35, 0.12);
  --focus: 0 0 0 3px rgba(52, 105, 90, 0.2);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: #eef1ee;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #eef1ee;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

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

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  left: 16px;
  top: -52px;
  padding: 9px 14px;
  background: var(--paper);
  color: var(--green-900);
  border: 1px solid var(--green-700);
  border-radius: 5px;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: white;
  background: var(--green-950);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-lockup {
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-lockup > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-lockup strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 19px;
  font-weight: 700;
}

.brand-lockup small {
  color: #9db3aa;
  font-size: 11px;
}

.brand-seal,
.placeholder-mark {
  display: grid;
  place-items: center;
  color: #ead9a8;
  background: #244c40;
  border: 1px solid rgba(218, 187, 110, 0.62);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.04);
  font-family: "Kaiti SC", "STKaiti", serif;
}

.brand-seal {
  width: 43px;
  height: 49px;
  flex: 0 0 auto;
  border-radius: 4px;
  font-size: 22px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 12px;
}

.side-nav a {
  position: relative;
  min-height: 44px;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: #afc2ba;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
}

.side-nav a:hover,
.side-nav a.active {
  color: white;
  background: rgba(255, 255, 255, 0.09);
}

.side-nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 22px;
  background: #d5b763;
  border-radius: 0 2px 2px 0;
}

.nav-symbol {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #c3d3cc;
  font-size: 17px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.connection-button {
  width: 100%;
  min-height: 55px;
  display: grid;
  grid-template-columns: 10px 1fr 12px;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  color: white;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  text-align: left;
}

.connection-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.connection-button > span:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.connection-button strong,
.connection-button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-button strong {
  font-size: 12px;
}

.connection-button small {
  color: #91a99f;
  font-size: 10px;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c57a48;
  box-shadow: 0 0 0 3px rgba(197, 122, 72, 0.12);
}

.connection-dot.connected {
  background: #84b69e;
  box-shadow: 0 0 0 3px rgba(132, 182, 158, 0.13);
}

.sidebar-foot p {
  margin: 9px 3px 0;
  color: #789087;
  font-size: 10px;
  line-height: 1.5;
}

.main-area {
  min-width: 0;
}

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  margin: 0 0 4px;
  color: var(--soft-muted);
  font-size: 11px;
}

.topbar h1 {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.2;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.last-updated {
  max-width: 260px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.text-button,
.icon-button {
  min-height: 36px;
  border-radius: 6px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 700;
}

.primary-button {
  color: white;
  background: var(--green-900);
  border: 1px solid var(--green-900);
}

.primary-button:hover {
  background: var(--green-800);
  border-color: var(--green-800);
}

.secondary-button {
  color: var(--green-800);
  background: var(--surface);
  border: 1px solid var(--strong-line);
}

.secondary-button:hover {
  background: var(--green-050);
  border-color: #aebbb4;
}

.text-button {
  padding: 0 5px;
  color: var(--green-700);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 650;
}

.icon-button {
  width: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #5d6963;
  background: white;
  border: 1px solid var(--line);
  font-size: 18px;
}

.icon-button:hover {
  color: var(--green-800);
  background: var(--green-050);
}

.global-notice {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 24px 0;
  padding: 10px 14px 10px 17px;
  color: #5f4c28;
  background: #f7f0df;
  border: 1px solid #e4d3aa;
  border-left: 3px solid var(--gold);
  border-radius: 6px;
}

.global-notice.connected {
  color: #2c5749;
  background: var(--green-050);
  border-color: #c9dcd3;
  border-left-color: var(--green-700);
}

.global-notice.error {
  color: #743d38;
  background: var(--red-soft);
  border-color: #e5c8c5;
  border-left-color: var(--red);
}

.global-notice > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.global-notice strong {
  font-size: 12px;
}

.global-notice span {
  font-size: 11px;
  line-height: 1.5;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: 315px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 18px 24px 34px;
}

.campaign-rail,
.campaign-detail {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.campaign-rail {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: hidden;
}

.campaign-detail {
  min-height: 720px;
}

.section-title {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 18px;
  border-bottom: 1px solid #e9ecea;
}

.section-title > div:first-child {
  min-width: 0;
}

.section-title h2,
.section-title h3 {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.3;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.section-kicker {
  display: block;
  color: var(--green-700);
  font-size: 10px;
  font-weight: 800;
}

.compact-title {
  min-height: 70px;
  padding: 12px 14px;
}

.count-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.campaign-filters {
  display: flex;
  gap: 5px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf0ee;
  overflow-x: auto;
}

.filter-button {
  min-height: 28px;
  flex: 0 0 auto;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 11px;
}

.filter-button:hover,
.filter-button.active {
  color: var(--green-800);
  background: var(--green-050);
  border-color: #d7e3dd;
  font-weight: 700;
}

.campaign-list {
  max-height: calc(100vh - 198px);
  overflow-y: auto;
}

.campaign-item {
  position: relative;
  width: 100%;
  min-height: 96px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 14px;
  color: var(--ink);
  background: white;
  border: 0;
  border-bottom: 1px solid #edf0ee;
  text-align: left;
}

.campaign-item:hover {
  background: #fafbf9;
}

.campaign-item.active {
  background: var(--green-050);
}

.campaign-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  bottom: 17px;
  width: 3px;
  background: var(--green-700);
  border-radius: 0 2px 2px 0;
}

.campaign-item-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.campaign-item strong,
.campaign-item small,
.campaign-item time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-item strong {
  font-size: 12px;
}

.campaign-item small,
.campaign-item time {
  color: var(--muted);
  font-size: 11px;
}

.campaign-item .status-badge {
  align-self: start;
}

.status-badge {
  min-width: 44px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  color: #5d6762;
  background: #eef1ef;
  border: 1px solid #e0e5e2;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.status-active {
  color: #2c6552;
  background: #e4efe9;
  border-color: #cfe1d8;
}

.status-draft {
  color: #5c6f7c;
  background: #edf1f3;
  border-color: #dce4e8;
}

.status-paused {
  color: #8b5b29;
  background: var(--amber-soft);
  border-color: #ead4c0;
}

.status-ended,
.status-disabled {
  color: #7b605e;
  background: #f1e9e8;
  border-color: #e3d5d3;
}

.state-block,
.detail-placeholder,
.detail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.state-block {
  min-height: 250px;
  padding: 28px;
}

.compact-state {
  min-height: 250px;
}

.state-block strong,
.inline-empty strong {
  margin-top: 12px;
  color: var(--ink);
  font-size: 13px;
}

.state-block p,
.inline-empty p,
.detail-placeholder p {
  max-width: 440px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.state-block button,
.detail-placeholder button {
  margin-top: 16px;
}

.state-spinner {
  width: 22px;
  height: 22px;
  display: inline-block;
  border: 2px solid #dce4df;
  border-top-color: var(--green-700);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.state-symbol {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
}

.detail-placeholder {
  min-height: 716px;
  padding: 36px;
}

.detail-placeholder h2 {
  margin: 17px 0 0;
  font-size: 17px;
}

.placeholder-mark {
  width: 58px;
  height: 64px;
  border-radius: 5px;
  font-size: 29px;
}

.detail-loading {
  min-height: 716px;
  align-items: stretch;
  justify-content: flex-start;
  padding: 28px;
}

.skeleton {
  border-radius: 5px;
  background: linear-gradient(90deg, #eef1ef 25%, #f7f8f7 50%, #eef1ef 75%);
  background-size: 200% 100%;
  animation: shimmer 1.25s infinite;
}

.skeleton-title {
  width: 46%;
  height: 58px;
}

.skeleton-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 28px;
  background: var(--line);
  border: 1px solid var(--line);
}

.skeleton-metrics span {
  height: 112px;
  background: linear-gradient(90deg, #eef1ef 25%, #f7f8f7 50%, #eef1ef 75%);
  background-size: 200% 100%;
  animation: shimmer 1.25s infinite;
}

.skeleton-panel {
  height: 260px;
  margin-top: 22px;
}

.error-state {
  min-height: 716px;
}

.campaign-heading {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.campaign-heading > div:first-child {
  min-width: 0;
}

.heading-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}

.campaign-heading h2 {
  margin: 8px 0 3px;
  overflow-wrap: anywhere;
  font-size: 22px;
}

.campaign-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.campaign-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--line);
  border-bottom: 1px solid var(--line);
  gap: 1px;
}

.metric-strip article {
  min-height: 106px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 17px 20px;
  background: white;
}

.metric-strip span,
.metric-strip small {
  color: var(--muted);
  font-size: 11px;
}

.metric-strip strong {
  margin: 6px 0 3px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.operation-section {
  scroll-margin-top: 14px;
  border-bottom: 1px solid var(--line);
}

.operation-section:last-child {
  border-bottom: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th,
td {
  min-width: 92px;
  height: 54px;
  padding: 8px 16px;
  border-bottom: 1px solid #edf0ee;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  height: 38px;
  color: var(--muted);
  background: #fafbf9;
  font-size: 10px;
  font-weight: 700;
}

td {
  color: #3d4943;
  font-size: 12px;
}

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

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

td strong {
  color: var(--ink);
  font-size: 12px;
}

.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

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

.kind-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 23px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.kind-cash {
  color: #8a6121;
  background: var(--gold-soft);
}

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

.kind-none {
  color: #606d67;
  background: #ecefed;
}

.table-action {
  min-height: 28px;
  padding: 0 9px;
  color: var(--green-700);
  background: white;
  border: 1px solid var(--strong-line);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
}

.table-action:hover {
  background: var(--green-050);
}

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

.danger-action {
  color: var(--red);
  border-color: #dfc4c1;
}

.danger-action:hover {
  background: var(--red-soft);
}

.align-right {
  text-align: right;
}

.inline-empty {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
}

.inline-empty > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--green-700);
  background: var(--green-050);
  border-radius: 50%;
  font-size: 16px;
}

.inline-loading,
.inline-error {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}

.inline-loading .state-spinner {
  width: 16px;
  height: 16px;
}

.inline-error {
  color: var(--red);
  background: #fcf6f5;
}

.inline-error button {
  padding: 3px 5px;
  color: var(--red);
  background: transparent;
  border: 0;
  text-decoration: underline;
}

.app-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(780px, calc(100vh - 32px));
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--strong-line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.app-dialog::backdrop {
  background: rgba(12, 29, 24, 0.5);
  backdrop-filter: blur(2px);
}

.app-dialog form {
  margin: 0;
}

.dialog-heading {
  min-height: 102px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-heading h2 {
  margin: 4px 0 0;
  font-size: 19px;
}

.dialog-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.dialog-heading code,
.app-dialog label small code {
  color: var(--green-800);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.dialog-close {
  flex: 0 0 auto;
  border-color: transparent;
  background: transparent;
}

.connection-dialog form > label,
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.connection-dialog form > label {
  margin: 18px 24px 0;
}

.app-dialog label > span:first-child,
.form-grid label > span:first-child {
  color: #425049;
  font-size: 12px;
  font-weight: 700;
}

.app-dialog input,
.app-dialog select {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--strong-line);
  border-radius: 5px;
  font-size: 13px;
}

.app-dialog input::placeholder {
  color: #a2aaa6;
}

.app-dialog label small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr 54px;
}

.password-field input {
  border-radius: 5px 0 0 5px;
}

.password-field button {
  color: var(--green-700);
  background: var(--green-050);
  border: 1px solid var(--strong-line);
  border-left: 0;
  border-radius: 0 5px 5px 0;
  font-size: 11px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 14px;
  padding: 20px 24px 4px;
}

.full-field {
  grid-column: 1 / -1;
}

.field-note {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 8px 10px;
  color: #6f5429;
  background: #faf4e8;
  border-left: 3px solid #d2ad58;
  font-size: 11px;
  line-height: 1.5;
}

.field-note strong {
  font-size: 12px;
}

.form-error {
  margin: 14px 24px 0;
  padding: 9px 11px;
  color: #7c3f39;
  background: var(--red-soft);
  border: 1px solid #e7cecb;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1.5;
}

.dialog-actions {
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
}

.security-warning {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: start;
  gap: 11px;
  margin: 20px 24px 0;
  padding: 13px;
  color: #704f1e;
  background: #faf2df;
  border: 1px solid #e6d3a6;
  border-radius: 6px;
}

.security-warning > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--gold);
  border-radius: 50%;
  font-weight: 800;
}

.security-warning strong {
  font-size: 11px;
}

.security-warning p {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.55;
}

.export-summary {
  margin: 18px 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.export-summary > div {
  min-height: 42px;
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  border-bottom: 1px solid #edf0ee;
}

.export-summary > div:last-child {
  border-bottom: 0;
}

.export-summary dt,
.export-summary dd {
  margin: 0;
  font-size: 12px;
}

.export-summary dt {
  color: var(--muted);
}

.export-summary dd {
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confirm-check {
  display: grid;
  grid-template-columns: 17px 1fr;
  align-items: start;
  gap: 8px;
  margin: 18px 24px 0;
  color: #4b5751;
  font-size: 12px;
  line-height: 1.55;
}

.confirm-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green-800);
}

.export-actions {
  grid-template-columns: auto 1fr auto;
}

.danger-text {
  color: var(--red);
}

.toast-region {
  position: fixed;
  z-index: 90;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 230px;
  max-width: 360px;
  display: grid;
  grid-template-columns: 8px 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px 14px;
  color: white;
  background: #22352e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(13, 30, 24, 0.2);
  font-size: 12px;
  line-height: 1.5;
  animation: toast-in 0.2s ease-out;
}

.toast::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 4px;
  background: #86b59f;
  border-radius: 50%;
}

.toast.error::before {
  background: #d98a82;
}

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

@keyframes shimmer {
  to { background-position: -200% 0; }
}

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

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

  .workspace {
    grid-template-columns: 275px minmax(0, 1fr);
    gap: 14px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .metric-strip strong {
    font-size: 20px;
  }

  .metric-strip article {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 940px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 64px;
    display: grid;
    grid-template-columns: 185px minmax(0, 1fr) 180px;
    align-items: center;
  }

  .brand-lockup {
    min-height: 64px;
    padding-left: 14px;
    border-bottom: 0;
  }

  .brand-seal {
    width: 35px;
    height: 40px;
    font-size: 18px;
  }

  .brand-lockup strong {
    font-size: 16px;
  }

  .side-nav {
    min-width: 0;
    flex-direction: row;
    justify-content: center;
    gap: 3px;
    padding: 8px;
    overflow-x: auto;
  }

  .side-nav a {
    min-height: 38px;
    flex: 0 0 auto;
    grid-template-columns: 20px auto;
    padding: 0 8px;
    font-size: 10px;
  }

  .side-nav a.active::before {
    display: none;
  }

  .nav-symbol {
    width: 18px;
    font-size: 14px;
  }

  .sidebar-foot {
    padding: 8px 12px 8px 0;
    border-top: 0;
  }

  .sidebar-foot p {
    display: none;
  }

  .connection-button {
    min-height: 44px;
  }

  .topbar {
    min-height: 76px;
    padding-right: 18px;
    padding-left: 18px;
  }

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

  .campaign-rail {
    position: static;
    max-height: none;
  }

  .campaign-list {
    max-height: 310px;
  }

  .campaign-item {
    min-height: 82px;
  }
}

@media (max-width: 680px) {
  .sidebar {
    grid-template-columns: 1fr auto;
  }

  .side-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
  }

  .sidebar-foot {
    padding-right: 10px;
  }

  .connection-button {
    width: 47px;
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .connection-button > span:not(:first-child) {
    display: none;
  }

  .connection-dot {
    margin: auto;
  }

  .topbar {
    align-items: flex-start;
    padding: 14px;
  }

  .topbar h1 {
    max-width: 178px;
    font-size: 17px;
  }

  .last-updated {
    display: none;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions .primary-button {
    width: 36px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    white-space: nowrap;
  }

  .topbar-actions .primary-button span {
    color: white;
    font-size: 18px;
  }

  .global-notice {
    align-items: flex-start;
    margin: 12px 12px 0;
    padding: 11px;
  }

  .global-notice .secondary-button {
    min-width: 78px;
    padding: 0 8px;
  }

  .workspace {
    gap: 12px;
    padding: 12px 12px 28px;
  }

  .campaign-detail {
    min-height: 560px;
  }

  .detail-placeholder,
  .detail-loading,
  .error-state {
    min-height: 560px;
  }

  .campaign-heading {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 16px;
  }

  .campaign-heading h2 {
    font-size: 19px;
  }

  .campaign-actions {
    width: 100%;
  }

  .campaign-actions button {
    flex: 1;
  }

  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-strip article {
    min-height: 92px;
  }

  .metric-strip strong {
    font-size: 19px;
  }

  .section-title {
    min-height: 92px;
    align-items: flex-start;
    padding: 14px;
  }

  .section-title .secondary-button {
    min-width: 36px;
    padding: 0 9px;
  }

  th,
  td {
    padding-right: 12px;
    padding-left: 12px;
  }

  .dialog-heading {
    padding-right: 17px;
    padding-left: 17px;
  }

  .connection-dialog form > label {
    margin-right: 17px;
    margin-left: 17px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    padding-right: 17px;
    padding-left: 17px;
  }

  .full-field {
    grid-column: auto;
  }

  .form-error,
  .security-warning,
  .export-summary,
  .confirm-check {
    margin-right: 17px;
    margin-left: 17px;
  }

  .dialog-actions {
    padding-right: 17px;
    padding-left: 17px;
  }

  .export-actions {
    grid-template-columns: 1fr 1fr;
  }

  .export-actions span {
    display: none;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    left: 12px;
    align-items: stretch;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
