:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9e2ec;
  --panel: #ffffff;
  --band: #f3f7fb;
  --accent: #0f8b8d;
  --accent-dark: #0b6264;
  --warm: #f7b267;
  --danger: #b42318;
  --ok: #067647;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #eef6fb 0%, #f8fafc 42%, #eef3f1 100%);
  color: var(--ink);
  font-family: Inter, Segoe UI, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: auto;
}

body * {
  caret-color: transparent;
}

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

button,
label,
.image-drop,
.template-toggle,
.platform-choice {
  caret-color: transparent;
}

input:not([type]),
input[type="text"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="tel"],
textarea {
  caret-color: auto;
  -webkit-user-select: text;
  user-select: text;
}

[contenteditable="true"] {
  caret-color: auto;
}

button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
  touch-action: manipulation;
}

button:hover {
  border-color: var(--accent);
}

button:active {
  filter: brightness(0.98);
}

button:disabled,
button.processing {
  cursor: wait;
  opacity: 0.72;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.app-shell {
  min-width: 1180px;
  width: min(1840px, 100%);
  margin: 0 auto;
  padding: 28px 32px 24px;
}

.topbar {
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 58%, #eef6fb 100%);
  border: 1px solid rgba(217, 226, 236, 0.95);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 35, 52, 0.08);
  display: flex;
  justify-content: space-between;
  margin-bottom: 22px;
  min-height: 112px;
  overflow: hidden;
  padding: 18px 22px;
  position: relative;
}

.topbar::before {
  background: linear-gradient(180deg, #1d2f86 0%, #1d2f86 44%, #f04a23 44%, #f04a23 70%, #f7b267 70%, #f7b267 100%);
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: 7px;
}

.brand-head {
  align-items: center;
  display: flex;
  gap: 20px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.brand-logo {
  background: #fff;
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(15, 35, 52, 0.08);
  display: block;
  flex: 0 0 auto;
  height: 76px;
  object-fit: contain;
  padding: 10px 12px;
  width: 158px;
}

.eyebrow {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  color: #101828;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.05;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 17px;
  margin-bottom: 0;
}

.status-pill {
  align-items: center;
  border: 1px solid rgba(217, 226, 236, 0.95);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  display: inline-flex;
  gap: 8px;
  font-weight: 800;
  min-width: 104px;
  padding: 10px 16px;
  position: relative;
  z-index: 1;
}

.status-pill::before {
  background: #98a2b3;
  border-radius: 999px;
  content: "";
  height: 9px;
  width: 9px;
}

.status-pill.running {
  background: #ecfdf3;
  border-color: #abefc6;
  color: var(--ok);
}

.status-pill.running::before {
  background: var(--ok);
}

.topbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.utility-link {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 800;
  min-height: 38px;
  padding: 0 14px;
  text-decoration: none;
}

.utility-link:hover {
  border-color: var(--accent);
}

.workspace {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(430px, 460px) minmax(0, 1fr);
}

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

.settings-panel,
.preview-panel,
.log-panel,
.article-list,
.prompt-style-panel,
.monitor-panel,
.metric-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 35, 52, 0.07);
}

.settings-panel {
  align-self: start;
  padding: 20px;
  position: sticky;
  top: 18px;
}

.monitor-config-panel {
  margin-bottom: 18px;
  position: static;
}

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

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

.section-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
}

.compact-field {
  margin-bottom: 0;
}

.playlist-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.playlist-head span {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.local-feed-list {
  display: grid;
  gap: 10px;
  margin-bottom: 13px;
}

.local-feed-row {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.38fr);
  padding: 12px;
}

.local-feed-row .remove-feed {
  grid-column: 1 / -1;
  justify-self: end;
  min-height: 32px;
}

.field span {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  outline: none;
  min-width: 0;
  overflow: hidden;
  padding: 11px 12px;
  text-overflow: ellipsis;
  width: 100%;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.12);
}

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

.check-row {
  align-items: center;
  display: flex;
  gap: 8px;
  margin: 2px 0 14px;
}

.check-row input,
.platform-choice input {
  width: auto;
}

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

.hidden {
  display: none;
}

