:root {
  color-scheme: light;
  --canvas: #f6f8fb;
  --canvas-deep: #edf2f6;
  --ink: #17211f;
  --ink-soft: #33423f;
  --muted: #6b7775;
  --muted-strong: #4c5a57;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-warm: #fff9ed;
  --surface-green: #eef8f4;
  --line: #dfe7e5;
  --line-strong: #c7d4d1;
  --shell: #10201d;
  --shell-2: #1f3833;
  --primary: #0d7a65;
  --primary-strong: #075c4c;
  --primary-soft: #e7f4ef;
  --success: #18834c;
  --success-strong: #106136;
  --success-soft: #e8f7ee;
  --danger: #c03a31;
  --danger-strong: #92251e;
  --danger-soft: #fff2f0;
  --warning: #a76a17;
  --warning-soft: #fff5df;
  --blue: #245da8;
  --blue-soft: #edf4ff;
  --focus: #2563eb;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 28px rgba(15, 23, 42, 0.06);
  --shadow-2: 0 24px 70px rgba(15, 23, 42, 0.16);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.05), 0 14px 36px rgba(15, 23, 42, 0.06);
  --shadow-float: 0 18px 48px rgba(15, 23, 42, 0.11);
  --radius: 8px;
  --radius-sm: 6px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

html {
  scrollbar-gutter: stable;
  scrollbar-color: #b9c7c4 transparent;
  scrollbar-width: thin;
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0, rgba(255, 255, 255, 0) 260px),
    linear-gradient(180deg, #f9fbfd 0, var(--canvas) 42%, var(--canvas-deep) 100%);
}

::selection {
  color: #ffffff;
  background: var(--primary);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #b9c7c4;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #9fb1ad;
  background-clip: padding-box;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  display: inline-flex;
  position: relative;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 14px;
  font-weight: 760;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

button:hover {
  transform: translateY(-0.5px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

button:not(:disabled)::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  content: "";
  pointer-events: none;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 11px;
  color: var(--ink);
  background-color: var(--surface);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input::placeholder {
  color: #94a3b8;
}

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

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted-strong) 50%),
    linear-gradient(135deg, var(--muted-strong) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 13px) 18px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 36px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: rgba(37, 99, 235, 0.42);
  outline: 3px solid rgba(37, 99, 235, 0.14);
  outline-offset: 2px;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08), 0 6px 18px rgba(15, 23, 42, 0.06);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: var(--primary);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 780;
}

.app-shell {
  min-height: 100vh;
}

.session-loading-view,
.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
}

.session-loading-panel {
  display: flex;
  width: min(460px, 100%);
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(223, 231, 229, 0.95);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
}

.session-loading-panel h1 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.15;
}

.session-loading-panel .muted {
  margin: 4px 0 0;
  font-size: 0.82rem;
}

.session-spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  margin-left: auto;
  border: 2px solid #d9e5e2;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: session-spin 800ms linear infinite;
}

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

.login-panel {
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.login-panel::before {
  display: block;
  height: 7px;
  background: linear-gradient(90deg, var(--primary), var(--blue), var(--warning));
  content: "";
}

.login-panel > * {
  margin-left: 30px;
  margin-right: 30px;
}

.login-panel > .brand-lockup {
  margin-top: 30px;
}

.login-panel > .setup-message {
  margin-bottom: 30px;
}

.brand-lockup,
.topbar-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: inline-grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius);
  color: #ffffff;
  background: linear-gradient(145deg, var(--primary), var(--blue));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 22px rgba(13, 122, 101, 0.16);
  font-size: 0.82rem;
  font-weight: 900;
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  font-size: 0.72rem;
}

.login-panel h1,
.topbar h1,
.panel-heading h2,
.section-heading h2,
.editor-form h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-panel h1 {
  color: var(--ink);
  font-size: 2rem;
  line-height: 1.08;
}

.topbar h1 {
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.05;
}

.topbar-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.eyebrow {
  margin: 0 0 4px;
  color: #d79a4f;
  font-size: 0.7rem;
  font-weight: 860;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-panel .eyebrow,
.editor-form .eyebrow,
.preset-area .eyebrow,
.panel-heading .eyebrow {
  color: var(--warning);
}

.muted {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.48;
}

.setup-message {
  border: 1px solid #edcfa7;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  margin-top: 16px;
  padding: 12px 13px;
  color: #68431c;
  background: var(--warning-soft);
  font-size: 0.9rem;
  line-height: 1.42;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.login-form + button {
  width: calc(100% - 60px);
  margin-top: 12px;
  margin-bottom: 30px;
}

.admin-view {
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 13px;
  width: min(1800px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px;
  overflow: visible;
}

.topbar,
.toolbar,
.bulk-actions,
.section-heading,
.dialog-actions,
.picker-toolbar,
.panel-heading,
.action-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar {
  position: relative;
  z-index: 30;
  justify-content: space-between;
  min-height: 74px;
  overflow: visible;
  border: 1px solid rgba(223, 231, 229, 0.92);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
}

.topbar::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--blue), var(--warning));
  content: "";
}

.user-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
}

.admin-menu {
  position: relative;
  z-index: 6;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

.admin-menu-details {
  position: relative;
  width: 250px;
}

.admin-menu-details summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  gap: 4px 10px;
  border: 1px solid rgba(201, 222, 215, 0.9);
  border-radius: var(--radius);
  padding: 7px 10px 7px 12px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #f6fbf9);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: pointer;
  list-style: none;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.admin-menu-details summary::-webkit-details-marker {
  display: none;
}

.admin-menu-details summary:hover {
  border-color: #b8d1c8;
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, 0.94);
  transform: translateY(-0.5px);
}

