:root {
  --ink: #111318;
  --muted: #626a76;
  --line: #dce2e7;
  --panel: #ffffff;
  --soft: #f5f7f8;
  --dark: #14171d;
  --blue: #1f5ca8;
  --green: #177245;
  --orange: #af6b2d;
  --red: #b64242;
  --shadow: 0 18px 42px rgba(17, 19, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #e8edf1;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #f5c36f;
  background: #060708;
  border: 1px solid #342813;
  font-weight: 900;
}

.eyebrow {
  display: block;
  color: var(--orange);
  font-size: 11px;
  line-height: 1;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 9px;
  font-size: 28px;
  line-height: 1.12;
}

h2 {
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.2;
}

.login-card p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.login-form,
.job-form {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

input[type="file"] {
  padding: 9px;
  color: var(--muted);
  background: #fbfcfc;
}

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

.login-form button,
.job-form button,
.preview-actions button,
.caption-actions button,
.settings-actions button,
.logout-button {
  min-height: 42px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 820;
}

.error-text {
  min-height: 18px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

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

.sidebar {
  background: var(--dark);
  color: #fff;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.brand span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

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

.nav-list button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
  padding: 0 12px;
  font-weight: 760;
}

.nav-list button.active,
.nav-list button:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.guard-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.guard-card strong {
  display: block;
  margin-top: 10px;
  font-size: 20px;
}

.guard-card p {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.45;
  font-size: 13px;
}

.logout-button {
  width: 100%;
  background: #fff;
  border-color: #fff;
  color: var(--dark);
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.workspace-section {
  scroll-margin-top: 18px;
}

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

.topbar-side {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.topbar-meta {
  min-width: 220px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.mobile-logout-button {
  display: none;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dark);
  background: #fff;
  padding: 0 14px;
  font-weight: 820;
}

.topbar-meta span,
.topbar-meta strong {
  display: block;
}

.topbar-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.topbar-meta span.offline {
  color: var(--red);
}

.topbar-meta strong {
  margin-top: 4px;
  font-size: 18px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 20px;
  align-items: start;
}

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

.brief-panel,
.preview-panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.job-meta-line {
  max-width: 520px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
}

.price-pill,
.status-pill {
  align-self: start;
  white-space: nowrap;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.price-pill {
  color: #6f4512;
  background: #fff0cc;
}

.status-pill {
  color: var(--green);
  background: #e9f7ef;
}

.status-pill.not-ready {
  color: var(--red);
  background: #faeded;
}

.directions {
  padding: 16px 18px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.direction-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  font-weight: 800;
  text-align: left;
}

.direction-button.active {
  color: #fff;
  background: #1c2534;
  border-color: #1c2534;
}

.direction-button span,
.direction-button small {
  display: block;
}

.direction-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
}

.direction-button.active small {
  color: rgba(255, 255, 255, 0.72);
}

.quick-briefs {
  padding: 10px 18px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-brief-button {
  min-height: 34px;
  border: 1px solid #d8c9ad;
  border-radius: 8px;
  color: #5a3b18;
  background: #fffaf0;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 850;
}

.quick-brief-button:hover {
  border-color: #c09a5d;
  background: #fff4da;
}

.queue-status {
  margin: 12px 18px 0;
  padding: 10px 12px;
  border: 1px solid #c8d8ee;
  border-radius: 8px;
  background: #f2f6fb;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.queue-status.warn {
  border-color: #ecd8bb;
  background: #fff6e8;
}

.queue-status span {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.queue-status span.warn {
  border-color: #e2c0c0;
  color: var(--red);
}

.queue-status strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 880;
  text-transform: uppercase;
}

.queue-status em {
  color: var(--orange);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.3;
}

.job-form {
  padding: 16px 18px;
  margin-top: 0;
}

.job-form.disabled-form {
  opacity: 0.64;
}

.check-row {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-actions button {
  padding: 0 16px;
}

.messages {
  border-top: 1px solid var(--line);
  padding: 14px 18px 18px;
  display: grid;
  gap: 9px;
  max-height: 320px;
  overflow: auto;
  background: #fbfcfc;
}

.message {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  line-height: 1.42;
}

.message.user {
  border-color: #c8d8ee;
  background: #f2f6fb;
}

.message.worker {
  border-color: #c9e3d1;
  background: #f1f8f3;
}

.message small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.phone {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 9 / 16;
  margin: 18px auto;
  border-radius: 8px;
  overflow: hidden;
  background: #101114;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.phone video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.empty-preview {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  line-height: 1.45;
}

.source-list {
  margin: 0 18px 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  gap: 8px;
}

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

.source-list a {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  background: var(--soft);
}

.source-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

.source-list small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.selected-brief {
  margin: 0 18px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.selected-brief p {
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.brief-actions {
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.create-similar-button,
.copy-job-link-button {
  min-height: 34px;
  border: 1px solid #c8d8ee;
  border-radius: 8px;
  color: var(--blue);
  background: #f2f6fb;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
}

.copy-job-link-button {
  color: var(--dark);
  border-color: var(--line);
  background: #fff;
}

.caption-box {
  margin: 0 18px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

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

.caption-head strong {
  display: block;
}

.caption-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.caption-head span.over {
  color: var(--red);
}

.caption-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.caption-save-state {
  color: var(--green) !important;
}

.caption-save-state.dirty {
  color: var(--orange) !important;
}

#captionEditor {
  min-height: 154px;
  max-height: 320px;
  resize: vertical;
  line-height: 1.45;
  font-size: 13px;
  background: #fff;
}

#captionEditor:disabled {
  color: var(--muted);
  background: #f0f3f5;
}

.caption-actions {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 10px;
  margin-top: 10px;
}

.caption-actions button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.caption-actions button:nth-child(2) {
  color: var(--dark);
  background: #fff;
  border-color: var(--line);
}

.handoff-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.button-link,
.handoff-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dark);
  background: #fff;
  display: grid;
  place-items: center;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 820;
  text-align: center;
  text-decoration: none;
}

.button-link.disabled,
.handoff-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.next-action {
  margin: 0 18px 18px;
  padding: 12px 14px;
  border: 1px solid #c8d8ee;
  border-radius: 8px;
  background: #f2f6fb;
  display: grid;
  gap: 4px;
}

.next-action.warn {
  border-color: #ecd8bb;
  background: #fff6e8;
}

.next-action strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 870;
  line-height: 1.25;
}

.next-action span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.35;
}

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

.preview-actions button {
  flex: 1 1 118px;
  min-width: 118px;
  min-height: 42px;
  padding: 0 12px;
  white-space: normal;
}

.preview-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.publish-hint {
  min-height: 18px;
  margin: -8px 18px 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.35;
}

.publish-hint.warn {
  color: var(--orange);
}

.caption-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.jobs-panel {
  margin-top: 20px;
  box-shadow: none;
}

.job-filters {
  padding: 14px 18px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.job-filters button {
  min-height: 34px;
  min-width: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dark);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.job-filters button.active {
  color: #fff;
  border-color: #1c2534;
  background: #1c2534;
}

.job-filters strong {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-size: 11px;
  font-weight: 850;
}

.job-filters button.active strong {
  color: #1c2534;
  background: #fff;
}

.job-search {
  margin: 12px 18px 0;
  display: grid;
  gap: 6px;
}

.job-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.job-search input {
  min-height: 38px;
  border-radius: 8px;
  font-size: 13px;
}

.settings-panel {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.settings-note {
  margin: 16px 18px 0;
  padding: 11px 12px;
  border: 1px solid #ecd8bb;
  border-radius: 8px;
  color: #754719;
  background: #fff6e8;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.4;
}

.publishing-steps {
  margin: 10px 18px 0;
  padding: 0 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 740;
  line-height: 1.45;
}

.publishing-steps li + li {
  margin-top: 4px;
}

.settings-form {
  padding: 16px 18px 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

.account-form label {
  grid-column: auto;
}

.publishing-readiness {
  margin: 10px 18px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
}

.publishing-readiness.ready {
  color: var(--green);
}

.publishing-readiness.warn {
  color: var(--orange);
}

.field-note {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.field-note.warn {
  color: var(--red);
}

.settings-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-actions button {
  padding: 0 16px;
}

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

.settings-actions .secondary-button {
  color: var(--dark);
  background: #fff;
  border-color: var(--line);
}

.health-actions {
  padding: 0 18px 18px;
}

.test-result {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
}

.test-result p {
  margin: 0;
}

.test-result.ok {
  color: var(--green);
}

.test-result.warn {
  color: var(--orange);
}

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

.integration-option {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.integration-option.selected {
  border-color: var(--blue);
  outline: 2px solid rgba(31, 92, 168, 0.18);
}

.integration-option:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.integration-option span,
.integration-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-option span {
  font-size: 13px;
  font-weight: 840;
}

.integration-option small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.member-list {
  padding: 16px 18px 18px;
  display: grid;
  gap: 10px;
}

.member-create-form {
  padding: 16px 18px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) repeat(4, minmax(90px, auto));
  align-items: end;
  gap: 12px;
}

.member-create-form .settings-actions {
  grid-column: 1 / -1;
}

.health-list {
  padding: 16px 18px 18px;
  display: grid;
  gap: 10px;
}

.audit-list {
  padding: 16px 18px 18px;
  display: grid;
  gap: 8px;
}

.audit-row {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 210px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.audit-row strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.audit-row span,
.audit-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-row {
  display: grid;
  grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.health-row.ok {
  border-color: #c9e3d1;
  background: #f1f8f3;
}

.health-row.warn {
  border-color: #ecd2a8;
  background: #fff8ea;
}

.health-row strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.health-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
}

.member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px 108px 120px 120px minmax(190px, auto);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.member-row.inactive {
  border-color: #e8d4d4;
  background: #fff7f7;
}

.member-row strong,
.member-row span {
  display: block;
}

.member-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.switch-row {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 820;
}

.switch-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.member-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.copy-login-button,
.reset-password-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dark);
  background: #fff;
  font-size: 13px;
  font-weight: 820;
}

.copy-login-button {
  border-color: #c8d8ee;
  color: var(--blue);
  background: #f2f6fb;
}

.copy-login-button:disabled,
.reset-password-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.password-result {
  margin: 0 18px 18px;
  padding: 12px;
  border: 1px solid #c9e3d1;
  border-radius: 8px;
  background: #f1f8f3;
  color: var(--ink);
}

.password-result strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.password-result div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
}

.password-result code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.password-result button {
  min-height: 36px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 820;
}

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

.modal-panel {
  width: min(100%, 460px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 64px rgba(17, 19, 24, 0.26);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dark);
  background: #fff;
  font-weight: 850;
}

.modal-form {
  padding: 16px 18px 18px;
  display: grid;
  gap: 12px;
}

.modal-form textarea {
  min-height: 92px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-actions button {
  min-height: 40px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 820;
}

.modal-actions .secondary-button {
  color: var(--dark);
  background: #fff;
  border-color: var(--line);
}

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

.jobs {
  padding: 16px 18px 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.job-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  text-align: left;
  padding: 0;
}

.job-card.status-queued,
.job-card.status-running {
  border-color: #c8d8ee;
}

.job-card.status-review,
.job-card.status-approved {
  border-color: #c9e3d1;
}

.job-card.status-scheduled,
.job-card.status-published {
  border-color: #cfd4db;
}

.job-card.status-failed {
  border-color: #e2c0c0;
}

.job-card.active {
  outline: 2px solid var(--blue);
}

.job-thumb {
  aspect-ratio: 16 / 11;
  background: #d9dde2;
  overflow: hidden;
}

.job-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.job-thumb .no-thumb {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 850;
}

.job-body {
  padding: 11px;
}

.job-title {
  font-weight: 850;
  line-height: 1.2;
}

.job-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-label {
  align-self: start;
  white-space: nowrap;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 880;
}

.status-label.status-queued,
.status-label.status-running {
  color: var(--blue);
  background: #f2f6fb;
}

.status-label.status-review,
.status-label.status-approved {
  color: var(--green);
  background: #e9f7ef;
}

.status-label.status-scheduled,
.status-label.status-published {
  color: #3f4650;
  background: #eef1f4;
}

.status-label.status-failed {
  color: var(--red);
  background: #faeded;
}

.toast-stack {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  top: auto;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(50vh, 360px);
  overflow: hidden;
  pointer-events: none;
  justify-items: end;
}

.toast {
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  width: fit-content;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd8e6;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 34px rgba(17, 19, 24, 0.16);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
  overflow-wrap: anywhere;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

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

.toast.error {
  border-color: #e2c0c0;
  border-left-color: var(--red);
}

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

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

  .settings-form {
    grid-template-columns: 1fr 1fr;
  }

  .integration-list {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .sidebar {
    display: none;
  }

  .workspace {
    padding: 14px;
  }

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

  .topbar-side {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
  }

  .topbar-meta {
    min-width: 0;
    width: 100%;
  }

  .mobile-logout-button {
    display: block;
  }

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

  .quick-briefs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .settings-form label.wide-field {
    grid-column: 1;
  }

  .settings-form {
    grid-template-columns: 1fr;
  }

  .integration-list {
    grid-template-columns: 1fr;
  }

  .member-row {
    grid-template-columns: 1fr;
  }

  .member-create-form {
    grid-template-columns: 1fr;
  }

  .audit-row {
    grid-template-columns: 1fr;
  }

  .password-result div {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    align-items: end;
    padding: 14px;
  }

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

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

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

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

  .toast-stack {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
    max-height: 34vh;
    justify-items: stretch;
  }

  .toast {
    width: 100%;
    padding: 11px 12px;
    text-align: left;
    box-shadow: 0 10px 26px rgba(17, 19, 24, 0.18);
  }
}

@media (max-width: 420px) {
  .quick-briefs {
    grid-template-columns: 1fr;
  }
}