.content-area {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.pipeline {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.pipeline div {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  min-height: 62px;
  padding: 12px;
}

.pipeline strong {
  align-items: center;
  background: var(--warm);
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  height: 28px;
  justify-content: center;
  min-width: 52px;
  padding: 0 10px;
}

.prompt-style-panel {
  padding: 16px;
}

.prompt-style-panel textarea {
  min-height: 84px;
}

.pipeline span {
  font-size: 13px;
  font-weight: 800;
}

.queue-layout {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(390px, 430px) minmax(0, 1fr);
}

.article-list,
.preview-panel,
.log-panel {
  padding: 18px;
}

#articles {
  display: grid;
  gap: 10px;
  max-height: 720px;
  overflow: auto;
}

.date-filter {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin-bottom: 14px;
  padding: 12px;
}

.date-filter-row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.action-row {
  align-items: end;
  grid-template-columns: minmax(0, 1fr) minmax(182px, auto);
}

.source-filter-field {
  min-width: 0;
}

.filter-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  min-width: 0;
}

.filter-actions button {
  min-height: 42px;
  min-width: 0;
  overflow: hidden;
  padding-left: 10px;
  padding-right: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  caret-color: transparent;
  cursor: pointer;
  padding: 12px;
}

.article-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.1);
}

.article-card h3 {
  font-size: 16px;
  line-height: 1.35;
  margin: 0 0 9px;
  overflow-wrap: anywhere;
}