.admin-menu-details summary:focus-visible {
  border-color: rgba(37, 99, 235, 0.42);
  outline: 3px solid rgba(37, 99, 235, 0.14);
  outline-offset: 2px;
}

.admin-menu-details summary::after {
  grid-row: 1 / 3;
  grid-column: 2;
  justify-self: center;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--primary-strong);
  border-bottom: 2px solid var(--primary-strong);
  content: "";
  transform: translateY(-2px) rotate(45deg);
  transition: transform 150ms ease;
}

.admin-menu-details[open] summary {
  border-color: #afcfc5;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.admin-menu-details[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.admin-menu-details summary span {
  grid-column: 1;
  color: var(--warning);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.admin-menu-details summary strong {
  grid-column: 1;
  overflow: hidden;
  color: var(--primary-strong);
  font-size: 0.92rem;
  font-weight: 880;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  display: grid;
  width: 100%;
  gap: 4px;
  border: 1px solid rgba(201, 222, 215, 0.96);
  border-radius: var(--radius);
  padding: 6px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  -webkit-user-select: none;
  user-select: none;
}

.admin-menu-list a {
  display: flex;
  min-height: 36px;
  align-items: center;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  color: var(--muted-strong);
  font-size: 0.84rem;
  font-weight: 820;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.admin-menu-list a:hover,
.admin-menu-list a.is-active {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.admin-menu-list a:hover {
  transform: translateX(1px);
}

.connection-chip,
.user-email {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 11px;
  color: var(--muted-strong);
  background: var(--surface-soft);
  font-size: 0.86rem;
  font-weight: 720;
}

.connection-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.connection-chip span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.16);
}

.user-email {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-email:empty {
  display: none;
}

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

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

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

.metric-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 74px;
  overflow: hidden;
  border: 1px solid rgba(223, 231, 229, 0.95);
  border-radius: var(--radius);
  padding: 12px 14px;
  background:
    linear-gradient(180deg, #ffffff, #fbfcfd);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.metric-card:hover {
  border-color: #d3dfdc;
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  transform: translateY(-1px);
}

.metric-card::before {
  position: absolute;
  inset: 11px auto 11px 0;
  width: 4px;
  height: auto;
  border-radius: 0 999px 999px 0;
  background: var(--primary);
  content: "";
}

.metric-card.active::before {
  background: var(--success);
}

.metric-card.disabled::before {
  background: var(--danger);
}

.metric-card.selected::before {
  background: var(--warning);
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 780;
}

.metric-card strong {
  grid-row: 1 / 3;
  grid-column: 2;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.metric-card small {
  align-self: start;
  margin-top: 4px;
  font-size: 0.72rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 13px;
  min-height: 0;
}

.channel-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.side-stack {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.channel-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.operations-admin-view {
  grid-template-rows: auto minmax(0, 1fr);
}

.operations-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  border: 1px solid rgba(223, 231, 229, 0.95);
  border-radius: var(--radius);
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.operations-heading {
  align-items: end;
  margin-bottom: 12px;
}

.operations-list-picker {
  width: min(260px, 100%);
  margin-left: auto;
}

.operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) 360px;
  gap: 12px;
  min-height: min(70vh, 760px);
}

.operations-grid .preset-area,
.operations-grid .availability-area,
.operations-grid .sponsor-area {
  min-height: 0;
  max-height: none;
}

.control-panel,
.preset-area,
.sponsor-area,
.availability-area,
.campaign-area,
.campaign-table-shell,
.table-shell {
  border: 1px solid rgba(223, 231, 229, 0.95);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff, #fbfcfd);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.control-panel {
  margin-bottom: 10px;
  padding: 12px;
}

.panel-heading {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.panel-heading h2 {
  font-size: 1.08rem;
  line-height: 1.15;
}

.toolbar {
  display: grid;
  grid-template-columns: 180px minmax(300px, 1fr) 180px;
  align-items: end;
  gap: 10px;
  padding-top: 12px;
}

.bulk-actions {
  justify-content: space-between;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.action-group {
  flex-wrap: wrap;
}

.action-group-strong {
  justify-content: flex-end;
  margin-left: auto;
}

.bulk-actions button {
  min-height: 36px;
}

.table-shell {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: min(68vh, 720px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.table-footer {
  position: sticky;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  font-size: 0.82rem;
  font-weight: 780;
}

.page-size-field {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
}

.page-size-field select {
  width: 86px;
  min-height: 36px;
}

.pagination-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pagination-actions button {
  min-height: 34px;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.col-check {
  width: 50px;
}

.col-id {
  width: 74px;
}

.col-order {
  width: 76px;
}

.col-channel {
  width: 306px;
}

.col-status {
  width: 128px;
}

.col-type {
  width: 92px;
}

.col-actions {
  width: 178px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted-strong);
  background: linear-gradient(180deg, #fbfcfd, #f2f6f7);
  box-shadow: inset 0 -1px 0 var(--line);
  font-size: 0.7rem;
  font-weight: 880;
  text-transform: uppercase;
}

td {
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
}

tbody tr {
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

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

tbody tr.is-selected td {
  background: #eef7ff;
}

tbody tr.is-muted td {
  color: var(--muted);
  background: #fff9f8;
}

tbody tr.is-muted:hover td {
  background: #fff4f2;
}

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

th:last-child,
td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  overflow: hidden;
  text-align: right;
}

th:last-child {
  z-index: 3;
  box-shadow: inset 1px 0 0 var(--line), inset 0 -1px 0 var(--line);
}

td:last-child {
  box-shadow: inset 1px 0 0 var(--line);
}

.channel-cell {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.channel-avatar {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #cddfd8;
  border-radius: var(--radius);
  color: var(--primary-strong);
  background: linear-gradient(180deg, #ffffff, #edf8f4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  font-size: 0.72rem;
  font-weight: 900;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

tbody tr:hover .channel-avatar {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 8px 18px rgba(13, 122, 101, 0.12);
  transform: translateY(-1px);
}

.channel-name {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.channel-name strong,
.channel-name span,
.channel-note,
.url-cell,
.stream-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-name strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 860;
}

.channel-name span,
.channel-note,
.url-cell {
  color: var(--muted);
  font-size: 0.78rem;
}

.channel-note {
  color: #8b5a22;
  font-style: normal;
}

.category-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.category-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border: 1px solid #c7dcef;
  border-radius: 999px;
  padding: 0 7px;
  color: #31506f;
  background: var(--blue-soft);
  font-size: 0.7rem;
  font-weight: 820;
}

.id-chip,
.order-chip,
.type-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid #d8e3e1;
  border-radius: var(--radius);
  padding: 0 8px;
  color: var(--muted-strong);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  font-size: 0.76rem;
  font-weight: 820;
}

.id-chip {
  font-variant-numeric: tabular-nums;
}

.type-chip {
  color: #31506f;
  background: var(--blue-soft);
  border-color: #c9dbef;
}

.url-cell {
  display: block;
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.url-stack {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.stream-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.stream-status {
  display: inline-flex;
  max-width: 142px;
  min-height: 24px;
  align-items: center;
  border: 1px solid #d8e3e1;
  border-radius: var(--radius);
  padding: 0 8px;
  color: var(--muted-strong);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  font-size: 0.72rem;
  font-weight: 840;
}

.check-online {
  border-color: #bfe3cc;
  color: var(--success-strong);
  background: var(--success-soft);
}

.check-failed,
.check-invalid {
  border-color: #f4beb7;
  color: var(--danger-strong);
  background: var(--danger-soft);
}

.check-warning,
.check-blocked {
  border-color: #ead0a8;
  color: #80521f;
  background: var(--warning-soft);
}

.check-checking {
  border-color: #bcd8cd;
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.check-button {
  min-height: 26px;
  border-color: #cddfd8;
  padding: 0 9px;
  color: var(--primary-strong);
  background: #ffffff;
  font-size: 0.72rem;
}

.check-button:hover {
  background: var(--primary-soft);
}

.copy-url-button {
  position: relative;
  display: inline-flex;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-color: #cddfd8;
  padding: 0;
  color: var(--primary-strong);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.copy-url-icon {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  transition: transform 150ms ease;
}

.copy-url-button:hover {
  background: var(--primary-soft);
}

.copy-url-button:hover .copy-url-icon {
  transform: translateY(-0.5px);
}

.copy-url-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 9px;
  font-size: 0.74rem;
  font-weight: 860;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.status-pill > span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.status-active {
  border-color: #b9e3ca;
  color: var(--success-strong);
  background: linear-gradient(180deg, #f7fffa, var(--success-soft));
}

.status-active > span {
  background: var(--success);
}

.status-deleted {
  border-color: #f2c3bd;
  color: var(--danger-strong);
  background: linear-gradient(180deg, #fffafa, var(--danger-soft));
}

.status-deleted > span {
  background: var(--danger);
}

.status-warning {
  border-color: #ead0a8;
  color: #80521f;
  background: linear-gradient(180deg, #fffdf8, var(--warning-soft));
}

.status-warning > span {
  background: var(--warning);
}

.status-draft {
  border-color: #c9d8e7;
  color: #365872;
  background: linear-gradient(180deg, #ffffff, #edf4fb);
}

.status-draft > span {
  background: #6387a5;
}

.row-actions {
  display: grid;
  grid-template-columns: 60px 78px;
  justify-content: end;
  gap: 7px;
  max-width: 100%;
  min-width: 0;
}

.row-actions button {
  min-width: 0;
  min-height: 34px;
  padding: 0 7px;
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
}

.row-actions [data-action="edit"] {
  width: 60px;
}

.row-actions [data-action="toggle"] {
  width: 78px;
}

.row-actions [data-action="test"] {
  width: 64px;
}

.campaign-row-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

.campaign-row-actions [data-action] {
  width: auto;
}

.button-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 900;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(180deg, #10846d, var(--primary));
  box-shadow: 0 10px 22px rgba(13, 122, 101, 0.16);
}

.primary-button:hover {
  background: var(--primary-strong);
  box-shadow: 0 14px 30px rgba(13, 122, 101, 0.22);
}

.secondary-button {
  color: var(--primary-strong);
  border-color: #c9ded7;
  background: linear-gradient(180deg, #f8fffc, var(--primary-soft));
}

.secondary-button:hover {
  background: #dff2eb;
}

.ghost-button {
  color: var(--ink);
  border-color: #d4dfdd;
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
}

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

.danger-button {
  color: #ffffff;
  background: linear-gradient(180deg, #cf463d, var(--danger));
  box-shadow: 0 10px 22px rgba(192, 58, 49, 0.13);
}

.danger-button:hover {
  background: var(--danger-strong);
  box-shadow: 0 14px 30px rgba(192, 58, 49, 0.2);
}

.success-button {
  color: #ffffff;
  background: linear-gradient(180deg, #229158, var(--success));
  box-shadow: 0 10px 22px rgba(24, 131, 76, 0.13);
}

.success-button:hover {
  background: var(--success-strong);
  box-shadow: 0 14px 30px rgba(24, 131, 76, 0.2);
}

.text-button {
  color: var(--primary-strong);
  border-color: #cddfd8;
  background: linear-gradient(180deg, #ffffff, #fbfdfc);
}

.text-button:hover {
  background: var(--primary-soft);
}

.preset-area,
.sponsor-area,
.availability-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.sponsor-area {
  grid-template-rows: auto auto;
  align-self: start;
  border-color: #c9ded7;
  background: #fbfefd;
}

.availability-area {
  grid-template-rows: auto minmax(0, 1fr);
  align-self: start;
  border-color: #d9e5e2;
  background: #ffffff;
}

.sponsor-area .section-heading {
  margin-bottom: 9px;
  padding-bottom: 9px;
}

.sponsor-area .eyebrow {
  color: var(--primary-strong);
}

.section-heading {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin-bottom: 11px;
  padding-bottom: 11px;
}

.section-heading > div {
  min-width: 0;
  flex: 1 1 auto;
}

.section-heading h2 {
  color: var(--ink);
  font-size: 1.06rem;
  line-height: 1.18;
}

.preset-area .eyebrow,
.preset-area .section-heading h2,
.availability-area .eyebrow,
.availability-area .section-heading h2 {
  white-space: nowrap;
}

.section-heading .secondary-button {
  flex: 0 0 auto;
  min-height: 36px;
}

.preset-list {
  display: grid;
  grid-column: 1;
  grid-row: 2;
  align-content: start;
  gap: 10px;
  overflow: auto;
}

.rule-list {
  display: grid;
  align-content: start;
  gap: 9px;
  overflow: auto;
}

#availabilityRuleEmptyState {
  grid-column: 1;
  grid-row: 2;
}

#presetEmptyState {
  grid-column: 1;
  grid-row: 2;
}

.preset-item {
  border: 1px solid #dfe7e5;
  border-radius: var(--radius);
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.rule-item {
  border: 1px solid #dfe7e5;
  border-radius: var(--radius);
  padding: 11px;
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.rule-item.is-inactive {
  opacity: 0.68;
}

.preset-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.rule-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.preset-title strong {
  overflow-wrap: anywhere;
}

.rule-title strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.preset-meta,
.preset-channels,
.rule-meta,
.rule-channels {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.42;
}

.preset-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 12px;
}

.rule-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: stretch;
  gap: 7px;
  margin-top: 10px;
}

.rule-actions button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 0.76rem;
}

.preset-actions button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.8rem;
}

.sponsor-summary {
  display: grid;
  gap: 9px;
}

.sponsor-preview-image {
  width: 100%;
  aspect-ratio: 5 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.sponsor-summary-body {
  display: grid;
  gap: 6px;
}

.sponsor-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sponsor-title-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sponsor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 2px;
}

.sponsor-actions button {
  min-width: 0;
}

.campaign-area {
  min-width: 0;
  padding: 12px;
}

.campaign-admin-view {
  grid-template-rows: auto minmax(0, 1fr);
}

.legal-admin-view {
  grid-template-rows: auto minmax(0, 1fr);
}

.manual-admin-view {
  grid-template-rows: auto minmax(0, 1fr);
}

.campaign-page-area,
.legal-page-area {
  align-self: start;
}

.campaign-heading {
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.campaign-app-picker {
  width: min(360px, 100%);
  margin-left: auto;
}

.legal-custom-package-field {
  margin-left: 0;
}

.campaign-app-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -2px 0 10px;
}

.campaign-app-summary span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid #d8e3e1;
  border-radius: var(--radius);
  padding: 0 8px;
  color: var(--muted-strong);
  background: #f8fafc;
  font-size: 0.76rem;
  font-weight: 820;
}

.campaign-app-summary span:empty {
  display: none;
}

.campaign-bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border: 1px solid #dfe7e5;
  border-radius: var(--radius);
  margin-bottom: 10px;
  padding: 8px 10px;
  color: var(--muted-strong);
  background: #f8fafc;
  font-size: 0.8rem;
  font-weight: 820;
}

.campaign-bulk-toolbar button {
  min-height: 34px;
}

.legal-table-shell code {
  display: block;
  max-width: min(520px, 46vw);
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legal-cell,
.legal-meta {
  display: grid;
  gap: 4px;
}

.legal-cell strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.legal-cell span,
.legal-cell em,
.legal-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 760;
}

.legal-row-actions {
  justify-content: flex-end;
}

.legal-url-row {
  align-items: center;
}

.legal-url-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
}

.legal-url-input-row .copy-url-button {
  width: 34px;
  min-width: 34px;
  height: 42px;
  min-height: 42px;
}

.legal-pdf-tool {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(201, 222, 215, 0.9);
  border-radius: var(--radius);
  margin-top: 14px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(232, 248, 242, 0.62), rgba(255, 255, 255, 0.96) 48%),
    #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.legal-pdf-heading {
  align-items: flex-start;
  justify-content: space-between;
  margin: 0;
}

.legal-pdf-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.1rem;
  letter-spacing: 0;
}

.legal-pdf-heading .section-copy {
  max-width: 680px;
}

.legal-sample-button {
  white-space: nowrap;
}

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

.legal-pdf-grid .wide {
  grid-column: 1 / -1;
}

.legal-pdf-markdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 10px;
  align-items: stretch;
}

.legal-pdf-markdown-row > label {
  min-width: 0;
}

.legal-pdf-grid textarea {
  min-height: 260px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.48;
}

.legal-md-preview-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(216, 227, 225, 0.95);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.legal-md-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: linear-gradient(180deg, #ffffff, #f8fbfa);
}

.legal-md-preview-heading span {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 880;
}

.legal-md-preview-heading small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.legal-md-preview {
  max-height: 360px;
  margin-top: 0;
  overflow: auto;
  padding: 14px;
  background: #ffffff;
  font-size: 0.9rem;
  line-height: 1.62;
}

.legal-md-preview.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(232, 248, 242, 0.42), rgba(255, 255, 255, 0.92)),
    #ffffff;
}

.legal-md-preview-empty {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.legal-dialog-preview .legal-md-preview {
  max-height: 280px;
}

.legal-export-options {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(216, 227, 225, 0.95);
  border-radius: var(--radius);
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(232, 248, 242, 0.42), rgba(255, 255, 255, 0.96)),
    #ffffff;
}

.legal-export-options-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.legal-export-options-heading span {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 880;
}

.legal-export-options-heading small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

.legal-export-grid .wide {
  grid-column: 1 / -1;
}

.legal-pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.legal-pdf-actions button {
  display: inline-flex;
  min-height: 44px;
  min-width: 180px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.legal-pdf-actions button small {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 7px 2px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.3;
  opacity: 0.78;
}

.dialog-export-actions {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(74px, 1fr));
  gap: 8px;
}

.dialog-export-actions button {
  min-height: 38px;
  min-width: 0;
  padding-inline: 12px;
}

.legal-view-body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0, rgba(255, 255, 255, 0) 280px),
    linear-gradient(180deg, #f9fbfd 0, var(--canvas) 42%, var(--canvas-deep) 100%);
}

.legal-view-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 42px) 14px;
}

.legal-view-document {
  border: 1px solid rgba(223, 231, 229, 0.95);
  border-radius: var(--radius);
  padding: clamp(18px, 4vw, 34px);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.legal-view-header {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.legal-view-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.45rem, 4vw, 2.2rem);
  line-height: 1.08;
}

.legal-view-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 720;
  line-height: 1.45;
}

.legal-view-content {
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 1rem;
  font-weight: 520;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.legal-view-content.is-plain {
  white-space: pre-wrap;
}

.legal-view-content.is-markdown {
  white-space: normal;
}

.legal-view-content h2,
.legal-view-content h3,
.legal-view-content h4,
.legal-view-content h5,
.legal-view-content h6 {
  margin: 1.25em 0 0.4em;
  color: var(--ink);
  line-height: 1.18;
}

.legal-view-content h2 {
  font-size: 1.32rem;
}

.legal-view-content h3 {
  font-size: 1.12rem;
}

.legal-view-content h4 {
  font-size: 1rem;
}

.legal-view-content h5,
.legal-view-content h6 {
  font-size: 0.94rem;
}

.legal-view-content p,
.legal-view-content ul,
.legal-view-content ol,
.legal-view-content blockquote,
.legal-view-content table {
  margin: 0 0 1em;
}

.legal-view-content ul,
.legal-view-content ol {
  padding-left: 1.35rem;
}

.legal-view-content li + li {
  margin-top: 0.32em;
}

.legal-view-content .task-list-item {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  list-style: none;
}

.legal-view-content .task-list-item + .task-list-item {
  margin-top: 0.45em;
}

.legal-md-checkbox {
  display: inline-flex;
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #b8c9c5;
  border-radius: 4px;
  margin-top: 0.24em;
  background: #ffffff;
}

.legal-md-checkbox.is-checked {
  border-color: var(--primary);
  background: var(--primary);
}

.legal-md-checkbox.is-checked::after {
  width: 0.42rem;
  height: 0.22rem;
  border-bottom: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  content: "";
  transform: rotate(-45deg) translate(1px, -1px);
}

.legal-view-content a {
  color: var(--primary-strong);
  font-weight: 760;
}

.legal-view-content del {
  color: var(--muted);
}

.legal-md-inline-image {
  display: block;
  max-width: min(100%, 520px);
  max-height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0.35rem 0;
  object-fit: contain;
  background: var(--surface-soft);
}

.legal-view-content blockquote {
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.72rem 0.9rem;
  color: var(--muted-strong);
  background: var(--primary-soft);
}

.legal-view-content code {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.12rem 0.34rem;
  color: var(--primary-strong);
  background: var(--surface-soft);
  font-size: 0.92em;
}

.legal-md-code-block {
  position: relative;
  margin: 0 0 1em;
}

.legal-md-code-language {
  position: absolute;
  top: 7px;
  right: 10px;
  z-index: 1;
  border: 1px solid rgba(201, 222, 215, 0.9);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.66rem;
  font-weight: 860;
  text-transform: uppercase;
}

.legal-view-content pre {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0;
  padding: 0.9rem;
  background: #f3f7f6;
  font-size: 0.9em;
  line-height: 1.5;
}

.legal-view-content pre code {
  display: block;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1em;
  white-space: pre;
}

.legal-md-table-wrap {
  max-width: 100%;
  overflow: auto;
  margin: 0 0 1em;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.legal-view-content table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.9em;
  line-height: 1.45;
}

.legal-view-content th,
.legal-view-content td {
  border-bottom: 1px solid var(--line);
  padding: 0.68rem 0.78rem;
  text-align: left;
  vertical-align: top;
}

.legal-view-content th {
  color: var(--primary-strong);
  background: #eef8f4;
  font-weight: 860;
}

.legal-view-content tr:last-child td {
  border-bottom: 0;
}

.legal-view-content .align-center {
  text-align: center;
}

.legal-view-content .align-right {
  text-align: right;
}

.legal-view-content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.3rem 0;
}

.section-copy {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.manual-shell {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.manual-hero,
.manual-section,
.manual-index {
  border: 1px solid rgba(223, 231, 229, 0.95);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.manual-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 12px;
  align-items: stretch;
  overflow: hidden;
  padding: 16px;
}

.manual-hero h2 {
  margin: 0;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1.04;
}

.manual-hero p {
  max-width: 760px;
  margin: 9px 0 0;
  color: var(--muted-strong);
  font-size: 0.96rem;
  line-height: 1.5;
}

.manual-hero-note {
  display: grid;
  align-content: center;
  gap: 7px;
  border: 1px solid #c9ded7;
  border-radius: var(--radius);
  padding: 14px;
  color: var(--primary-strong);
  background: linear-gradient(180deg, #f8fffc, var(--primary-soft));
}

.manual-hero-note strong {
  color: var(--ink);
  font-size: 1rem;
}

.manual-hero-note span {
  color: var(--muted-strong);
  font-size: 0.86rem;
  font-weight: 720;
  line-height: 1.45;
}

.manual-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 0;
}

.manual-index {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 6px;
  padding: 10px;
}

.manual-index a {
  display: flex;
  min-height: 36px;
  align-items: center;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 820;
  text-decoration: none;
}

.manual-index a:hover {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.manual-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.manual-section {
  padding: 14px;
  scroll-margin-top: 14px;
}

.manual-section .section-heading {
  margin-bottom: 12px;
}

.manual-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.18;
}

.manual-section p {
  color: var(--muted-strong);
  line-height: 1.5;
}

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

.manual-table + .manual-scenarios,
.manual-scenarios + .manual-table,
.manual-steps + .manual-table {
  margin-top: 10px;
}

.manual-rule-list article,
.manual-scenarios article,
.manual-emergency-grid article {
  border: 1px solid #dfe7e5;
  border-radius: var(--radius);
  padding: 12px;
  background: #ffffff;
}

.manual-rule-list strong,
.manual-scenarios strong,
.manual-emergency-grid strong {
  display: block;
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.25;
}

.manual-rule-list p,
.manual-scenarios p,
.manual-emergency-grid p {
  margin: 7px 0 0;
  font-size: 0.84rem;
}

.manual-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted-strong);
  font-size: 0.9rem;
  line-height: 1.48;
}

.manual-callout {
  border: 1px solid #c9ded7;
  border-radius: var(--radius);
  margin: 12px 0 0;
  padding: 11px 12px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 0.86rem;
  font-weight: 760;
}

.manual-callout.warning {
  border-color: #efd6a9;
  color: #7a4c0d;
  background: var(--warning-soft);
}

.manual-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.manual-table div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 12px;
  background: #ffffff;
}

.manual-table div + div {
  border-top: 1px solid var(--line);
}

.manual-table strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.manual-table span {
  color: var(--muted-strong);
  font-size: 0.86rem;
  line-height: 1.45;
}

.manual-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid #c9ded7;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  padding: 0 7px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 0.72rem;
  font-weight: 850;
}

.manual-release-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.manual-release-flow span {
  display: flex;
  min-height: 52px;
  align-items: center;
  border: 1px solid #d8e3e1;
  border-radius: var(--radius);
  padding: 10px;
  color: var(--ink);
  background: #f8fafc;
  font-size: 0.82rem;
  font-weight: 820;
  line-height: 1.25;
}

.campaign-table-shell {
  overflow: auto;
}

.campaign-table-shell table {
  min-width: 1210px;
}

.col-campaign {
  width: 260px;
}

.col-campaign-type {
  width: 110px;
}

.col-campaign-status {
  width: 110px;
}

.col-campaign-schedule {
  width: 190px;
}

.col-campaign-metrics {
  width: 260px;
}

.col-campaign-actions {
  width: 230px;
}

.campaign-cell,
.metric-stack,
.schedule-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.campaign-cell strong,
.campaign-cell span,
.campaign-cell em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-cell strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.campaign-cell span,
.campaign-cell em,
.metric-stack,
.schedule-cell {
  color: var(--muted);
  font-size: 0.78rem;
}

.schedule-cell {
  line-height: 1.38;
}

.campaign-cell em {
  font-style: normal;
}

.metric-stack {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  color: var(--muted-strong);
}

.metric-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-items: stretch;
  min-width: 0;
  border: 1px solid #dfe7e5;
  border-radius: 8px;
  padding: 6px 8px;
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.metric-group-title {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.metric-row,
.metric-empty {
  display: grid;
  min-width: 0;
  gap: 2px;
  line-height: 1.2;
}

.metric-row strong {
  color: var(--ink);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.metric-empty {
  color: var(--muted);
  font-weight: 760;
}

.metric-group.is-muted {
  border-style: dashed;
  opacity: 0.72;
}

.empty-state {
  display: grid;
  min-height: 170px;
  place-items: center;
  padding: 26px 16px;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: 112px;
}

.editor-dialog {
  width: min(820px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  border: 1px solid rgba(223, 231, 229, 0.95);
  border-radius: var(--radius);
  padding: 0;
  background: #ffffff;
  box-shadow: var(--shadow-float);
}

.editor-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
}

.editor-form {
  display: grid;
  max-height: calc(100vh - 24px);
  overflow: auto;
  gap: 16px;
  padding: 18px;
  background:
    linear-gradient(180deg, #ffffff, #fbfcfd);
}

.editor-form header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  color: var(--muted);
  border-color: var(--line);
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
}

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

.scope-summary {
  display: grid;
  gap: 5px;
  border: 1px solid #d8e6e1;
  border-radius: var(--radius);
  padding: 12px;
  background: var(--primary-soft);
}

.scope-summary strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.scope-summary span {
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 680;
  line-height: 1.38;
}

.availability-form-grid label[hidden] {
  display: none;
}

.dialog-message {
  margin: 0;
  border: 1px solid #edcfa7;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: #68431c;
  background: var(--warning-soft);
  font-size: 0.82rem;
  font-weight: 680;
  line-height: 1.42;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.category-fieldset {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0;
  padding: 12px;
  background: var(--surface-soft);
}

.category-fieldset legend {
  padding: 0 6px;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 840;
}

.category-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--ink);
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 780;
}

.field-help {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 620;
  line-height: 1.35;
}

.campaign-media-fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: linear-gradient(180deg, #f8fbfa, #ffffff);
}

.campaign-media-fieldset legend {
  padding: 0 6px;
  color: var(--primary-strong);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.campaign-media-grid label {
  display: grid;
  align-content: start;
  gap: 6px;
}

.campaign-media-grid input[type="file"],
.sponsor-form-grid input[type="file"] {
  padding: 8px;
  background: #ffffff;
}

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

.toggle-grid label {
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface-soft);
}

.toggle-grid input,
.preset-channel-picker input,
td input[type="checkbox"] {
  width: auto;
  min-height: auto;
  accent-color: var(--primary);
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.spacer {
  flex: 1 1 auto;
}

.preset-picker {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.picker-toolbar {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: var(--surface-green);
}

.preset-channel-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 280px;
  overflow: auto;
}

.preset-channel-picker label {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 9px 11px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 560;
}

.dialog-message {
  margin: 0 18px;
  border: 1px solid rgba(189, 63, 50, 0.22);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  color: #8c2e26;
  background: rgba(189, 63, 50, 0.09);
  font-size: 0.9rem;
  font-weight: 650;
}

.dialog-message[data-tone="info"] {
  border-color: rgba(22, 130, 118, 0.22);
  color: #0f6f64;
  background: rgba(22, 130, 118, 0.1);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(440px, calc(100vw - 36px));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 13px 15px;
  color: #ffffff;
  background: linear-gradient(180deg, #152521, var(--shell));
  box-shadow: var(--shadow-float);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 1440px) {
  .admin-view {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    min-height: auto;
    overflow: visible;
  }

  .operations-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: auto;
  }

  .operations-grid .sponsor-area {
    grid-column: 1 / -1;
  }

  .side-stack {
    grid-template-rows: auto auto auto;
  }

  .channel-area {
    grid-template-rows: auto auto;
  }

  .table-shell {
    min-height: min(68vh, 660px);
  }

  .preset-area {
    min-height: 260px;
    max-height: 360px;
  }

  .sponsor-area {
    min-height: 220px;
  }

  .availability-area {
    min-height: 220px;
    max-height: 320px;
  }
}

@media (max-width: 980px) {
  body {
    background:
      linear-gradient(180deg, #ffffff 0, var(--canvas) 48%, var(--canvas-deep) 100%);
  }

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

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

  .operations-heading {
    display: grid;
    align-items: stretch;
  }

  .operations-list-picker {
    width: 100%;
    margin-left: 0;
  }

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

  .toolbar .search-field {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .action-group-strong {
    justify-content: flex-start;
    margin-left: 0;
  }

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

  .manual-index {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .manual-index a {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 720px) {
  .login-view {
    align-items: stretch;
    padding: 12px;
  }

  .login-panel {
    align-self: center;
  }

  .login-panel > * {
    margin-left: 20px;
    margin-right: 20px;
  }

  .login-form + button {
    width: calc(100% - 40px);
  }

  .admin-view {
    gap: 10px;
    padding: 8px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    gap: 9px;
    padding: 10px;
  }

  .topbar-title {
    gap: 10px;
    width: 100%;
  }

  .brand-mark.small {
    width: 36px;
    height: 36px;
  }

  .topbar h1 {
    font-size: 1.28rem;
  }

  .topbar .eyebrow {
    margin-bottom: 2px;
    font-size: 0.62rem;
  }

  .topbar-copy {
    display: none;
  }

  .user-area {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    gap: 7px;
  }

  .admin-menu {
    grid-column: 1 / -1;
    width: 100%;
  }

  .admin-menu-details {
    width: 100%;
  }

  .admin-menu-details summary {
    width: 100%;
    min-height: 44px;
    padding: 7px 11px;
  }

  .admin-menu-list {
    right: auto;
    left: 0;
    width: 100%;
  }

  .connection-chip {
    display: none;
  }

  .user-email {
    min-width: 0;
    min-height: 34px;
    max-width: 100%;
    padding: 7px 9px;
    font-size: 0.78rem;
  }

  .topbar .ghost-button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.82rem;
  }

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

  .metric-card {
    min-height: 62px;
    padding: 10px 11px;
  }

  .metric-card strong {
    font-size: 1.65rem;
  }

  .metric-card small {
    font-size: 0.66rem;
  }

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

  .toolbar .search-field {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .control-panel,
  .campaign-area,
  .manual-section {
    padding: 10px;
  }

  .manual-hero {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .manual-hero h2 {
    font-size: 1.48rem;
  }

  .manual-hero p {
    font-size: 0.88rem;
  }

  .manual-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
  }

  .manual-index a {
    min-height: 34px;
    font-size: 0.76rem;
  }

  .manual-rule-list,
  .manual-scenarios,
  .manual-emergency-grid,
  .manual-release-flow {
    grid-template-columns: 1fr;
  }

  .manual-table div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .panel-heading {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    padding-bottom: 10px;
  }

  .panel-heading h2,
  .section-heading h2 {
    font-size: 1rem;
  }

  .panel-heading,
  .section-heading,
  .bulk-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-heading .primary-button,
  .section-heading .primary-button,
  .section-heading .secondary-button {
    width: 100%;
  }

  .bulk-actions {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
  }

  .action-group,
  .action-group-strong {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-left: 0;
  }

  .bulk-actions button {
    width: auto;
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.78rem;
  }

  #presetFromSelectionButton {
    grid-column: 1 / -1;
  }

  .table-shell,
  .campaign-table-shell {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .table-shell table,
  .table-shell tbody,
  .table-shell tr,
  .table-shell td,
  .campaign-table-shell table,
  .campaign-table-shell tbody,
  .campaign-table-shell tr,
  .campaign-table-shell td {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .table-shell table,
  .campaign-table-shell table {
    min-width: 0;
    border-collapse: separate;
  }

  .table-shell thead,
  .table-shell colgroup,
  .campaign-table-shell thead,
  .campaign-table-shell colgroup {
    display: none;
  }

  .table-shell tbody,
  .campaign-table-shell tbody {
    display: grid;
    gap: 10px;
  }

  .table-shell tr,
  .campaign-table-shell tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid rgba(223, 231, 229, 0.95);
    border-radius: var(--radius);
    background:
      linear-gradient(180deg, #ffffff, #fbfcfd);
    box-shadow: var(--shadow-card);
  }

  .table-shell td,
  .table-shell td:last-child,
  .campaign-table-shell td,
  .campaign-table-shell td:last-child {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 5px;
    border-bottom: 1px solid var(--line);
    padding: 9px 12px;
    text-align: left;
    box-shadow: none;
  }

  .table-shell td::before,
  .campaign-table-shell td::before {
    content: attr(data-label);
    color: var(--muted-strong);
    font-size: 0.66rem;
    font-weight: 880;
    text-transform: uppercase;
  }

  .table-shell td[data-label="Seleccion"],
  .campaign-table-shell td[data-label="Seleccion"] {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .table-shell td[data-label="Seleccion"]::before,
  .campaign-table-shell td[data-label="Seleccion"]::before {
    content: "Seleccionar";
  }

  .table-shell td[data-label="Canal"],
  .table-shell td[data-label="URL"],
  .table-shell td[data-label="Acciones"],
  .campaign-table-shell td[data-label="Documento"],
  .campaign-table-shell td[data-label="URL"],
  .campaign-table-shell td[data-label="Campana"],
  .campaign-table-shell td[data-label="Programacion"],
  .campaign-table-shell td[data-label="Metricas"],
  .campaign-table-shell td[data-label="Acciones"] {
    grid-column: 1 / -1;
  }

  .table-shell td[data-label="Canal"]::before,
  .table-shell td[data-label="URL"]::before,
  .table-shell td[data-label="Acciones"]::before,
  .campaign-table-shell td[data-label="Documento"]::before,
  .campaign-table-shell td[data-label="URL"]::before,
  .campaign-table-shell td[data-label="Campana"]::before,
  .campaign-table-shell td[data-label="Programacion"]::before,
  .campaign-table-shell td[data-label="Metricas"]::before,
  .campaign-table-shell td[data-label="Acciones"]::before {
    margin-bottom: 2px;
  }

  .table-shell td:last-child,
  .campaign-table-shell td:last-child {
    border-bottom: 0;
  }

  .table-shell .channel-cell {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .table-shell .url-row {
    grid-template-columns: minmax(0, 1fr) 28px;
  }

  .table-shell .stream-tools,
  .table-shell .row-actions,
  .campaign-table-shell .row-actions {
    justify-content: flex-start;
  }

  .table-shell .row-actions,
  .campaign-table-shell .campaign-row-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-shell .row-actions [data-action],
  .campaign-table-shell .row-actions [data-action] {
    width: auto;
  }

  .campaign-table-shell .campaign-row-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .legal-table-shell code {
    max-width: 100%;
  }

  .legal-url-row {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .legal-pdf-tool {
    padding: 10px;
  }

  .legal-pdf-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .legal-pdf-grid {
    grid-template-columns: 1fr;
  }

  .legal-pdf-markdown-row {
    grid-template-columns: 1fr;
  }

  .legal-pdf-grid textarea {
    min-height: 220px;
  }

  .legal-md-preview {
    max-height: 260px;
    padding: 12px;
  }

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

  .legal-pdf-actions,
  .legal-pdf-actions button {
    width: 100%;
  }

  .dialog-export-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .campaign-table-shell .metric-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .campaign-table-shell .metric-group {
    padding: 6px;
  }

  .campaign-table-shell .metric-row,
  .campaign-table-shell .metric-empty {
    display: grid;
    gap: 2px;
  }

  .table-shell .table-footer {
    position: static;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-top: 10px;
  }

  .campaign-heading {
    gap: 8px;
    margin-bottom: 10px;
  }

  .campaign-heading .section-copy {
    display: none;
  }

  .campaign-app-picker {
    width: 100%;
    margin-left: 0;
  }

  .campaign-app-summary {
    gap: 6px;
    margin-bottom: 8px;
  }

  .campaign-app-summary span {
    max-width: 100%;
    min-height: 26px;
    font-size: 0.7rem;
  }

  .campaign-bulk-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
  }

  .campaign-bulk-toolbar button {
    min-height: 32px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .form-grid,
  .campaign-media-grid,
  .availability-form-grid,
  .toggle-grid,
  .sponsor-actions,
  .preset-channel-picker {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .spacer {
    display: none;
  }
}

@media (max-width: 340px) {
  .toolbar,
  .action-group,
  .action-group-strong,
  .campaign-bulk-toolbar {
    grid-template-columns: 1fr;
  }

  #presetFromSelectionButton {
    grid-column: auto;
  }

  .campaign-app-picker select {
    padding-right: 30px;
    font-size: 0.78rem;
  }

  .campaign-app-summary span {
    padding: 0 7px;
    font-size: 0.68rem;
  }

  .campaign-table-shell .metric-stack {
    gap: 5px;
  }

  .campaign-table-shell .metric-group {
    padding: 5px;
  }

  .campaign-table-shell .metric-group-title {
    font-size: 0.62rem;
  }

  .campaign-table-shell .metric-row,
  .campaign-table-shell .metric-empty {
    font-size: 0.74rem;
  }
}