.meta-row {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 8px;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.badge {
  align-items: center;
  border-radius: 999px;
  background: var(--band);
  color: #344054;
  display: inline-flex;
  font-size: 12px;
  gap: 6px;
  font-weight: 800;
  padding: 4px 8px;
  text-transform: capitalize;
}

.status-dot {
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 8px;
  height: 8px;
  width: 8px;
}

.status-draft .status-dot {
  background: #ffffff;
  border: 1px solid #98a2b3;
}

.status-approved .status-dot {
  background: #16a34a;
}

.status-published .status-dot {
  background: #2563eb;
}

.status-rejected .status-dot {
  background: #dc2626;
}

.status-publish_failed .status-dot {
  background: #f59e0b;
}

.preview-panel {
  min-height: 560px;
  min-width: 0;
}

.empty-state {
  align-content: center;
  color: var(--muted);
  display: grid;
  min-height: 460px;
  place-items: center;
  text-align: center;
}

.preview-head {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.preview-head h2 {
  font-size: 30px;
  line-height: 1.16;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

.summary {
  color: #344054;
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.feed-platforms {
  align-items: start;
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  margin-bottom: 16px;
  padding: 14px;
}

.feed-platforms h3 {
  font-size: 15px;
  margin: 0 0 5px;
}

.feed-platforms p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

.platform-choice-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.platform-choice {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 7px;
  justify-content: center;
  min-height: 120px;
  padding: 12px 8px 10px;
  position: relative;
  text-align: center;
}

.platform-choice.recommended {
  border-color: rgba(15, 139, 141, 0.65);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.08);
}

.platform-choice:has(input:checked) {
  background: #f0fdfa;
  border-color: var(--accent);
}

.platform-choice input {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.platform-logo {
  align-items: center;
  background: #fff;
  border-radius: 12px;
  display: inline-flex;
  height: 54px;
  justify-content: center;
  overflow: hidden;
  width: 54px;
}

.platform-logo img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.platform-choice strong {
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.platform-tick {
  align-items: center;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  display: none;
  font-size: 12px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  position: absolute;
  right: 7px;
  top: 7px;
  width: 24px;
}

.platform-choice input:checked ~ .platform-tick {
  display: inline-flex;
}

.media-uploader {
  align-items: start;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 0.35fr) minmax(220px, 0.35fr) minmax(220px, 0.3fr);
  margin-bottom: 16px;
  padding: 14px;
}

.media-uploader.hidden {
  display: none;
}

.media-uploader.processing {
  border-color: #0f8b8d;
  box-shadow: inset 3px 0 0 #0f8b8d;
}

.media-uploader h3 {
  font-size: 15px;
  margin: 0 0 5px;
}

.media-uploader p,
.media-name {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
  overflow-wrap: anywhere;
}

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

.media-upload-controls {
  display: grid;
  gap: 8px;
}

.template-toggle {
  align-items: center;
  color: #344054;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
}

.template-toggle input {
  height: 16px;
  width: 16px;
}

.template-toggle:has(input:disabled) {
  color: var(--muted);
}

.media-progress {
  background: #e4edf7;
  border-radius: 999px;
  display: block;
  height: 7px;
  overflow: hidden;
  width: min(180px, 100%);
}

.media-progress.hidden {
  display: none;
}

.media-progress span {
  animation: mediaProgress 0.75s ease-in-out infinite;
  background: #0f766e;
  border-radius: inherit;
  display: block;
  height: 100%;
  width: 42%;
}

@keyframes mediaProgress {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(240%);
  }
}

.image-drop {
  align-items: center;
  border: 1px dashed #b9c7d6;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 48px;
  padding: 10px 12px;
}

.media-uploader.processing .image-drop,
.media-uploader.processing .template-toggle {
  cursor: wait;
  opacity: 0.74;
}

.remove-media {
  min-height: 34px;
  width: fit-content;
}

.image-drop input {
  display: none;
}

.article-image-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  max-height: 180px;
  object-fit: contain;
  width: 50%;
}

.caption-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.caption {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 170px;
  min-width: 0;
  padding: 15px;
}

.caption h3 {
  font-size: 15px;
  margin: 0;
  text-transform: uppercase;
}

.caption-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin: 0 0 8px;
}

.caption-edit {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 32px;
  font-size: 16px;
  height: 32px;
  justify-content: center;
  min-height: 32px;
  padding: 0;
  width: 32px;
}

.caption-edit img {
  display: block;
  height: 17px;
  width: 17px;
}

.caption-editor {
  min-height: 210px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  overflow: auto;
  resize: vertical;
  touch-action: pan-y;
  width: 100%;
}

.caption-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.caption p,
.notes li {
  color: #344054;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.caption-title {
  color: #111827;
  display: block;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

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

.notes-box {
  background: var(--band);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
}

.notes-box h3 {
  font-size: 14px;
  margin: 0 0 8px;
}

.notes-box ul {
  margin: 0;
  padding-left: 18px;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.danger-button {
  background: #fef3f2;
  border-color: #fecdca;
  color: var(--danger);
  font-weight: 800;
}

.danger-button:disabled {
  background: #f2f4f7;
  border-color: var(--line);
  color: #98a2b3;
  cursor: not-allowed;
}

.monitor-shell {
  min-width: 980px;
}

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

.user-data-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 18px;
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  font-size: 34px;
  line-height: 1;
}

.user-data-grid .metric-card {
  padding: 14px;
}

.user-data-grid .metric-card strong {
  font-size: 28px;
}

.monitor-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  margin-bottom: 18px;
}

.user-management-panel {
  grid-column: 1 / -1;
}

.monitor-panel {
  margin-bottom: 18px;
  padding: 18px;
}

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

.agent-card {
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid #98a2b3;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 74px;
  padding: 12px;
}

.agent-card strong,
.source-queue-row strong {
  display: block;
  font-size: 13px;
}

.agent-card span,
.source-queue-row span,
.source-queue-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.agent-card em {
  background: #f2f4f7;
  border-radius: 999px;
  flex: 0 0 auto;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 6px 9px;
  white-space: nowrap;
}

.agent-card.status-active,
.source-queue-row.status-queued {
  border-left-color: var(--accent);
}

.agent-card.status-warning,
.source-queue-row.status-retry {
  border-left-color: #f59e0b;
}

.agent-card.status-error {
  border-left-color: var(--danger);
}

.source-queue-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.source-queue-row {
  align-items: center;
  border-left: 5px solid #98a2b3;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(90px, 0.8fr) repeat(4, minmax(80px, 0.7fr)) minmax(170px, 1.6fr);
  min-height: 48px;
  padding: 10px 12px;
}

.source-queue-row:first-child {
  border-top: 0;
}

.user-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.user-list-title {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.monitor-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.user-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(110px, 1fr) minmax(120px, 1.4fr) minmax(90px, 0.8fr);
  justify-items: start;
  min-height: 48px;
  text-align: left;
}

.user-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.user-row.locked {
  background: #f8fafc;
  color: #667085;
  cursor: not-allowed;
  opacity: 0.82;
}

.platform-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.platform-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 12px;
}

.platform-stats strong {
  font-size: 24px;
}

.platform-stats span {
  color: var(--muted);
  font-weight: 800;
  text-transform: capitalize;
}

.processing-schedule {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin: 16px 0 20px;
  padding-top: 16px;
}

.schedule-grid {
  margin-top: 0;
}

.source-rule-grid {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  gap: 0;
  overflow: hidden;
}

.source-rule-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(90px, 1fr) minmax(90px, 120px) minmax(110px, 140px);
  min-height: 50px;
  padding: 9px 12px;
}

.source-rule-row:first-child {
  border-top: 0;
}

.source-rule-row input {
  min-height: 34px;
  min-width: 0;
  padding: 7px 10px;
}

.source-rule-row strong {
  font-size: 13px;
}

.source-rule-head {
  background: #f8fbfd;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  min-height: 38px;
  text-transform: uppercase;
}

.activity-tools {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.activity-tools .compact-field {
  margin: 0;
  min-width: 150px;
}

.table-sort {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: inherit;
  font-weight: 900;
  justify-content: flex-start;
  min-height: 0;
  padding: 0;
  text-align: left;
  text-transform: inherit;
}

.table-sort:hover {
  color: var(--accent);
}

.table-sort span {
  color: var(--accent);
  font-size: 10px;
  margin-left: 6px;
}

.audit-table-wrap {
  max-height: 520px;
  overflow: auto;
}

.audit-table {
  border-collapse: collapse;
  margin-top: 12px;
  width: 100%;
}

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

.audit-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.form-message {
  color: var(--danger);
  font-weight: 700;
  min-height: 20px;
}

.confirm-dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 35, 52, 0.24);
  color: var(--ink);
  max-width: 460px;
  padding: 0;
  width: min(460px, calc(100vw - 32px));
}

.confirm-dialog::backdrop {
  background: rgba(16, 24, 40, 0.42);
}

.confirm-dialog form {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.confirm-dialog h2 {
  font-size: 20px;
  margin: 0;
}

.confirm-dialog p {
  color: #344054;
  line-height: 1.5;
  margin: 0;
}

.delete-source-check {
  align-items: flex-start;
  background: #fff8f6;
  border: 1px solid #fecdca;
  border-radius: 8px;
  color: #344054;
  display: flex;
  gap: 10px;
  line-height: 1.4;
  padding: 12px;
}

.delete-source-check input {
  margin-top: 3px;
  width: auto;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.publish-progress {
  align-items: center;
  color: #344054;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  flex: 0 0 auto;
  justify-content: stretch;
  margin-left: 10px;
  margin-right: auto;
  min-width: 0;
  width: 150px;
}

.publish-progress.hidden {
  display: none;
}

#publishProgressLabel {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.publish-progress-track {
  background: #e4edf7;
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.publish-progress-track span {
  animation: publishProgress 0.85s ease-in-out infinite;
  background: #0f766e;
  border-radius: inherit;
  clip-path: none;
  display: block;
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 42%;
}

.publish-progress .publish-progress-track span {
  animation: publishProgress 0.85s ease-in-out infinite;
}

.publish-progress.complete .publish-progress-track span {
  animation: none;
  background: #16a34a;
  left: 0;
  transform: none;
  width: 100% !important;
}

.publish-progress.error .publish-progress-track span {
  animation: none;
  background: #dc2626;
  left: 0;
  transform: none;
  width: 100% !important;
}

@keyframes publishProgress {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(240%);
  }
}

#logs {
  background: #111827;
  border-radius: 8px;
  color: #d1fae5;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 1280px) {
  .app-shell {
    min-width: 0;
    padding: 18px;
  }

  .workspace,
  .queue-layout,
  .monitor-layout {
    grid-template-columns: 1fr;
  }

  .monitor-shell {
    min-width: 0;
  }

  .settings-panel {
    position: static;
  }

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

  .monitor-grid,
  .platform-stats,
  .user-data-grid,
  .agent-indicator-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .source-rule-row {
    grid-template-columns: minmax(100px, 1fr) repeat(2, minmax(90px, 0.6fr));
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
    padding: 18px;
  }

  .brand-head {
    align-items: center;
    flex-direction: row;
    gap: 12px;
    width: 100%;
  }

  .brand-logo {
    height: 48px;
    padding: 7px 8px;
    width: 96px;
  }

  .eyebrow {
    font-size: 10px;
    margin-bottom: 5px;
  }

  h1 {
    font-size: 22px;
    line-height: 1.05;
    white-space: nowrap;
  }

  .grid-2,
  .monitor-config-grid,
  .local-feed-row,
  .date-filter,
  .date-filter-row,
  .action-row,
  .caption-grid,
  .notes,
  .media-uploader,
  .feed-platforms,
  .platform-choice-grid,
  .pipeline,
  .monitor-grid,
  .platform-stats,
  .user-data-grid,
  .agent-indicator-grid,
  .activity-tools,
  .user-row,
  .source-queue-row,
  .source-rule-row {
    grid-template-columns: 1fr;
  }

  .source-rule-head {
    display: none;
  }

  .activity-tools {
    align-items: stretch;
    display: grid;
    justify-content: stretch;
  }

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

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

@media (max-width: 420px) {
  .brand-logo {
    height: 42px;
    width: 84px;
  }

  h1 {
    font-size: 18px;
  }

  .status-pill {
    min-width: 92px;
    padding: 8px 12px;
  }
}
