:root {
  color-scheme: light;
  --bg: #f4f6f7;
  --phone: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --surface-tint: #eef7f6;
  --text: #172126;
  --muted: #647176;
  --faint: #5f6b6f;
  --line: #dfe6e7;
  --line-strong: #c7d2d5;
  --teal: #006d70;
  --teal-dark: #00545a;
  --teal-soft: #dff3f1;
  --green: #0f6e34;
  --green-soft: #e3f5ea;
  --amber: #8a5200;
  --amber-soft: #fff2d8;
  --red: #c52222;
  --red-soft: #fde8e8;
  --blue: #155a9c;
  --blue-soft: #e6f0fb;
  --text-soft: #415054;
  --teal-line: #b9dfe0;
  --green-line: #b9dfc8;
  --amber-line: #edd29f;
  --red-line: #f3c3c3;
  --shadow: 0 18px 48px rgba(15, 32, 36, 0.14);
  --radius: 8px;
  --radius-sm: 6px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

html,
body,
.app-root {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .72;
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(#ffffff, #f4f8f8);
}

.auth-card {
  width: min(100%, 390px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.auth-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--teal);
  color: #fff;
}

.auth-card h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
}

.auth-card p {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-field {
  display: block;
  margin-bottom: 12px;
}

.auth-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 720;
}

.auth-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

.auth-field input:focus {
  outline: 2px solid var(--teal-soft);
  border-color: var(--teal);
}

.auth-error {
  margin: 0 0 12px;
  padding: 9px 10px;
  border: 1px solid var(--red-line);
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  line-height: 1.35;
}

.app-shell {
  min-height: 100dvh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--phone);
}

.app {
  min-height: 100dvh;
  display: grid;
  background: var(--phone);
}

.app-main {
  min-width: 0;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--phone);
}

.desktop-nav {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding:
    max(12px, env(safe-area-inset-top))
    max(16px, calc(16px + env(safe-area-inset-right)))
    12px
    max(16px, calc(16px + env(safe-area-inset-left)));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
}

.topbar-title {
  flex: 1 1 auto;
  min-width: 0;
}

.screen-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.screen-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 27px;
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-pill {
  flex: 0 0 auto;
  max-width: 82px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 780;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.role-pill--admin {
  border-color: var(--teal-line);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.role-pill--editor {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.role-pill--approver {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.role-pill--viewer {
  border-color: var(--amber-line);
  background: var(--amber-soft);
  color: var(--amber);
}

.screen-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-notice {
  margin: 0 0 12px;
  padding: 9px 10px;
  border: 1px solid var(--amber-line);
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
}

.role-notice--editor {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.role-notice--approver {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

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

.role-capability {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.role-capability-label {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.25;
}

.role-capability-state {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
  text-transform: uppercase;
}

.role-capability--on {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.role-capability--on .role-capability-state {
  color: var(--green);
}

.role-capability--off {
  border-color: var(--line-strong);
}

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

.account-switch,
.icon-button,
.small-button,
.tiny-button,
.secondary-button,
.primary-button,
.tab,
.filter,
.mode,
.nav-item,
.quick-action,
.content-action,
.row,
.schedule-card,
.preflight,
.day {
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.account-switch {
  max-width: 112px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.account-switch-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-switch-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.lang-toggle {
  height: 44px;
  display: inline-grid;
  grid-template-columns: repeat(2, 44px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.lang-option {
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  line-height: 1;
  letter-spacing: 0;
}

.lang-option + .lang-option {
  border-left: 1px solid var(--line);
}

.lang-option.active {
  background: var(--teal);
  color: #fff;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.icon {
  width: 19px;
  height: 19px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.content {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  overflow: visible;
  padding:
    14px
    max(12px, calc(12px + env(safe-area-inset-right)))
    calc(98px + env(safe-area-inset-bottom))
    max(12px, calc(12px + env(safe-area-inset-left)));
  background: linear-gradient(#ffffff, #fbfcfc 42%, #f7f9f9);
}

.screen {
  width: 100%;
  min-width: 0;
  max-width: 720px;
  margin: 0 auto;
}

.section {
  margin: 0 0 18px;
}

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

.section-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 780;
}

.section-meta {
  color: var(--faint);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
}

.badge {
  min-width: 22px;
  margin-left: 4px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  border-color: var(--teal-line);
}

.tag.green {
  color: var(--green);
  background: var(--green-soft);
  border-color: var(--green-line);
}

.tag.amber {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: var(--amber-line);
}

.tag.red {
  color: var(--red);
  background: var(--red-soft);
  border-color: var(--red-line);
}

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

.tag.teal {
  color: var(--teal-dark);
  background: var(--teal-soft);
  border-color: var(--teal-line);
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.row {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.row:last-child {
  border-bottom: 0;
}

.row.compact {
  min-height: 48px;
}

.row:hover,
.quick-action:hover,
.content-action:hover,
.schedule-card:hover,
.preflight:hover,
.task-card:hover,
.draft-card:hover,
.campaign-card:hover {
  border-color: var(--line-strong);
}

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

.row-end {
  min-width: 46px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: var(--muted);
  text-align: right;
}

.row-title {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 720;
}

.row-sub {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.row-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
  white-space: nowrap;
}

.row-value.green {
  color: var(--green);
}

.row-value.red {
  color: var(--red);
}

.row-action-text {
  max-width: 112px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  color: var(--text);
  font-size: 11px;
  font-weight: 740;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.row:hover .row-action-text,
.row:focus-visible .row-action-text {
  border-color: var(--teal);
  color: var(--teal);
}

.status-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
}

.assistant-context {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid var(--teal-line);
  border-radius: var(--radius-sm);
  background: #effafa;
  color: #1d5960;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.status-mark.red {
  background: var(--red-soft);
  color: var(--red);
}

.status-mark.green {
  background: var(--green-soft);
  color: var(--green);
}

.status-mark.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-mark.teal {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.chevron {
  width: 17px;
  height: 17px;
  color: var(--faint);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric {
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.metric-value {
  margin-top: 6px;
  font-size: 21px;
  line-height: 1;
  font-weight: 780;
}

.metric-delta {
  margin-top: 5px;
  color: var(--green);
  font-size: 11px;
  font-weight: 720;
}

.schedule-card {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.time-block {
  width: 58px;
  height: 50px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 760;
}

.time-block .icon {
  width: 16px;
  height: 16px;
}

.inline-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-action {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.quick-action strong {
  display: block;
  font-size: 13px;
  line-height: 1.15;
}

.quick-action span span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.assistant-card,
.composer-intro,
.composer-guide {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--teal-line);
  border-radius: var(--radius);
  background: #f5fbfb;
}

.workflow-disclosure {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.workflow-disclosure > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.workflow-disclosure[open] > summary {
  margin-bottom: 10px;
}

.assistant-card {
  margin-top: 10px;
}

.assistant-card.compact {
  padding: 11px;
}

.assistant-card-open {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.assistant-card-open:hover .row-action-text,
.assistant-card-open:focus-visible .row-action-text {
  border-color: var(--teal);
  color: var(--teal);
}

.assistant-card-open:focus-visible {
  outline: 2px solid var(--teal-soft);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.assistant-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.assistant-card-title,
.assistant-card h3,
.composer-intro h3 {
  display: block;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 760;
}

.assistant-card-copy,
.assistant-card p,
.composer-intro p {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.composer-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.content-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 12px;
}

.content-action {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.content-action.primary {
  border-color: var(--teal-line);
  background: var(--surface-tint);
}

.content-action-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.content-action-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-action-main span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.content-create-flow {
  display: grid;
  gap: 12px;
  margin: 8px 0 14px;
  padding: 12px;
  border: 1px solid var(--teal-line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f3fbfa, #ffffff);
}

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

.content-create-flow-copy h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
  font-weight: 780;
}

.content-create-flow-copy p {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

.content-create-primary {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  background: var(--teal);
  color: #fff;
  text-align: left;
}

.content-create-primary .status-mark {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.content-create-primary strong,
.content-create-primary small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-create-primary strong {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 780;
}

.content-create-primary small {
  margin-top: 2px;
  color: rgba(255, 255, 255, .78);
  font-size: 11px;
  line-height: 1.2;
}

.content-create-primary .chevron {
  color: rgba(255, 255, 255, .86);
}

.content-flow-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.content-flow-step {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.content-flow-step strong,
.content-flow-step small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.content-flow-step strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}

.content-flow-step small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.content-create-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.content-work-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 12px;
}

.content-work-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}

.content-work-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.content-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}

.content-summary-cell {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  color: var(--text);
  text-align: left;
}

.content-summary-cell:hover {
  border-color: var(--teal-line);
  background: var(--surface);
}

.content-summary-cell span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.content-summary-cell strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.content-blocker-filter {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 12px;
}

.content-blocker-filter-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
  text-transform: uppercase;
}

.content-blocker-filters {
  margin-bottom: 0;
}

.content-action-board {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.content-action-board-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
  text-transform: uppercase;
}

.content-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.content-action-title {
  min-width: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.content-action-title strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-action-title span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.campaign-filter-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.campaign-mode-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--teal-line);
  border-radius: var(--radius);
  background: #f5fbfb;
}

.campaign-mode-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.campaign-mode-head h3,
.campaign-idea-title {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.3;
}

.campaign-mode-head p,
.campaign-mode-note,
.campaign-idea-reason {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.campaign-mode-tags,
.campaign-idea-tags {
  gap: 6px;
}

.campaign-mode-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.campaign-ideas-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.campaign-ideas-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.campaign-idea-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.content-list-head {
  margin: 12px 0 9px;
}

.backlog-list {
  min-width: 0;
}

.composer-guide {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  background: var(--surface-tint);
}

.composer-guide strong {
  color: var(--teal-dark);
  font-size: 12px;
  line-height: 1.25;
}

.composer-guide span {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

.brand-assets-panel {
  padding: 10px;
  border: 1px solid #b9d8d7;
  border-radius: var(--radius-sm);
  background: var(--teal-soft);
}

.brand-assets-head {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.brand-assets-head::-webkit-details-marker { display: none; }

.brand-assets-head > div { min-width: 0; flex: 1 1 auto; }

.brand-assets-head > .icon { flex: 0 0 auto; transition: transform .18s ease; }

.brand-assets-panel[open] .brand-assets-head > .icon { transform: rotate(90deg); }

.brand-assets-body { display: grid; gap: 12px; padding-top: 12px; }

.brand-assets-head h3 {
  margin: 0;
  color: var(--teal-dark);
  font-size: 13px;
  line-height: 1.2;
}

.brand-assets-head p {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.35;
}

.brand-asset-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-asset-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.brand-asset-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 6px;
}

.brand-asset-button {
  min-width: 0;
  min-height: 44px;
  padding: 7px 8px;
  border: 1px solid #b9d8d7;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.brand-asset-button span,
.brand-asset-button strong {
  display: block;
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.brand-asset-button span {
  font-size: 11px;
  line-height: 1.3;
}

.brand-asset-button strong {
  margin-top: 3px;
  color: var(--teal);
  font-size: 11px;
}

.quality-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #ecd794;
  border-radius: var(--radius-sm);
  background: #fff8df;
}

.quality-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: flex-start;
}

.quality-head h3 {
  margin: 0;
  color: #6d5200;
  font-size: 13px;
  line-height: 1.2;
}

.quality-head p {
  margin: 3px 0 0;
  color: #594d2c;
  font-size: 11px;
  line-height: 1.35;
}

.quality-score,
.quality-inline,
.quality-suggestion {
  min-width: 0;
  padding: 8px;
  border: 1px solid #ead58b;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.quality-score,
.quality-inline,
.quality-suggestion-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.quality-inline span,
.quality-suggestion p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quality-cta-block,
.quality-cta-options {
  display: grid;
  gap: 8px;
}

.quality-cta-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
}

.quality-cta-heading span {
  color: var(--muted);
  font-size: 11px;
}

.quality-cta-option {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #ead58b;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.quality-cta-option:hover,
.quality-cta-option:focus-visible {
  border-color: var(--teal);
  outline: none;
}

.quality-cta-option-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.quality-cta-option > strong,
.quality-cta-option > small {
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.quality-cta-option > strong { font-size: 12px; }
.quality-cta-option > small { color: var(--muted); font-size: 11px; }
.quality-cta-option > em { color: var(--teal-dark); font-size: 11px; font-style: normal; font-weight: 760; }

.quality-suggestion p {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.quality-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quality-checks-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.bilingual-copy-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--teal-line);
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
}

.bilingual-copy-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
}

.bilingual-copy-head h3,
.bilingual-copy-head p {
  margin: 0;
}

.bilingual-copy-head h3 {
  color: var(--text);
  font-size: 13px;
}

.bilingual-copy-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

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

.bilingual-variant {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.bilingual-variant > span,
.bilingual-variant strong {
  display: block;
}

.bilingual-variant > span {
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.bilingual-variant strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.bilingual-variant p {
  margin: 7px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.quality-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: flex-start;
  padding: 7px;
  border: 1px solid #ead58b;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.quality-check strong,
.quality-check p,
.quality-check small,
.quality-empty {
  overflow-wrap: anywhere;
}

.quality-check strong {
  display: block;
  font-size: 12px;
}

.quality-check p,
.quality-check small,
.quality-empty {
  margin: 3px 0 0;
  color: #4e5659;
  font-size: 11px;
  line-height: 1.35;
}

.asset-library-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.asset-library-head h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}

.asset-library-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.asset-upload-control {
  position: relative;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--teal);
  border-radius: var(--radius-sm);
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
  white-space: nowrap;
}

.asset-upload-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.asset-upload-control > span {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
}

.asset-upload-control > span > span {
  min-width: 0;
  padding: 0;
}

.asset-upload-control.compact {
  min-height: 44px;
}

.asset-upload-control .icon {
  width: 17px;
  height: 17px;
}

.asset-filter-row {
  margin: 10px 0 12px;
}

.asset-search-row {
  margin: 10px 0 8px;
}

.asset-search-row input {
  width: 100%;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.asset-grid.compact {
  grid-template-columns: 1fr;
}

.asset-grid-scroll {
  max-height: min(440px, 48vh);
  overflow: auto;
  padding-right: 2px;
}

.media-screen {
  min-width: 0;
}

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

.media-screen-head h2,
.media-screen-head p {
  margin: 0;
}

.media-upload-destination {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 9px 11px;
  border-left: 3px solid var(--teal);
  background: var(--surface-soft);
  color: var(--text);
}

.media-upload-destination > span {
  flex: 0 0 auto;
  color: var(--teal-dark);
}

.media-upload-destination .icon {
  width: 18px;
  height: 18px;
}

.media-upload-destination div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.media-upload-destination strong,
.media-upload-destination small {
  overflow-wrap: anywhere;
}

.media-upload-destination strong {
  font-size: 12px;
}

.media-upload-destination small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.media-screen-head h2 {
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
}

.media-screen-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.media-intake-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.media-intake-head,
.media-intake-created,
.media-intake-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.media-intake-head h3,
.media-intake-head p {
  margin: 0;
}

.media-intake-head h3 {
  font-size: 14px;
}

.media-intake-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.media-intake-create {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px auto;
  align-items: end;
  gap: 10px;
}

.media-intake-create label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.media-intake-create input,
.media-intake-created input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
}

.media-intake-days {
  display: flex;
  align-items: center;
  gap: 7px;
}

.media-intake-days input {
  width: 88px;
}

.media-intake-created input {
  flex: 1 1 auto;
}

.media-intake-list {
  display: grid;
}

.media-intake-row {
  min-width: 0;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.media-intake-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.media-intake-row strong,
.media-intake-row small {
  overflow-wrap: anywhere;
}

.media-intake-row strong {
  font-size: 12px;
}

.media-intake-row small {
  color: var(--muted);
  font-size: 10px;
}

.media-assistant {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  background: var(--surface);
}

.media-assistant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.media-assistant h3,
.media-assistant p {
  margin: 0;
}

.media-assistant h3 {
  color: var(--text);
  font-size: 14px;
}

.media-assistant-head p,
.media-assistant-ready {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.media-assistant-metrics {
  display: flex;
  gap: 14px;
}

.media-assistant-metrics span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.media-assistant-metrics strong {
  color: var(--text);
  font-size: 17px;
}

.media-assistant-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.media-assistant-items button {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.media-assistant-items button:hover {
  border-color: var(--teal-line);
  background: var(--surface-tint);
}

.media-assistant-items button > span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.media-assistant-items strong,
.media-assistant-items small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-assistant-items strong {
  font-size: 11px;
}

.media-assistant-items small,
.media-assistant-items button > span:last-child {
  color: var(--muted);
  font-size: 10px;
}

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

.media-stat {
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: left;
}

.media-stat:hover {
  border-color: var(--teal-line);
  background: var(--surface-tint);
}

.media-stat.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.media-stat span {
  min-width: 0;
  font-size: 12px;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.media-stat strong {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 21px;
  font-weight: 780;
}

.media-toolbar {
  margin-bottom: 14px;
}

.media-toolbar .asset-search-row {
  margin-top: 0;
}

.media-workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(0, 1fr) minmax(300px, 360px);
  align-items: start;
  gap: 16px;
}

.media-folders {
  min-width: 0;
  position: sticky;
  top: 0;
}

.media-folder-mobile {
  display: none;
}

.media-folder-desktop {
  min-width: 0;
  max-height: calc(100vh - 160px);
  overflow: auto;
  padding-right: 3px;
}

.media-folder-desktop h3,
.media-folder-section-title {
  margin: 0;
  color: var(--faint);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.media-folder-desktop h3 {
  padding: 0 8px 8px;
}

.media-folder-section-title {
  padding: 15px 8px 7px;
}

.media-folder-button {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  padding: 7px 8px;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.media-folder-button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.media-folder-button.active {
  border-left-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.media-folder-button span,
.media-folder-button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-folder-button span {
  font-size: 12px;
  font-weight: 720;
}

.media-folder-button small {
  grid-column: 1;
  color: var(--faint);
  font-size: 9px;
}

.media-folder-button strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: inherit;
  font-size: 11px;
}

.media-folder-empty {
  margin: 0;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.media-folder-mobile label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
}

.media-folder-mobile select {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.media-folder-mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.media-folder-mobile-actions .small-button {
  min-width: 0;
  flex: 1 1 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.media-folder-mobile-actions .icon {
  width: 16px;
  height: 16px;
}

.media-catalog {
  min-width: 0;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  align-items: stretch;
  grid-auto-rows: 1fr;
  gap: 10px;
}

.media-load-more {
  width: min(220px, 100%);
  min-height: 40px;
  display: block;
  margin: 14px auto 0;
}

.media-tile {
  position: relative;
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.media-tile--selected {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.media-tile--checked {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.media-tile-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .52);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 25, .82);
  cursor: pointer;
}

.media-tile-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.media-tile-check span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.media-tile-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #111719;
  color: #fff;
}

.media-tile-preview .asset-thumb-media {
  object-fit: contain;
  transition: opacity 160ms ease;
}

.media-tile-preview:hover .asset-thumb-media {
  opacity: .94;
}

.media-kind-badge {
  position: absolute;
  right: 7px;
  bottom: 7px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, .36);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 25, .82);
  color: #fff;
  font-size: 10px;
  font-weight: 760;
}

.media-tile-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 9px;
}

.media-tile-body > .asset-badges {
  min-height: 42px;
  align-content: flex-start;
}

.media-tile-name {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.3;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-tile-meta {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-tile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: auto;
  padding-top: 9px;
}

.media-tile-actions [data-media-folder-open] {
  grid-column: 1 / -1;
}

.media-tile-actions .small-button {
  min-width: 0;
  min-height: 38px;
  padding: 0 7px;
  font-size: 10px;
}

/* Sticks to the BOTTOM, above the tab bar. It used to stick to the top, which put it
   off-screen under the app header exactly when it was needed: the operator has to
   scroll down to the grid to tick photos, and every batch action lives here. */
.media-batch-bar {
  position: sticky;
  /* 69px is the measured tab bar; the safe-area inset covers the home indicator. */
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--teal-line);
  border-radius: var(--radius);
  background: var(--surface-tint);
  box-shadow: 0 8px 24px rgba(15, 23, 25, .1);
}

.media-batch-bar > strong {
  color: var(--text);
  font-size: 12px;
}

.media-batch-bar > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.media-batch-hint {
  grid-column: 1 / -1;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.35;
}

.media-inspector-backdrop,
.media-inspector-close {
  display: none;
}

.media-inspector-desktop {
  display: contents;
}

.media-inspector-mobile-overlay {
  display: none;
}

.media-inspector {
  position: sticky;
  top: 0;
  min-width: 0;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.media-inspector--empty {
  min-height: 240px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.media-inspector--empty .icon {
  width: 30px;
  height: 30px;
}

.media-inspector--empty p {
  margin: 0;
  font-size: 12px;
}

.media-inspector-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #111719;
  color: #fff;
}

.media-inspector-preview .asset-thumb-media {
  object-fit: contain;
}

.media-inspector-preview > span {
  position: absolute;
  right: 9px;
  bottom: 9px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 25, .84);
  color: #fff;
  font-size: 10px;
  font-weight: 740;
}

.media-inspector-preview .icon {
  width: 14px;
  height: 14px;
}

.media-inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.media-inspector-head > div {
  min-width: 0;
}

.media-inspector-head span:first-child,
.media-inspector-section h3 {
  color: var(--faint);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.2;
  text-transform: uppercase;
}

.media-inspector-head h2 {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-file-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.media-file-facts div {
  min-width: 0;
  padding: 9px 10px;
  background: var(--surface-soft);
}

.media-file-facts dt {
  color: var(--faint);
  font-size: 9px;
  font-weight: 760;
  text-transform: uppercase;
}

.media-file-facts dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-inspector-section {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

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

.media-inspector-section h3 {
  margin: 0 0 8px;
}

.media-inspector-section .asset-governance,
.media-inspector-section .asset-prepare-actions {
  margin-top: 0;
}

.media-inspector-section .asset-governance-form {
  grid-template-columns: 1fr;
}

.media-inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

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

.media-rendition-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 9px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.media-rendition-preview {
  width: 64px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  background: #111719;
}

.media-rendition-preview .asset-thumb-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-rendition-info {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 4px;
}

.media-rendition-info > strong,
.media-rendition-info > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-rendition-info > strong {
  color: var(--text);
  font-size: 11px;
}

.media-rendition-info > small {
  color: var(--muted);
  font-size: 9px;
}

.media-rendition-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.media-rendition-actions .tiny-button {
  min-height: 44px;
}

.media-folder-assignment,
.media-folder-assignment-select,
.media-folder-memberships {
  display: grid;
  gap: 7px;
}

.media-folder-assignment-select > span,
.media-folder-memberships > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.media-folder-assignment-select select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.media-folder-memberships > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.media-folder-memberships small,
.media-folder-assignment-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.media-folder-remove {
  min-width: 0;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.media-folder-remove .icon {
  width: 14px;
  height: 14px;
}

.media-folder-picker-overlay {
  z-index: 48;
}

.media-folder-picker-card {
  max-height: min(82dvh, 680px);
  overflow: hidden;
}

.media-folder-picker-card .backlog-overlay-head {
  align-items: flex-start;
  margin-bottom: 12px;
}

.media-folder-picker-card .backlog-overlay-head h2,
.media-folder-picker-card .backlog-overlay-head p {
  margin: 0;
}

.media-folder-picker-card .backlog-overlay-head h2 {
  margin-top: 3px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

.media-folder-picker-card .backlog-overlay-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.media-folder-picker-kicker {
  color: var(--faint);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.media-folder-picker-file {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.media-folder-picker-thumb {
  width: 58px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #111719;
}

.media-folder-picker-thumb .asset-thumb-media {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-folder-picker-file > div:last-child {
  min-width: 0;
}

.media-folder-picker-file strong,
.media-folder-picker-file small {
  display: block;
  min-width: 0;
}

.media-folder-picker-file strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-folder-picker-file small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.media-folder-picker-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.media-folder-picker-body .media-folder-assignment {
  gap: 14px;
}

.media-folder-picker-actions .small-button {
  min-width: 120px;
  margin-left: auto;
}

.asset-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.asset-card--selected {
  border-color: var(--green-line);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px rgba(29, 128, 92, 0.18);
}

.asset-thumb {
  position: relative;
  width: 72px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.asset-thumb--safe-zone {
  aspect-ratio: 9 / 16;
}

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

.asset-thumb-missing {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 8px;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.asset-safe-zone {
  position: absolute;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 14%;
  background: rgba(15, 23, 42, 0.46);
  border-color: rgba(255, 255, 255, 0.58);
  pointer-events: none;
}

.asset-safe-zone--top {
  top: 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.72);
}

.asset-safe-zone--bottom {
  bottom: 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.72);
}

.asset-safe-zone-frame {
  position: absolute;
  top: 14%;
  right: 5px;
  bottom: 14%;
  left: 5px;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.26);
  pointer-events: none;
}

.asset-info {
  min-width: 0;
}

.asset-name {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 740;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.asset-meta-line {
  margin-top: 3px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.3;
}

.asset-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.asset-badge {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 740;
  line-height: 1.2;
}

.asset-badge--approved {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.asset-badge--rejected {
  border-color: rgba(191, 88, 88, 0.34);
  background: rgba(191, 88, 88, 0.09);
  color: #a13f3f;
}

.asset-badge--tag {
  color: var(--text);
}

.asset-quality-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.asset-quality-tags .tag {
  min-height: 20px;
  padding: 0 6px;
  font-size: 11px;
}

.asset-use-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.asset-use-hint {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 740;
  line-height: 1.2;
}

.asset-use-hint--ok {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.asset-use-hint--warn {
  border-color: #f2c878;
  background: var(--amber-soft);
  color: #9a5b00;
}

.asset-prepare-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.asset-prepare-actions > span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 740;
  line-height: 1.2;
  text-transform: uppercase;
}

.asset-prepare-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.asset-draft-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.asset-draft-actions > span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 740;
  line-height: 1.2;
  text-transform: uppercase;
}

.asset-draft-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.asset-governance {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.asset-governance-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.asset-governance-form {
  display: grid;
  grid-template-columns: minmax(96px, 0.7fr) minmax(120px, 1fr) auto;
  gap: 6px;
  align-items: end;
}

.asset-governance-form label {
  display: grid;
  gap: 3px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 740;
  line-height: 1.2;
  text-transform: uppercase;
}

.asset-governance-form input,
.asset-governance-form select,
.asset-governance-form textarea {
  min-width: 0;
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  text-transform: none;
}

.asset-governance-form textarea {
  min-height: 76px;
  padding: 9px;
  line-height: 1.4;
  resize: vertical;
}

.asset-governance-wide {
  grid-column: 1 / -1;
}

.tiny-button {
  min-height: 44px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 740;
}

.tiny-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.tiny-button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.tiny-button.primary:hover {
  color: #fff;
}

.tiny-button:disabled {
  cursor: not-allowed;
  opacity: .65;
}

.asset-feedback-ok {
  padding: 8px 10px;
  border: 1px solid var(--green-line);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  line-height: 1.35;
}

.asset-picker {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.asset-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.asset-picker-head > span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 720;
}

.asset-picker-head > span small {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 680;
}

.asset-picker-head.secondary {
  margin-top: 4px;
}

.asset-brand-shelf {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.asset-grid-brand {
  max-height: min(320px, 36vh);
}

.asset-picker-guide,
.asset-picker-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.asset-picker-empty {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.asset-picker-empty strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}

.asset-picker-note {
  padding: 8px 9px;
  border: 1px solid var(--green-line);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  line-height: 1.35;
}

.carousel-order-panel {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.carousel-order-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.carousel-order-list {
  display: grid;
  gap: 6px;
}

.carousel-order-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.carousel-order-index {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 760;
}

.carousel-order-thumb {
  width: 48px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: zoom-in;
}

.carousel-order-info {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.carousel-order-info strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carousel-order-info span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carousel-order-actions {
  display: flex;
  gap: 5px;
}

.carousel-order-button {
  width: 36px;
  height: 36px;
}

.backlog-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rubric-create-form {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.rubric-create-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rubric-create-head strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.media-check-panel {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.media-check-title {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
}

.media-check-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 7px;
}

.media-check-row {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.media-check-row--ok {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.media-check-row--warn {
  border-color: var(--amber-line);
  background: var(--amber-soft);
  color: #7a4b00;
}

.media-check-row--info {
  border-color: var(--teal-line);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.reel-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.reel-options-title {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
}

.reel-toggle {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
}

.reel-toggle input {
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--teal);
  flex: 0 0 auto;
}

.reel-options-note {
  padding: 7px 8px;
  border: 1px solid var(--teal-line);
  border-radius: var(--radius-sm);
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 11px;
  line-height: 1.35;
}

.reel-cover-control {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.reel-cover-copy {
  display: grid;
  gap: 3px;
}

.reel-cover-copy strong,
.reel-cover-selected strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
}

.reel-cover-copy span,
.reel-cover-selected span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.reel-cover-selected {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.reel-cover-selected img {
  width: 56px;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-soft);
}

.reel-cover-selected div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.reel-cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tabs {
  display: flex;
  min-width: 0;
  gap: 4px;
  overflow-x: auto;
  margin: -2px 0 12px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 1 0 max(98px, calc((100% - 12px) / 4));
  min-height: 44px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
}

.tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

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

.inbox-summary-cell {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
}

.inbox-summary-cell.red {
  border-color: #f0b8aa;
  background: #fff1ed;
}

.inbox-summary-cell.amber {
  border-color: #ecd39b;
  background: #fff8e6;
}

.inbox-summary-cell.teal {
  border-color: #b9d8d7;
  background: var(--teal-soft);
}

.inbox-summary-cell.green {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.inbox-summary-cell span {
  display: block;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.2;
}

.inbox-summary-cell strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.conversation {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.conversation--highlight {
  background: #eefafa;
  box-shadow: inset 3px 0 0 var(--teal);
}

.notification-event-card {
  grid-template-columns: 46px minmax(0, 1fr) auto;
}

.notification-event-card--active {
  box-shadow: inset 3px 0 0 var(--amber);
}

.notification-event-card .avatar .icon {
  width: 19px;
  height: 19px;
}

.notification-event-content {
  min-width: 0;
}

.notification-event-body {
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.notification-filters {
  margin: 0 0 10px;
}

.conversation:last-child {
  border-bottom: 0;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d9e1e3;
  color: #506065;
  font-size: 14px;
  font-weight: 780;
}

.avatar.photo {
  background: linear-gradient(135deg, rgba(0, 109, 112, .18), rgba(36, 111, 185, .12)), #dce6e8;
}

.conversation-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-bottom: 4px;
}

.conversation-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.15;
}

.conversation-text {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.35;
}

.conversation-meta {
  margin-top: 7px;
  color: var(--faint);
  font-size: 11px;
}

.lead-bridge {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lead-bridge-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.lead-bridge-link:hover,
.lead-bridge-link:focus-visible {
  text-decoration: underline;
}

.lead-bridge-link .icon {
  width: 14px;
  height: 14px;
}

.inbox-assistant {
  margin-top: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.inbox-assistant--red {
  border-color: #f0b8aa;
  background: #fff1ed;
}

.inbox-assistant--amber {
  border-color: #ecd39b;
  background: #fff8e6;
}

.inbox-assistant--teal {
  border-color: #b9d8d7;
  background: var(--teal-soft);
}

.inbox-assistant--green {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.inbox-assistant-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: #243336;
  font-size: 11px;
  line-height: 1.25;
}

.inbox-assistant-head strong {
  font-size: 12px;
}

.inbox-assistant-due {
  color: var(--muted);
  font-weight: 720;
}

.inbox-next-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(36, 51, 54, .1);
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.25;
}

.inbox-next-action span {
  color: var(--muted);
}

.inbox-next-action strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  text-align: right;
}

.inbox-assistant-detail {
  margin-top: 5px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.35;
}

.saved-replies {
  display: grid;
  gap: 7px;
  margin-bottom: 8px;
}

.saved-replies-head {
  display: grid;
  gap: 2px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.3;
}

.saved-replies-head strong {
  color: var(--text);
  font-size: 12px;
}

.saved-replies-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.saved-reply-button {
  min-height: 44px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 0 9px;
}

.saved-reply-button:active {
  transform: translateY(1px);
}

.saved-replies-editor {
  display: grid;
  gap: 10px;
}

.saved-reply-editor-list {
  display: grid;
  gap: 10px;
}

.saved-reply-editor-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.saved-reply-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.saved-reply-editor-head strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.saved-reply-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.saved-reply-editor-field,
.saved-reply-editor-grid label {
  display: grid;
  gap: 4px;
}

.saved-reply-editor-field span,
.saved-reply-editor-grid span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.2;
}

.saved-reply-editor-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-state.compact {
  padding: 8px 10px;
  font-size: 12px;
}

.conversation-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.small-button {
  min-width: 72px;
  min-height: 44px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 680;
}

/* Selected means selected wherever the button sits. This used to be styled only inside
   .media-view-controls and .collage-control-row, so the same markup read as chosen in
   the collage row and as nothing at all in the editor's action rows — which is how the
   clip length looked unpicked no matter which one you pressed. */
.small-button.active:not(.danger-button),
.small-button[aria-pressed="true"]:not(.danger-button) {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

/* A button that carries a meaning of its own keeps it when selected: the chosen
   "rejected" must not read as the same teal as every other choice. */
.small-button.danger-button.active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.small-button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.small-button.primary,
.primary-button {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.danger-button {
  border-color: var(--red-line);
  color: var(--red);
}

.danger-button:hover {
  border-color: var(--red);
}

.ai-panel {
  padding: 12px;
  border: 1px solid var(--teal-line);
  border-radius: var(--radius);
  background: #f4fbfb;
}

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

.ai-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 760;
  color: var(--teal-dark);
}

.ai-copy {
  margin: 0;
  padding: 10px;
  border: 1px solid #d4e8e9;
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 12px;
  line-height: 1.45;
  color: #354246;
}

.filters,
.modes {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar,
.modes::-webkit-scrollbar {
  display: none;
}

.filter {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.task-card,
.draft-card,
.campaign-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  margin-bottom: 10px;
}

.task-top,
.draft-top,
.campaign-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.task-title,
.draft-title,
.campaign-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 760;
}

.task-sub,
.draft-sub,
.campaign-sub {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.task-source {
  display: grid;
  grid-template-columns: minmax(74px, auto) minmax(0, 1fr);
  gap: 4px 8px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.task-source strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
}

.task-source em {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.mode {
  flex: 1 0 132px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 720;
}

.mode.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.draft-body {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: start;
}

.draft-media {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #edf5f5, #f7faf9);
  color: var(--muted);
}

.field-list {
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.field-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.field-label {
  color: var(--muted);
}

.preflight {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--amber-line);
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: var(--text);
  text-align: left;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 760;
}

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

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.day {
  min-width: 42px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.day.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.day-name {
  font-size: 11px;
  color: inherit;
  opacity: .76;
}

.day.active .day-name {
  opacity: 1;
}

.day-num {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 780;
}

.day-count {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 720;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  padding:
    7px
    max(6px, calc(6px + env(safe-area-inset-right)))
    calc(7px + env(safe-area-inset-bottom))
    max(6px, calc(6px + env(safe-area-inset-left)));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(12px);
}

.app-shell--overlay .bottom-nav {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.nav-item {
  min-width: 0;
  min-height: 54px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  line-height: 1;
}

.nav-item.active {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.nav-icon-wrap {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.desktop-notes {
  display: none;
}

.empty-state {
  padding: 24px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.empty-state.compact {
  padding: 12px;
  font-size: 12px;
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .app-shell {
    min-height: 100dvh;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(244, 246, 247, .92)),
      var(--bg);
  }

  .app {
    width: min(100%, 1480px);
    min-height: 100dvh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    background: transparent;
  }

  .app-main {
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    border-left: 1px solid var(--line);
    background: var(--phone);
  }

  .desktop-nav {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
    padding: 22px 16px;
    border-right: 1px solid rgba(223, 230, 231, .72);
    background: rgba(248, 250, 249, .88);
    backdrop-filter: blur(14px);
  }

  .desktop-brand {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 4px 2px 10px;
    border-bottom: 1px solid var(--line);
  }

  .desktop-brand-mark {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--teal);
    color: #fff;
  }

  .desktop-brand-mark .icon {
    width: 22px;
    height: 22px;
  }

  .desktop-brand strong,
  .desktop-account strong,
  .desktop-nav-label strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 780;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .desktop-brand span span,
  .desktop-nav-label small {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .desktop-nav-list {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
    padding-right: 2px;
  }

  .desktop-nav-item {
    width: 100%;
    min-height: 60px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    justify-content: stretch;
    gap: 9px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    text-align: left;
  }

  .desktop-nav-item .nav-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
  }

  .desktop-nav-item:hover {
    border-color: var(--line);
    background: var(--surface);
  }

  .desktop-nav-item.active {
    border-color: var(--teal-line);
    background: var(--surface-tint);
  }

  .desktop-nav-item.active .nav-icon-wrap {
    background: var(--teal);
    color: #fff;
  }

  .desktop-nav-label small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .desktop-account {
    min-width: 0;
    min-height: 64px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    text-align: left;
  }

  .desktop-account > .icon {
    width: 34px;
    height: 34px;
    padding: 7px;
    border-radius: var(--radius-sm);
    background: var(--surface-tint);
    color: var(--teal-dark);
  }

  .desktop-account .role-pill {
    width: fit-content;
    max-width: 100%;
    margin-top: 5px;
  }

  .topbar {
    position: sticky;
    top: 0;
    min-height: 78px;
    padding: 16px 24px;
    border-bottom-color: var(--line);
  }

  .topbar .account-switch {
    display: none;
  }

  .screen-title {
    font-size: 29px;
  }

  .screen-subtitle {
    max-width: 640px;
    font-size: 13px;
  }

  .content {
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px 34px;
    background: linear-gradient(#ffffff, #fbfcfc 52%, #f7f9f9);
  }

  .media-inspector {
    max-height: calc(100dvh - 129px);
  }

  .screen {
    max-width: 1180px;
    margin: 0;
  }

  [data-screen-name="today"] {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr);
    align-items: start;
    gap: 18px;
  }

  [data-screen-name="today"] > .queue-status {
    grid-column: 1 / -1;
  }

  [data-screen-name="today"] > .section {
    margin: 0;
  }

  .today-action-section {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .today-metrics-section {
    grid-column: 2;
    grid-row: 1;
  }

  .today-schedule-section {
    grid-column: 2;
    grid-row: 2;
  }

  .today-gaps-section {
    grid-column: 1;
    grid-row: 3;
  }

  .today-tasks-section {
    grid-column: 2;
    grid-row: 3;
  }

  .metric {
    padding: 14px 12px;
  }

  .metric-value {
    font-size: 24px;
  }

  .tabs {
    overflow: visible;
    gap: 8px;
  }

  .tab {
    flex: 0 0 auto;
    min-width: 116px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }

  .tab.active {
    border-color: var(--teal);
    background: var(--surface-tint);
  }

  .inbox-summary-grid {
    gap: 10px;
  }

  .conversation,
  .notification-event-card {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 14px 12px;
  }

  .conversation-actions {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .conversation .small-button {
    min-width: 0;
  }

  [data-screen-name="tasks"] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
  }

  [data-screen-name="tasks"] > .filters,
  [data-screen-name="tasks"] > .queue-status,
  [data-screen-name="tasks"] > .empty-state {
    grid-column: 1 / -1;
  }

  [data-screen-name="tasks"] .task-card {
    margin: 0;
  }

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

  .content-action {
    min-height: 76px;
  }

  .content-create-flow {
    padding: 14px;
  }

  .content-create-flow-head {
    grid-template-columns: minmax(0, 1fr) minmax(280px, .46fr);
    align-items: center;
  }

  .content-create-flow-copy h3 {
    font-size: 20px;
  }

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

  .content-work-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .45fr);
    align-items: start;
    gap: 12px;
  }

  .content-work-head {
    grid-column: 1 / -1;
  }

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

  .content-action-board {
    min-height: 100%;
  }

  .backlog-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
  }

  .draft-card,
  .backlog-item-card {
    margin: 0;
  }

  [data-screen-name="calendar"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, .72fr);
    align-items: start;
    gap: 18px;
  }

  [data-screen-name="calendar"] > .queue-status,
  [data-screen-name="calendar"] > .week-strip {
    grid-column: 1 / -1;
  }

  [data-screen-name="calendar"] > .section {
    margin: 0;
  }

  .week-strip {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
  }

  .bottom-nav {
    display: none;
  }

  .desktop-notes {
    display: none;
  }
}

/* ── Backlog screen ── */

.backlog-toolbar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.backlog-new-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: auto;
  min-height: 44px;
  font-size: 12px;
  font-weight: 720;
}

.badge.backlog-count {
  min-width: 17px;
  min-height: 17px;
  padding: 0 4px;
  margin-left: 3px;
  font-size: 11px;
  background: var(--surface-tint);
  border-color: var(--line-strong);
  color: var(--text-soft);
}

.filter.active .badge.backlog-count {
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
}

.backlog-item-card {
  display: block;
  width: 100%;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: border-color .15s ease, background .15s ease;
}

.backlog-item-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.backlog-item-card:last-child {
  margin-bottom: 0;
}

.backlog-item-main {
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.backlog-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.backlog-item-title {
  font-size: 13px;
  font-weight: 720;
  line-height: 1.3;
  color: var(--text);
  min-width: 0;
}

.backlog-item-right {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.backlog-item-tags {
  margin-top: 6px;
}

.content-card-readiness {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 5px;
  margin-top: 9px;
}

.content-ready-chip {
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 740;
  line-height: 1.15;
  text-align: center;
}

.content-ready-chip.ok {
  border-color: #b8e3c8;
  background: var(--green-soft);
  color: #166534;
}

.content-ready-chip.missing {
  border-color: #f1d096;
  background: var(--amber-soft);
  color: #8a5200;
}

.content-ready-chip.warning {
  border-color: #f1d096;
  background: var(--amber-soft);
  color: #8a5200;
}

.content-ready-chip.blocker {
  border-color: #f2b8b5;
  background: var(--red-soft);
  color: #991b1b;
}

.content-card-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.content-card-next > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
  text-transform: uppercase;
}

.content-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
}

.content-empty strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.content-empty span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.content-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* ── Backlog editor overlay ── */

.backlog-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: flex-end;
  justify-items: stretch;
  padding-top: env(safe-area-inset-top);
  background: rgba(15, 32, 36, .42);
  backdrop-filter: blur(3px);
  overflow: hidden;
}

.backlog-overlay-card {
  width: 100%;
  min-width: 0;
  max-height: calc(100dvh - max(12px, env(safe-area-inset-top)));
  display: flex;
  flex-direction: column;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: var(--surface);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.backlog-editor-card {
  overflow: hidden;
}

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

.backlog-overlay-head > div {
  min-width: 0;
}

.editor-autosave-status {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.editor-autosave-status[data-status="saved"] {
  color: var(--teal-dark);
}

.editor-autosave-status[data-status="error"],
.editor-autosave-status[data-status="conflict"] {
  color: var(--red);
}

.editor-conflict-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--red-line);
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--text);
}

.editor-conflict-panel > div:first-child {
  display: grid;
  gap: 3px;
}

.editor-conflict-panel span {
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.35;
}

.editor-conflict-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.backlog-overlay-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.backlog-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor-step-heading {
  min-width: 0;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.backlog-form > .editor-step-heading:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.editor-step-heading h3,
.editor-step-heading p {
  margin: 0;
  overflow-wrap: anywhere;
}

.editor-step-heading h3 {
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.editor-step-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.editor-step-fields {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.editor-advanced {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.editor-advanced > summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 760;
}

.editor-advanced-body {
  display: grid;
  gap: 12px;
  padding: 0 0 12px;
}

.editor-language-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.editor-language-tabs,
.editor-primary-language {
  display: flex;
  align-items: center;
  gap: 5px;
}

.editor-primary-language > span {
  margin-right: 3px;
  color: var(--muted);
  font-size: 11px;
}

.editor-bilingual-toggle {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  cursor: pointer;
}

.editor-bilingual-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.editor-bilingual-toggle span,
.editor-bilingual-toggle strong,
.editor-bilingual-toggle small {
  min-width: 0;
  display: block;
}

.editor-bilingual-toggle strong {
  font-size: 12px;
}

.editor-bilingual-toggle small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.editor-bilingual-active {
  flex: 0 0 auto;
}

.editor-language-tab {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font: inherit;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.editor-language-tab.active,
.editor-primary-language .tiny-button.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.editor-language-field.hidden {
  display: none;
}

.editor-compose-grid,
.editor-compose-main {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.instagram-preview-panel {
  min-width: 0;
  align-self: start;
}

.instagram-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--text-soft);
  font-size: 12px;
}

.instagram-preview-heading > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.instagram-preview-card {
  width: min(100%, 360px);
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.instagram-preview-account {
  height: 46px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 11px;
}

.instagram-preview-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.instagram-preview-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #101415;
}

.instagram-preview-card--vertical .instagram-preview-media {
  aspect-ratio: 9 / 16;
}

.instagram-preview-media > img,
.instagram-preview-media > video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.instagram-preview-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 20px;
  color: #b7c0c1;
  text-align: center;
  font-size: 11px;
}

.instagram-preview-empty .icon {
  width: 30px;
  height: 30px;
}

.instagram-preview-count {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 7px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .68);
  color: #fff;
  font-size: 10px;
}

.instagram-preview-cover-label {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.instagram-preview-nav {
  position: absolute;
  top: 50%;
  width: 30px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, .58);
  color: #fff;
  font: inherit;
  font-size: 24px;
  transform: translateY(-50%);
  cursor: pointer;
}

.instagram-preview-nav.previous { left: 0; }
.instagram-preview-nav.next { right: 0; }
.instagram-preview-nav:disabled { opacity: .25; cursor: default; }

.instagram-safe-zone {
  position: absolute;
  left: 0;
  right: 0;
  height: 13%;
  border-color: rgba(255, 255, 255, .7);
  background: rgba(0, 0, 0, .15);
  pointer-events: none;
}

.instagram-safe-zone.top {
  top: 0;
  border-bottom: 1px dashed rgba(255, 255, 255, .7);
}

.instagram-safe-zone.bottom {
  bottom: 0;
  border-top: 1px dashed rgba(255, 255, 255, .7);
}

.instagram-preview-actions {
  height: 38px;
  display: grid;
  grid-template-columns: repeat(3, 24px) 1fr;
  align-items: center;
  gap: 4px;
  padding: 5px 9px 0;
  font-size: 21px;
}

.instagram-preview-actions > span:last-child {
  justify-self: end;
}

.instagram-preview-actions .icon {
  width: 20px;
  height: 20px;
}

.instagram-preview-caption {
  min-height: 48px;
  max-height: 108px;
  padding: 5px 10px 11px;
  overflow: auto;
  font-size: 11px;
  line-height: 1.45;
}

.editor-versions-panel {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.editor-versions-panel > summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
}

.editor-versions-panel > summary::-webkit-details-marker {
  display: none;
}

.editor-versions-load {
  margin: 0 0 8px;
}

.editor-version-list {
  display: grid;
  gap: 0;
  padding-bottom: 8px;
}

.editor-version-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.editor-version-row > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.editor-version-row strong,
.editor-version-row span,
.editor-version-row p {
  overflow-wrap: anywhere;
}

.editor-version-row strong {
  font-size: 11px;
}

.editor-version-row span {
  color: var(--muted);
  font-size: 10px;
}

.editor-version-row p {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.35;
}

.backlog-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.backlog-label > span {
  font-size: 12px;
  font-weight: 720;
  color: var(--text-soft);
}

.backlog-input,
.backlog-select,
.backlog-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  line-height: 1.4;
}

.backlog-input:focus,
.backlog-select:focus,
.backlog-textarea:focus {
  outline: 2px solid var(--teal-soft);
  border-color: var(--teal);
}

.editor-jump-highlight {
  outline: 2px solid rgba(0, 109, 112, .35);
  outline-offset: 2px;
}

.backlog-textarea {
  resize: vertical;
  min-height: 88px;
}

.backlog-textarea.compact {
  min-height: 66px;
}

.editor-empty-relation > div {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px 7px 11px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.editor-empty-relation > div > span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.crop-editor-card {
  overflow: hidden;
}

.crop-overlay {
  z-index: 46;
}

.crop-overlay .backlog-overlay-head > div {
  min-width: 0;
}

.crop-file-name {
  display: block;
  max-width: 100%;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crop-editor-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(220px, 34dvh) minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.crop-preview-stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #111719;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.crop-preview-stage.is-dragging { cursor: grabbing; }

.crop-preview {
  position: relative;
  /* The caption preview sizes its type from the frame, not the viewport — the server
     draws it as a twenty-fifth of the photo's height whatever the screen. */
  container-type: size;
  width: min(100%, calc((34dvh - 24px) * var(--crop-ratio)));
  height: auto;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 6px;
  background: #090d0e;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .34);
}

.crop-preview-media {
  position: absolute;
  display: block;
  background: #090d0e;
  transform-origin: center;
  transition: left .12s ease, top .12s ease, width .12s ease, height .12s ease, filter .12s ease;
  will-change: left, top, width, height;
}

.crop-preview-backdrop {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(20px) brightness(.62) saturate(.9);
  transform: scale(1.04);
  opacity: .82;
  pointer-events: none;
}

.crop-preview-source {
  position: absolute;
  display: block;
  max-width: none;
  transform-origin: center;
}

.crop-preview-media.is-comparing {
  background: transparent;
}

.crop-preview-media.is-loaded:not(.is-comparing) {
  background: #fff;
}

.crop-preview-media--video {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .12s ease, object-position .12s ease;
  will-change: transform;
}

.crop-preview-filters {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

.crop-temperature-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.crop-preview-stage.is-dragging .crop-preview-media { transition: none; }
.crop-preview-stage.is-wheel-zooming .crop-preview-media { transition: none; }

.crop-preview-stage.is-position-locked { cursor: default; }

.crop-preview-stage.is-retouching { cursor: default; }

.crop-drag-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 4px;
  background: rgba(7, 11, 12, .76);
  color: #fff;
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
  z-index: 3;
}

.crop-safe-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 14% 72% 14%;
  pointer-events: none;
  z-index: 2;
}

.crop-safe-overlay::before,
.crop-safe-overlay::after {
  content: "";
  display: block;
  background: rgba(0, 0, 0, .38);
  border: 1px dashed rgba(255, 255, 255, .55);
}

.crop-safe-overlay::before { grid-row: 1; }
.crop-safe-overlay::after { grid-row: 3; }
.crop-safe-overlay span { display: none; }

.crop-editor-controls {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  padding: 2px 2px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.crop-preset-tabs,
.crop-mode-tabs,
.crop-smart-actions,
.crop-transform-actions,
.crop-editor-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crop-transform-actions .icon-button { min-width: 40px; min-height: 40px; }
.crop-transform-actions .small-button { min-height: 40px; }
.crop-transform-actions .crop-rotate-right .icon { transform: scaleX(-1); }

.crop-preset-tabs .tiny-button {
  flex: 1 1 92px;
}

.crop-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.crop-mode-tabs .small-button {
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text-soft);
  text-align: left;
}

.crop-mode-tabs .small-button:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.crop-mode-tabs .small-button .icon {
  width: 18px;
  height: 18px;
}

.crop-mode-tabs .small-button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 139, 145, .2);
}

.media-inspector-primary-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 8px;
}

.media-inspector-primary-actions .small-button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  white-space: nowrap;
}

.media-inspector-edit-photo {
  width: 100%;
}

.crop-frame-controls,
.crop-adjustment-controls {
  display: grid;
  gap: 14px;
}

.crop-transform-actions .icon-button[aria-pressed="true"] {
  border-color: var(--teal-line);
  background: var(--surface-tint);
  color: var(--teal-dark);
}

.crop-range-label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 720;
}

.crop-range-label input {
  width: 100%;
  accent-color: var(--teal);
}

.crop-range-label input[type="range"] {
  height: 28px;
  min-height: 28px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.crop-range-label input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal-line), var(--line-strong));
}

.crop-range-label input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 1px 5px rgb(0 0 0 / 28%);
  appearance: none;
  -webkit-appearance: none;
}

.crop-range-label input[type="range"]::-moz-range-track {
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--line-strong);
}

.crop-range-label input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--teal);
}

.crop-range-label input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 1px 5px rgb(0 0 0 / 28%);
}

.crop-range-label input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 3px solid var(--teal-line);
  outline-offset: 2px;
}

.crop-smart-actions .small-button {
  flex: 1 1 130px;
}

.crop-smart-actions .small-button .icon {
  width: 16px;
  height: 16px;
}

.crop-suggestion {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--teal-line);
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
}

.crop-suggestion strong {
  color: var(--teal-dark);
  font-size: 11px;
}

.crop-suggestion span {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.crop-save-destination {
  display: grid;
  gap: 7px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 720;
}

.crop-save-destination select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.crop-save-destination small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.crop-nondestructive-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.crop-editor-footer {
  flex: 0 0 auto;
  justify-content: flex-end;
  margin: 14px -16px calc(-18px - env(safe-area-inset-bottom));
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.crop-operation-status {
  flex: 1 1 100%;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.crop-editor-footer .small-button {
  min-height: 44px;
}

.backlog-overlay-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px -16px calc(-18px - env(safe-area-inset-bottom));
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -10px 24px rgba(15, 32, 36, .08);
}

.backlog-overlay-actions .small-button {
  min-height: 44px;
}

@media (max-width: 600px) {
  .notification-event-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .notification-event-card .conversation-actions {
    grid-column: 2;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .editor-step-fields {
    grid-template-columns: 1fr;
  }

  .quality-cta-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .editor-language-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-language-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .editor-primary-language {
    justify-content: space-between;
  }

  .editor-primary-language > span {
    margin-right: auto;
  }

  .editor-bilingual-toggle {
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
  }

  .bilingual-copy-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .bilingual-copy-head .small-button {
    grid-column: 1 / -1;
  }

  .bilingual-variants {
    grid-template-columns: 1fr;
  }

  .instagram-preview-card {
    width: min(100%, 320px);
  }

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

  .editor-version-row .small-button {
    justify-self: start;
  }

  .crop-editor-card button,
  .crop-editor-card input[type="range"] {
    min-height: 44px;
  }

  .crop-editor-card button {
    min-width: 44px;
  }

  .crop-editor-card .crop-transform-actions .icon-button,
  .crop-editor-card .crop-transform-actions .small-button {
    min-height: 44px;
  }

}

.task-create-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.tool-overlay-card {
  gap: 0;
}

.plan-assistant-grid,
.plan-assistant-main,
.plan-assistant-side {
  min-width: 0;
}

.plan-assistant-grid,
.plan-assistant-main,
.plan-assistant-side {
  display: grid;
  gap: 14px;
}

.plan-assistant-card .plan-week-section {
  margin-top: 0;
}

.plan-created-row > div:last-child {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.content-saved-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--teal-line);
  border-radius: var(--radius);
  background: var(--surface-tint);
}

.content-saved-banner strong,
.content-saved-banner span {
  display: block;
}

.content-saved-banner strong {
  color: var(--text);
  font-size: 13px;
}

.content-saved-banner div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.editor-save-confirmation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.content-card--recent {
  outline: 3px solid var(--teal-line);
  outline-offset: 2px;
}

.overlay-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.search-result {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.search-result-title {
  font-size: 13px;
  font-weight: 740;
  line-height: 1.25;
}

.search-result-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.settings-section {
  margin-bottom: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.settings-action {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font-size: 12px;
  font-weight: 720;
}

.settings-action.primary {
  border-color: var(--teal-line);
  background: var(--surface-tint);
  color: var(--teal-dark);
}

.settings-action .icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.push-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--teal-line);
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
}

.push-settings-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: flex-start;
}

.push-settings-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.push-status-cell {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.push-status-cell span,
.push-status-cell strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.35;
}

.push-status-cell span {
  color: var(--muted);
}

.push-status-cell strong {
  margin-top: 3px;
  color: var(--text);
}

.assistant-steps {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.assistant-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.assistant-step strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.assistant-step span:last-child {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.plan-section-head .manage-section-title {
  margin: 0;
}

.plan-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.plan-summary-cell {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
}

.plan-summary-cell span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.plan-summary-cell strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.plan-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 10px;
}

.plan-actions h4 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0;
}

.plan-action-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.plan-created-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-tint);
}

.plan-created-block h4 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0;
}

.plan-created-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.plan-created-main {
  min-width: 0;
}

.plan-created-main strong {
  display: block;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
}

.plan-created-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.plan-slots {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.plan-slot-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.plan-slot-head {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.plan-slot-theme {
  font-size: 13px;
  font-weight: 760;
  line-height: 1.3;
}

.plan-slot-reason {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.plan-slot-material {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
}

.plan-slot-material strong {
  font-weight: 760;
  overflow-wrap: anywhere;
}

.plan-slot-material small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.plan-slot-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 430px) {
  .plan-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .plan-created-row .small-button {
    width: 100%;
  }

  .content-saved-banner {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .content-saved-banner .small-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .saved-reply-editor-grid {
    grid-template-columns: 1fr;
  }

  .saved-reply-editor-actions .small-button {
    flex: 1 1 130px;
  }
}

.brand-rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand-rule-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.brand-rule-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.brand-rule-meta {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.brand-rule-description {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.brand-rule-textarea {
  min-height: 132px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.brand-rule-preview {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.brand-rule-preview-title {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  text-transform: uppercase;
}

.brand-rule-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.brand-rule-preview-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.brand-rule-actions {
  display: flex;
  justify-content: flex-end;
}

.brand-history-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.brand-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.brand-history-row div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.brand-history-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.brand-history-row span:not(.tag) {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.brand-rule-message,
.brand-rule-error {
  margin-bottom: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.35;
}

.brand-rule-message {
  border: 1px solid #b8ded8;
  background: #edf8f5;
  color: #17645a;
}

.brand-rule-error {
  border: 1px solid #f2c7bd;
  background: #fff2ef;
  color: #9a341f;
}

@media (max-width: 560px) {
  .brand-rule-card-head,
  .brand-history-row {
    grid-template-columns: minmax(0, 1fr);
    display: grid;
  }

  .brand-rule-meta {
    justify-content: flex-start;
  }
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .backlog-overlay {
    grid-template-columns: minmax(420px, 760px) 320px;
    gap: 24px;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }

  .backlog-overlay-card {
    grid-column: 1;
    justify-self: center;
    width: min(100%, 520px);
    max-width: 520px;
    max-height: 88dvh;
    border-radius: 14px;
    padding: 22px 20px;
  }

  .backlog-overlay:has(.media-folder-picker-card) {
    grid-template-columns: minmax(360px, 520px);
  }

  .media-folder-picker-card {
    grid-column: 1;
    width: min(100%, 520px);
    max-width: 520px;
    border-radius: var(--radius);
  }

  .backlog-overlay:has(.backlog-editor-card) {
    grid-template-columns: minmax(720px, 1100px);
  }

  .backlog-editor-card {
    grid-column: 1;
    width: min(96vw, 1100px);
    max-width: 1100px;
    max-height: 92dvh;
  }

  .backlog-editor-card .backlog-overlay-body {
    padding-right: 4px;
  }

  .editor-compose-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 22px;
  }

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

  .instagram-preview-panel {
    position: sticky;
    top: 0;
  }

  .backlog-editor-card .backlog-textarea:not(.compact) {
    min-height: 180px;
  }

  .backlog-editor-card .editor-media-section > .asset-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 12px;
  }

  .backlog-editor-card .editor-media-section > .asset-grid.compact > .asset-card {
    grid-template-columns: minmax(170px, .9fr) minmax(0, 1.1fr);
    padding: 12px;
  }

  .backlog-editor-card .editor-media-section > .asset-grid.compact > .asset-card .asset-thumb {
    width: 100%;
    aspect-ratio: 4 / 5;
  }

  .backlog-editor-card .asset-grid-scroll {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(560px, 58vh);
  }

  .backlog-overlay:has(.crop-editor-card) {
    grid-template-columns: minmax(760px, 920px);
  }

  .crop-editor-card {
    grid-column: 1;
    width: min(94vw, 920px);
    max-width: 920px;
    max-height: 92dvh;
  }

  .crop-editor-body {
    grid-template-columns: minmax(0, 1fr) 290px;
    grid-template-rows: minmax(0, 1fr);
    overflow: auto;
  }

  .crop-preview-stage {
    min-height: 0;
  }

  .crop-preview {
    width: min(100%, calc(min(66dvh, 640px) * var(--crop-ratio)));
    height: auto;
  }

  .crop-editor-controls {
    padding: 6px 2px;
    overflow-y: auto;
  }

  .brand-overlay-card {
    width: min(100%, 680px);
    max-width: 680px;
  }
}

@media (min-width: 1024px) {
  .backlog-overlay:has(.plan-assistant-card) {
    grid-template-columns: minmax(820px, 1120px);
    align-items: center;
    justify-content: center;
    padding: 24px;
  }

  .plan-assistant-card {
    grid-column: 1;
    justify-self: center;
    width: min(100%, 1120px);
    max-width: 1120px;
    max-height: 92dvh;
    padding: 22px 20px;
    border-radius: 14px;
  }

  .plan-assistant-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr);
    align-items: start;
  }

  .plan-assistant-card .plan-slots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Manage panel (campaigns / CTA overlay) ── */

.manage-section-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 760;
  color: var(--text);
}

.manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.manage-row:last-of-type {
  border-bottom: 0;
}

.manage-row-name {
  font-size: 13px;
  font-weight: 720;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.manage-campaign-card {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.manage-campaign-card:last-of-type {
  border-bottom: 0;
}

.manage-campaign-card .manage-row {
  padding: 0;
  border-bottom: 0;
}

.manage-cta-card {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.manage-cta-head {
  align-items: flex-start;
  padding: 0;
  border-bottom: 0;
}

.manage-cta-head .manage-row-name {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  overflow: visible;
  white-space: normal;
}

.manage-cta-meta {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.manage-cta-meta div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.manage-cta-meta span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.manage-cta-meta strong,
.manage-cta-meta a {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.manage-cta-meta a {
  color: var(--teal);
  text-decoration: none;
}

.manage-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.manage-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.manage-campaign-summary {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.manage-campaign-tags {
  margin-top: 6px;
  gap: 6px;
}

.manage-campaign-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.manage-rubric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.manage-rubric-check {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 640;
}

.manage-rubric-check input {
  flex: 0 0 auto;
}

.manage-rubric-check span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-rubric-check small {
  margin-left: auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.manage-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 560px) {
  .manage-cta-head {
    flex-direction: column;
    align-items: stretch;
  }

  .manage-cta-actions {
    flex-direction: column;
  }

  .manage-cta-head .small-button,
  .manage-cta-actions .small-button {
    width: 100%;
  }
}

/* ---------------------------------------------------------------------------
 * Preflight panel
 * --------------------------------------------------------------------------- */

.preflight-panel {
  margin: 14px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workflow-panel {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--teal-line);
  border-radius: var(--radius);
  background: var(--surface-tint);
}

.editor-focus-card {
  min-height: 58px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid #c7dcde;
  border-radius: var(--radius);
  background: #f7fbfb;
}

.editor-focus-card--ok {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.editor-focus-card--warn {
  border-color: #f2c7bd;
  background: #fff8f6;
}

.editor-focus-main {
  min-width: 0;
}

.editor-focus-main em,
.editor-focus-main strong,
.editor-focus-main span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.editor-focus-main em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 780;
  line-height: 1.2;
  text-transform: uppercase;
}

.editor-focus-main strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}

.editor-focus-main span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.editor-action-dock {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  margin: 12px -16px calc(-18px - env(safe-area-inset-bottom));
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -10px 24px rgba(15, 32, 36, .08);
}

@media (max-width: 600px) {
  .editor-conflict-panel,
  .editor-conflict-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-action-dock {
    position: relative;
    left: -14px;
    width: calc(100% + 28px);
    margin-right: 0;
    margin-left: 0;
  }

  .backlog-editor-card .backlog-input,
  .backlog-editor-card .backlog-select,
  .backlog-editor-card button,
  .backlog-editor-card summary {
    min-height: 44px;
  }

  .backlog-editor-card button,
  .backlog-editor-card summary {
    min-width: 44px;
  }
}

.editor-action-primary {
  display: grid;
  grid-column: 1 / -1;
}

.editor-action-primary .small-button {
  min-height: 42px;
  justify-content: center;
  font-size: 13px;
  font-weight: 780;
}

.editor-action-direct {
  display: flex;
  min-width: 0;
  gap: 7px;
}

.editor-action-direct .small-button {
  width: 100%;
  min-height: 40px;
}

.editor-more-actions {
  position: relative;
  justify-self: end;
}

.editor-more-actions[open] {
  grid-column: 1 / -1;
  width: 100%;
}

.editor-more-actions > summary {
  width: fit-content;
  min-height: 38px;
  list-style: none;
  cursor: pointer;
}

.editor-more-actions > summary::-webkit-details-marker { display: none; }

.editor-more-actions:not([open]) > div {
  display: none;
}

.editor-more-actions > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 7px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.editor-more-actions .small-button {
  min-width: 0;
  min-height: 38px;
}

@media (max-width: 600px) {
  .backlog-editor-card .editor-action-primary .small-button,
  .backlog-editor-card .editor-action-direct .small-button,
  .backlog-editor-card .editor-more-actions > summary,
  .backlog-editor-card .editor-more-actions .small-button {
    min-width: 44px;
    min-height: 44px;
  }
}

.editor-action-secondary {
  display: grid;
  gap: 7px;
}

.editor-action-secondary > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.editor-action-secondary > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.editor-action-secondary .small-button {
  flex: 1 1 140px;
  min-width: 0;
  min-height: 38px;
  font-size: 12px;
}

.workflow-head {
  margin-bottom: 9px;
}

.workflow-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}

.workflow-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.workflow-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.workflow-step {
  min-height: 42px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.workflow-step--ok {
  border-color: var(--green-line);
}

.workflow-step--info {
  border-color: #c7dcde;
  background: #f7fbfb;
}

.workflow-step--warn {
  border-color: #f2c7bd;
  background: #fff8f6;
}

.workflow-step-mark {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--surface-tint);
  color: var(--teal-dark);
}

.workflow-step--ok .workflow-step-mark {
  background: var(--green-soft);
  color: var(--green);
}

.workflow-step--warn .workflow-step-mark {
  background: var(--red-soft);
  color: var(--red);
}

.workflow-step-mark .icon {
  width: 15px;
  height: 15px;
}

.workflow-step-main {
  min-width: 0;
}

.workflow-step-main strong,
.workflow-step-main span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.workflow-step-main strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}

.workflow-step-main span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.schedule-quick-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 7px;
}

.publish-mode-control {
  display: grid;
  gap: 7px;
}

.publish-mode-control > span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 720;
}

.publish-mode-control > strong {
  color: var(--text);
  font-size: 13px;
}

.publish-mode-control > small,
.schedule-timezone-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.publish-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.publish-mode-button {
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.publish-mode-button.active {
  border-color: var(--teal-line);
  background: var(--surface);
  color: var(--teal-dark);
  box-shadow: 0 1px 4px rgba(15, 32, 36, .08);
}

.schedule-validation {
  display: grid;
  gap: 2px;
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid var(--green-line);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.schedule-validation span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.schedule-validation--error {
  border-color: var(--red-line);
  background: var(--red-soft);
  color: var(--red);
}

.social-platform-panel,
.social-delivery-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft, rgba(127, 127, 127, 0.05));
}

.social-platform-head,
.social-delivery-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.social-platform-head > div,
.social-delivery-head {
  display: grid;
  gap: 3px;
}

.social-platform-head span,
.social-delivery-head span,
.social-platform-card small,
.social-delivery-row span,
.social-delivery-row small {
  color: var(--muted);
  font-size: 12px;
}

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

.social-platform-card {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.social-platform-card.selected {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.social-platform-card > label {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  cursor: pointer;
}

.social-platform-card > label span,
.social-delivery-row > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.social-connection-state {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 13%, transparent);
  color: var(--amber-strong, var(--text));
  font-size: 11px;
}

.social-connection-state.connected {
  background: color-mix(in srgb, var(--teal) 13%, transparent);
  color: var(--teal);
}

.social-platform-fields,
.social-youtube-fields,
.social-delivery-list {
  display: grid;
  gap: 10px;
}

.social-copy-caption {
  width: fit-content;
  margin-top: 5px;
}

.social-option {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}

.social-delivery-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.social-delivery-row:first-child {
  border-top: 0;
}

.social-delivery-row > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

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

  .social-delivery-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .social-delivery-row > div:last-child {
    justify-content: flex-start;
  }
}

.schedule-quick-slots > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
}

.schedule-quick-slots > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preflight-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preflight-no-findings {
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
  padding: 6px 0;
}

.preflight-finding {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preflight-finding--red {
  background: var(--red-soft);
  border: 1px solid var(--red);
}

.preflight-finding--amber {
  background: var(--amber-soft);
  border: 1px solid var(--amber);
}

.preflight-finding--blue {
  background: var(--blue-soft);
  border: 1px solid var(--blue);
}

.preflight-finding-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preflight-finding-code {
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

.preflight-finding-msg {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.preflight-finding-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.preflight-finding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 3px;
}

.preflight-finding-actions .tiny-button {
  background: var(--surface);
}

.queue-status {
  margin: 8px 0 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.queue-status--ok {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
  font-weight: 680;
}

.queue-status--error {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: #7a4b00;
  font-weight: 680;
}

/* ---------------------------------------------------------------------------
 * Content card passport
 * --------------------------------------------------------------------------- */

.passport-panel {
  margin: 12px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.passport-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.passport-head h3 {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.25;
}

.passport-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.passport-tabs::-webkit-scrollbar {
  display: none;
}

.passport-tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 740;
}

.passport-tab.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.passport-body {
  margin-top: 10px;
}

.passport-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.passport-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(90px, 0.42fr) minmax(0, 1fr);
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  font-size: 11px;
  line-height: 1.3;
}

.passport-row span {
  color: var(--muted);
  font-weight: 700;
}

.passport-row strong,
.passport-row a {
  min-width: 0;
  color: var(--text);
  font-weight: 760;
  overflow-wrap: anywhere;
}

.passport-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.passport-metric {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.passport-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 740;
}

.passport-metric strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.passport-findings,
.passport-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.passport-finding,
.passport-history-row {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.passport-finding {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.passport-finding strong {
  min-width: 0;
  color: var(--text);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.passport-finding p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.passport-history-row {
  display: grid;
  grid-template-columns: minmax(82px, auto) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.passport-history-row strong {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.passport-history-row small {
  color: var(--faint);
  font-weight: 700;
}

@media (max-width: 370px) {
  .screen-title {
    font-size: 20px;
  }

  .topbar {
    padding-left: max(14px, calc(14px + env(safe-area-inset-left)));
    padding-right: max(14px, calc(14px + env(safe-area-inset-right)));
  }

  .account-switch {
    max-width: 92px;
  }

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

@media (max-width: 480px) {
  .today-tasks-section .quick-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 8px;
    min-height: 66px;
    padding-left: max(12px, calc(12px + env(safe-area-inset-left)));
    padding-right: max(12px, calc(12px + env(safe-area-inset-right)));
  }

  .screen-title {
    font-size: 20px;
  }

  .screen-subtitle {
    display: none;
  }

  .topbar .role-pill {
    display: none;
  }

  .top-actions {
    gap: 6px;
  }

  .account-switch {
    width: 44px;
    max-width: 44px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 0;
  }

  .account-switch-text,
  .account-switch-chevron {
    display: none;
  }

  .metrics {
    gap: 6px;
  }

  .metric {
    padding: 10px 8px;
  }

  .metric-value {
    font-size: 19px;
  }

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

  .conversation-actions {
    grid-column: 2;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .draft-media {
    min-height: 96px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .composer-intro,
  .content-action-grid,
  .content-summary-grid,
  .inbox-summary-grid,
  .campaign-idea-card,
  .manage-rubric-grid,
  .manage-date-grid,
  .asset-library-head,
  .push-status-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .inbox-next-action {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .inbox-next-action strong {
    text-align: left;
  }

  .editor-focus-card {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .editor-focus-card .small-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .task-source {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .task-source em {
    grid-column: auto;
    white-space: normal;
  }

  .composer-intro .small-button,
  .campaign-idea-card .small-button,
  .asset-upload-control {
    width: 100%;
  }

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

  .asset-card { grid-template-columns: 1fr; gap: 8px; }
  .asset-thumb { width: 100%; aspect-ratio: 4 / 5; }
  .asset-thumb--safe-zone { aspect-ratio: 9 / 16; }
  .asset-grid-scroll { max-height: min(520px, 72vh); }
  .asset-governance-form { grid-template-columns: 1fr; }
  .asset-governance-form .small-button { width: 100%; }
  .carousel-order-item { grid-template-columns: 28px 44px minmax(0, 1fr); }
  .carousel-order-thumb { width: 44px; }
  .carousel-order-actions { grid-column: 1 / -1; }
  .carousel-order-button { flex: 1 1 0; }
  .backlog-label-row { align-items: center; flex-direction: row; }
  .backlog-label-row .tiny-button { width: auto; }
  .rubric-create-head { align-items: flex-start; flex-direction: column; }
  .rubric-create-head .tiny-button { width: 100%; }

  .backlog-overlay-card {
    padding-left: 14px;
    padding-right: 14px;
  }

  .crop-editor-footer {
    margin-left: -14px;
    margin-right: -14px;
  }
}


.asset-lightbox {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 12px) 12px calc(env(safe-area-inset-bottom) + 12px);
  background: rgba(8, 16, 18, 0.9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.lightbox-media {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 8px);
  right: 12px;
  z-index: 1;
}

/* ---- Phase 6: Create workflows ---- */

.wf-panel {
  padding: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.wf-script-block {
  margin: 12px 0;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.wf-script-title {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wf-script-area {
  width: 100%;
  resize: vertical;
  background: var(--surface);
}

.swipe-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.swipe-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.swipe-card-url {
  font-size: 0.8rem;
  color: var(--blue);
  word-break: break-all;
  flex: 1;
}

.swipe-card-hook {
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.swipe-card-meta {
  margin: 0;
  font-size: 0.83rem;
  color: var(--muted);
}

.swipe-card-adapt {
  margin: 0;
  font-size: 0.83rem;
  color: var(--text);
  background: var(--surface-tint);
  border-left: 3px solid var(--teal);
  padding: 6px 8px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Phase 7: Reports ── */

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

.reports-btn {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 8px 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 680;
  text-align: left;
  cursor: pointer;
}

.reports-btn:hover {
  background: var(--surface-tint);
  border-color: var(--teal);
}

.report-section {
  margin-bottom: 4px;
}

.report-rubric-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.report-rubric-row:last-of-type {
  border-bottom: 0;
}

.report-rubric-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.report-rubric-bar-wrap {
  height: 5px;
  background: var(--teal-soft);
  border-radius: 3px;
  overflow: hidden;
}

.report-rubric-bar {
  height: 100%;
  background: var(--teal);
  border-radius: 3px;
  min-width: 2px;
  transition: width .3s ease;
}

.report-rubric-stats {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}

.report-campaign-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.report-campaign-row:last-of-type {
  border-bottom: 0;
}

.report-campaign-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.report-campaign-name {
  font-size: 13px;
  font-weight: 680;
  color: var(--text);
  line-height: 1.35;
}

.report-campaign-goal,
.report-campaign-note,
.report-campaign-next,
.report-campaign-top-item {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.report-campaign-tags {
  gap: 6px;
}

.report-campaign-next {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--text);
}

.report-campaign-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.report-campaign-top-title {
  font-size: 11px;
  font-weight: 720;
  color: var(--muted);
  text-transform: uppercase;
}

.report-campaign-top-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.report-campaign-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.report-cta-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.report-cta-row:last-of-type {
  border-bottom: 0;
}

.report-cta-channel {
  font-weight: 640;
  color: var(--text);
}

.report-cta-main {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

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

.report-cta-metrics span {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--faint);
  font-size: 10px;
  font-weight: 720;
  line-height: 1.15;
  text-transform: uppercase;
}

.report-cta-metrics strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.1;
  text-transform: none;
}

.report-gap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text);
}

.report-gap-row:last-of-type {
  border-bottom: 0;
}

.report-suggestion {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.report-suggestion:last-of-type {
  border-bottom: 0;
}

.report-suggestion-theme {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.report-suggestion-reason {
  font-size: 11px;
  color: var(--muted);
}

.report-reason-details,
.report-next-action {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.report-reason-details strong,
.report-next-action strong {
  color: var(--text-soft);
}

.report-reason-details ul {
  margin: 5px 0 0;
  padding-left: 16px;
}

.report-suggestion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-strategy-section,
.report-competitors-section {
  margin-bottom: 14px;
}

.reports-overlay-card {
  width: min(980px, calc(100vw - 48px));
  max-width: 980px;
}

.report-best-time {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.report-best-time > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.report-best-time span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
}

.report-best-time strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.report-competitor-row {
  display: grid;
  gap: 9px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.report-competitor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.report-competitor-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.report-competitor-head strong {
  color: var(--text);
  font-size: 13px;
}

.report-competitor-head a {
  color: var(--teal-dark);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.report-competitor-recommendation {
  padding: 8px 10px;
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

.report-competitor-recommendation.teal,
.report-competitor-recommendation.green { border-left-color: var(--green); }
.report-competitor-recommendation.blue { border-left-color: var(--blue); }

.report-competitor-update summary {
  width: fit-content;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
}

.report-competitor-update form,
.report-competitor-create {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
  margin-top: 9px;
}

.report-competitor-create {
  grid-template-columns: 1.2fr 1.2fr 1fr 1fr auto;
  padding-top: 12px;
}

@media (max-width: 720px) {
  .reports-overlay-card {
    width: 100%;
    max-width: none;
  }

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

  .report-competitor-head {
    display: grid;
  }

  .report-competitor-update form,
  .report-competitor-create {
    grid-template-columns: 1fr 1fr;
  }

  .report-competitor-update button,
  .report-competitor-create button {
    grid-column: 1 / -1;
  }
}

.media-folder-section-title--action,
.media-folder-actions,
.asset-search-row,
.media-sort-control,
.theme-segmented,
.media-performance-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-folder-section-title--action,
.media-performance-row {
  justify-content: space-between;
}

.media-folder-actions {
  width: max-content;
  max-width: 100%;
  padding: 4px 6px 10px;
}

.media-folder-actions .icon-button {
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
}

.asset-search-row {
  align-items: end;
}

.asset-search-row > input {
  flex: 1 1 auto;
  min-width: 160px;
}

.editor-asset-search {
  align-items: center;
  flex-direction: row;
}

.editor-asset-search .icon-button {
  flex: 0 0 44px;
}

.media-sort-control {
  flex: 0 0 auto;
}

.media-sort-control span,
.media-batch-folder-select span {
  color: var(--muted);
  font-size: 12px;
}

.media-sort-control select,
.media-batch-folder-select select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 0 30px 0 10px;
}

.media-batch-folder-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.media-usage-list {
  display: grid;
  gap: 6px;
}

.media-usage-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
}

.media-usage-item small,
.media-usage-loading {
  color: var(--muted);
  font-size: 12px;
}

.theme-segmented {
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .asset-search-row {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-asset-search {
    align-items: center;
    flex-direction: row;
  }

  .media-sort-control {
    justify-content: space-between;
  }

  .media-sort-control select,
  .media-batch-folder-select,
  .media-batch-folder-select select {
    width: 100%;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1416;
  --phone: #141b1e;
  --surface: #161e21;
  --surface-soft: #1b2427;
  --surface-tint: #143230;
  --text: #e7eef0;
  --muted: #9fb0b4;
  --faint: #7e8d91;
  --line: #2a3539;
  --line-strong: #3a474c;
  --teal: #0f777b;
  --teal-dark: #6fcacd;
  --teal-soft: #103a3c;
  --green: #54cc84;
  --green-soft: #15311f;
  --amber: #e0a23c;
  --amber-soft: #36290f;
  --red: #f07a7a;
  --red-soft: #3a1c1c;
  --blue: #6fb0e8;
  --blue-soft: #182a3c;
  --text-soft: #b3c0c3;
  --teal-line: #2c4a4d;
  --green-line: #2c4633;
  --amber-line: #4a3c1c;
  --red-line: #4a2c2c;
  --shadow: 0 18px 48px rgba(0, 0, 0, .55);
}

:root[data-theme="dark"] .content {
  background: linear-gradient(#141b1e, #121819 42%, #0f1517);
}

:root[data-theme="dark"] .auth-shell {
  background: linear-gradient(#141b1e, #0f1517);
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .editor-action-dock,
:root[data-theme="dark"] .backlog-overlay-actions {
  background: rgba(20, 27, 30, .9);
}

:root[data-theme="dark"] .bottom-nav {
  background: rgba(15, 21, 23, .94);
}

:root[data-theme="dark"] .desktop-nav {
  background: rgba(18, 24, 26, .92);
}

:root[data-theme="dark"] .app-shell { background: var(--bg); }
:root[data-theme="dark"] .app-main { background: var(--phone); }
:root[data-theme="dark"] .desktop-brand-mark { background: var(--teal); }
:root[data-theme="dark"] .desktop-notes,
:root[data-theme="dark"] .ai-copy,
:root[data-theme="dark"] .auth-field input { background: var(--surface); }
:root[data-theme="dark"] .content-create-flow {
  background: linear-gradient(180deg, #182729, var(--surface));
}
:root[data-theme="dark"] .content-flow-step { background: var(--surface-soft); }

:root[data-theme="dark"] .assistant-card,
:root[data-theme="dark"] .composer-intro,
:root[data-theme="dark"] .composer-guide,
:root[data-theme="dark"] .campaign-mode-card,
:root[data-theme="dark"] .ai-panel,
:root[data-theme="dark"] .assistant-context,
:root[data-theme="dark"] .conversation--highlight,
:root[data-theme="dark"] .editor-focus-card,
:root[data-theme="dark"] .workflow-step--info,
:root[data-theme="dark"] .brand-rule-message { background: var(--teal-soft); }
:root[data-theme="dark"] .draft-media { background: var(--surface-soft); }
:root[data-theme="dark"] .quality-panel,
:root[data-theme="dark"] .inbox-summary-cell.amber,
:root[data-theme="dark"] .inbox-assistant--amber { background: var(--amber-soft); }
:root[data-theme="dark"] .inbox-summary-cell.red,
:root[data-theme="dark"] .inbox-assistant--red,
:root[data-theme="dark"] .editor-focus-card--warn,
:root[data-theme="dark"] .workflow-step--warn,
:root[data-theme="dark"] .brand-rule-error { background: var(--red-soft); }
:root[data-theme="dark"] .avatar { background: var(--surface-soft); }
:root[data-theme="dark"] .avatar.photo { background: var(--teal-soft); }

:root[data-theme="dark"] .brand-assets-panel,
:root[data-theme="dark"] .brand-asset-button,
:root[data-theme="dark"] .inbox-summary-cell.teal,
:root[data-theme="dark"] .inbox-assistant--teal,
:root[data-theme="dark"] .editor-focus-card,
:root[data-theme="dark"] .workflow-step--info,
:root[data-theme="dark"] .brand-rule-message { border-color: var(--teal-line); }
:root[data-theme="dark"] .quality-panel,
:root[data-theme="dark"] .quality-score,
:root[data-theme="dark"] .quality-inline,
:root[data-theme="dark"] .quality-suggestion,
:root[data-theme="dark"] .quality-cta-option,
:root[data-theme="dark"] .quality-check,
:root[data-theme="dark"] .asset-use-hint--warn,
:root[data-theme="dark"] .inbox-summary-cell.amber,
:root[data-theme="dark"] .inbox-assistant--amber,
:root[data-theme="dark"] .content-ready-chip.missing,
:root[data-theme="dark"] .content-ready-chip.warning { border-color: var(--amber-line); }
:root[data-theme="dark"] .inbox-summary-cell.red,
:root[data-theme="dark"] .inbox-assistant--red,
:root[data-theme="dark"] .content-ready-chip.blocker,
:root[data-theme="dark"] .brand-rule-error,
:root[data-theme="dark"] .editor-focus-card--warn,
:root[data-theme="dark"] .workflow-step--warn { border-color: var(--red-line); }
:root[data-theme="dark"] .content-ready-chip.ok { border-color: var(--green-line); }
:root[data-theme="dark"] .tag.blue { border-color: var(--blue); }
:root[data-theme="dark"] .ai-copy { border-color: var(--line); }

:root[data-theme="dark"] .ai-copy,
:root[data-theme="dark"] .inbox-assistant-head { color: var(--text); }
:root[data-theme="dark"] .assistant-context,
:root[data-theme="dark"] .brand-rule-message { color: var(--teal-dark); }
:root[data-theme="dark"] .quality-check p,
:root[data-theme="dark"] .quality-check small,
:root[data-theme="dark"] .quality-empty,
:root[data-theme="dark"] .avatar { color: var(--muted); }
:root[data-theme="dark"] .quality-head h3,
:root[data-theme="dark"] .quality-head p,
:root[data-theme="dark"] .media-check-row--warn,
:root[data-theme="dark"] .queue-status--error,
:root[data-theme="dark"] .asset-use-hint--warn,
:root[data-theme="dark"] .content-ready-chip.missing,
:root[data-theme="dark"] .content-ready-chip.warning { color: var(--amber); }
:root[data-theme="dark"] .content-ready-chip.ok { color: var(--green); }
:root[data-theme="dark"] .content-ready-chip.blocker,
:root[data-theme="dark"] .brand-rule-error { color: var(--red); }

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f7;
  --phone: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --surface-tint: #eef7f6;
  --text: #172126;
  --muted: #647176;
  --faint: #5f6b6f;
  --line: #dfe6e7;
  --line-strong: #c7d2d5;
  --teal: #006d70;
  --teal-dark: #00545a;
  --teal-soft: #dff3f1;
  --green: #0f6e34;
  --green-soft: #e3f5ea;
  --amber: #8a5200;
  --amber-soft: #fff2d8;
  --red: #c52222;
  --red-soft: #fde8e8;
  --blue: #155a9c;
  --blue-soft: #e6f0fb;
  --text-soft: #415054;
  --teal-line: #b9dfe0;
  --green-line: #b9dfc8;
  --amber-line: #edd29f;
  --red-line: #f3c3c3;
  --shadow: 0 18px 48px rgba(15, 32, 36, .14);
}

:root[data-theme="light"] .content {
  background: linear-gradient(#fff, #f8faf9 42%, #f4f6f7);
}

:root[data-theme="light"] .auth-shell {
  background: linear-gradient(#fff, #f4f8f8);
}

:root[data-theme="light"] .topbar,
:root[data-theme="light"] .editor-action-dock,
:root[data-theme="light"] .backlog-overlay-actions {
  background: rgba(255, 255, 255, .9);
}

:root[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, .94);
}

:root[data-theme="light"] .desktop-nav {
  background: rgba(255, 255, 255, .92);
}

/* Phase 8: Account audit log rows */
.audit-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--text);
}

.audit-row:last-of-type {
  border-bottom: 0;
}

.audit-row .muted {
  color: var(--muted);
  font-size: 11px;
}

/* ── INS-028: service-worker update toast ── */
.sw-update-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 24px);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
}

/* A confirmation has nothing to click, so it should not reserve room for a button. */
.action-toast {
  justify-content: center;
}

.sw-update-toast span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.instagram-status-toast {
  box-sizing: border-box;
  width: min(560px, calc(100% - 24px));
}

.pwa-install-toast {
  bottom: calc(128px + env(safe-area-inset-bottom));
}

/* ── INS-015: tablet breakpoint (phone layout shouldn't stretch edge-to-edge) ── */
@media (min-width: 600px) and (max-width: 899px) {
  .app {
    max-width: 600px;
    margin: 0 auto;
  }

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

  .conversation-actions {
    grid-column: 2;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .bottom-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
  }
}

/* ── INS-046: respect reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ── INS-046a: dark mode (follows the OS preference) ──
   Most colors come from the :root tokens overridden below; the rest are
   literal-based component shades that get a dark equivalent here. White text
   on saturated buttons/chips (.primary/.active) intentionally stays white. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1416;
    --phone: #141b1e;
    --surface: #161e21;
    --surface-soft: #1b2427;
    --surface-tint: #143230;
    --text: #e7eef0;
    --muted: #9fb0b4;
    --faint: #7e8d91;
    --line: #2a3539;
    --line-strong: #3a474c;
    --teal: #0f777b;
    --teal-dark: #6fcacd;
    --teal-soft: #103a3c;
    --green: #54cc84;
    --green-soft: #15311f;
    --amber: #e0a23c;
    --amber-soft: #36290f;
    --red: #f07a7a;
    --red-soft: #3a1c1c;
    --blue: #6fb0e8;
    --blue-soft: #182a3c;
    --text-soft: #b3c0c3;
    --teal-line: #2c4a4d;
    --green-line: #2c4633;
    --amber-line: #4a3c1c;
    --red-line: #4a2c2c;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  }

  /* Chrome backgrounds (gradients / frosted glass use literal whites) */
  :root:not([data-theme="light"]) .content { background: linear-gradient(#141b1e, #121819 42%, #0f1517); }
  :root:not([data-theme="light"]) .app-shell { background: var(--bg); }
  :root:not([data-theme="light"]) .app-main { background: var(--phone); }
  :root:not([data-theme="light"]) .auth-shell { background: linear-gradient(#141b1e, #0f1517); }
  :root:not([data-theme="light"]) .topbar,
  :root:not([data-theme="light"]) .editor-action-dock,
  :root:not([data-theme="light"]) .backlog-overlay-actions { background: rgba(20, 27, 30, 0.9); }
  :root:not([data-theme="light"]) .bottom-nav { background: rgba(15, 21, 23, 0.94); }
  :root:not([data-theme="light"]) .desktop-nav { background: rgba(18, 24, 26, .92); }
  :root:not([data-theme="light"]) .desktop-brand-mark { background: var(--teal); }
  :root:not([data-theme="light"]) .desktop-notes,
  :root:not([data-theme="light"]) .ai-copy,
  :root:not([data-theme="light"]) .auth-field input { background: var(--surface); }
  :root:not([data-theme="light"]) .content-create-flow {
    background: linear-gradient(180deg, #182729, var(--surface));
  }
  :root:not([data-theme="light"]) .content-flow-step { background: var(--surface-soft); }

  /* Soft-accent panel backgrounds → dark tints by family */
  :root:not([data-theme="light"]) .assistant-card,
  :root:not([data-theme="light"]) .composer-intro,
  :root:not([data-theme="light"]) .composer-guide,
  :root:not([data-theme="light"]) .campaign-mode-card,
  :root:not([data-theme="light"]) .ai-panel,
  :root:not([data-theme="light"]) .assistant-context,
  :root:not([data-theme="light"]) .conversation--highlight,
  :root:not([data-theme="light"]) .editor-focus-card,
  :root:not([data-theme="light"]) .workflow-step--info,
  :root:not([data-theme="light"]) .brand-rule-message { background: var(--teal-soft); }
  :root:not([data-theme="light"]) .draft-media { background: var(--surface-soft); }
  :root:not([data-theme="light"]) .quality-panel,
  :root:not([data-theme="light"]) .inbox-summary-cell.amber,
  :root:not([data-theme="light"]) .inbox-assistant--amber { background: var(--amber-soft); }
  :root:not([data-theme="light"]) .inbox-summary-cell.red,
  :root:not([data-theme="light"]) .inbox-assistant--red,
  :root:not([data-theme="light"]) .editor-focus-card--warn,
  :root:not([data-theme="light"]) .workflow-step--warn,
  :root:not([data-theme="light"]) .brand-rule-error { background: var(--red-soft); }
  :root:not([data-theme="light"]) .avatar { background: var(--surface-soft); }
  :root:not([data-theme="light"]) .avatar.photo { background: var(--teal-soft); }

  /* Borders that used pale literals */
  :root:not([data-theme="light"]) .brand-assets-panel,
  :root:not([data-theme="light"]) .brand-asset-button,
  :root:not([data-theme="light"]) .inbox-summary-cell.teal,
  :root:not([data-theme="light"]) .inbox-assistant--teal,
  :root:not([data-theme="light"]) .editor-focus-card,
  :root:not([data-theme="light"]) .workflow-step--info,
  :root:not([data-theme="light"]) .brand-rule-message { border-color: var(--teal-line); }
  :root:not([data-theme="light"]) .quality-panel,
  :root:not([data-theme="light"]) .quality-score,
  :root:not([data-theme="light"]) .quality-inline,
  :root:not([data-theme="light"]) .quality-suggestion,
  :root:not([data-theme="light"]) .quality-cta-option,
  :root:not([data-theme="light"]) .quality-check,
  :root:not([data-theme="light"]) .asset-use-hint--warn,
  :root:not([data-theme="light"]) .inbox-summary-cell.amber,
  :root:not([data-theme="light"]) .inbox-assistant--amber,
  :root:not([data-theme="light"]) .content-ready-chip.missing,
  :root:not([data-theme="light"]) .content-ready-chip.warning { border-color: var(--amber-line); }
  :root:not([data-theme="light"]) .inbox-summary-cell.red,
  :root:not([data-theme="light"]) .inbox-assistant--red,
  :root:not([data-theme="light"]) .content-ready-chip.blocker,
  :root:not([data-theme="light"]) .brand-rule-error,
  :root:not([data-theme="light"]) .editor-focus-card--warn,
  :root:not([data-theme="light"]) .workflow-step--warn { border-color: var(--red-line); }
  :root:not([data-theme="light"]) .content-ready-chip.ok { border-color: var(--green-line); }
  :root:not([data-theme="light"]) .tag.blue { border-color: var(--blue); }
  :root:not([data-theme="light"]) .ai-copy { border-color: var(--line); }

  /* Text that was dark-on-light → light-on-dark */
  :root:not([data-theme="light"]) .ai-copy,
  :root:not([data-theme="light"]) .inbox-assistant-head { color: var(--text); }
  :root:not([data-theme="light"]) .assistant-context,
  :root:not([data-theme="light"]) .brand-rule-message { color: var(--teal-dark); }
  :root:not([data-theme="light"]) .quality-check p,
  :root:not([data-theme="light"]) .quality-check small,
  :root:not([data-theme="light"]) .quality-empty,
  :root:not([data-theme="light"]) .avatar { color: var(--muted); }
  :root:not([data-theme="light"]) .quality-head h3,
  :root:not([data-theme="light"]) .quality-head p,
  :root:not([data-theme="light"]) .media-check-row--warn,
  :root:not([data-theme="light"]) .queue-status--error,
  :root:not([data-theme="light"]) .asset-use-hint--warn,
  :root:not([data-theme="light"]) .content-ready-chip.missing,
  :root:not([data-theme="light"]) .content-ready-chip.warning { color: var(--amber); }
  :root:not([data-theme="light"]) .content-ready-chip.ok { color: var(--green); }
  :root:not([data-theme="light"]) .content-ready-chip.blocker,
  :root:not([data-theme="light"]) .brand-rule-error { color: var(--red); }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .media-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  }

  .media-folders {
    position: static;
    grid-column: 1 / -1;
  }

  .media-folder-desktop {
    max-height: 220px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2px 8px;
  }

  .media-folder-desktop h3,
  .media-folder-section-title {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1023px) {
  .media-inspector-desktop {
    display: none;
  }

  .media-inspector-mobile-overlay {
    display: contents;
  }

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

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

  .media-folders {
    position: static;
    order: -2;
  }

  .media-folder-mobile {
    display: block;
  }

  .media-folder-desktop {
    display: none;
  }

  .media-inspector {
    position: fixed;
    z-index: 61;
    top: auto;
    right: 0;
    bottom: calc(68px + env(safe-area-inset-bottom));
    left: 0;
    max-height: min(78dvh, 720px);
    overflow-y: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -16px 48px rgba(15, 23, 25, .24);
  }

  .media-inspector-backdrop {
    position: fixed;
    z-index: 60;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(15, 23, 25, .38);
  }

  .media-inspector-close {
    position: sticky;
    z-index: 2;
    top: 8px;
    float: right;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin: 8px 8px -52px 0;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(15, 23, 25, .86);
    color: #fff;
  }

  .media-inspector-close .icon {
    width: 17px;
    height: 17px;
  }

  .media-inspector--empty {
    display: none;
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 480px) {
  .media-screen-head {
    align-items: stretch;
    flex-direction: column;
  }

  .media-screen-head .asset-upload-control {
    width: 100%;
  }

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

  .media-assistant-head {
    display: grid;
  }

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

  .media-assistant-metrics span {
    white-space: normal;
  }

  .media-assistant-items {
    grid-template-columns: 1fr;
  }

  .media-stat {
    min-height: 56px;
  }

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

  .media-tile-preview {
    aspect-ratio: 1;
  }

  .media-tile-body {
    padding: 8px;
  }

  .media-tile-check {
    width: 44px;
    height: 44px;
  }

  .media-tile-name {
    min-height: 40px;
    display: flex;
    align-items: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .media-tile-meta {
    font-size: 11px;
  }

  .media-tile-body .asset-badges {
    display: none;
  }

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

  .media-tile-actions .small-button {
    min-height: 44px;
    font-size: 12px;
  }

  /* Was static and stacked into a 291px column, which is why it sat above the grid
     unreachable: you scroll down to tick photos and the actions stay behind you. One
     compact row that scrolls sideways fits above the tab bar instead. */
  .media-batch-bar {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
    padding: 8px 10px;
  }

  .media-batch-bar > strong {
    flex: 0 0 auto;
  }

  /* Wrap rather than scroll sideways: a horizontal strip hid "Create post" and
     "Make a collage" off to the left while leaving "Delete selected" in view. */
  .media-batch-bar > div {
    display: flex;
    flex: 1 1 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
  }

  .media-batch-bar .small-button {
    padding: 7px 10px;
    font-size: 12px;
  }

  .media-batch-bar > div > * {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .media-batch-bar .media-batch-hint {
    flex: 1 0 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .media-folder-picker-card {
    max-height: min(78dvh, 620px);
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .media-folder-picker-actions .small-button {
    width: 100%;
    margin-left: 0;
  }

  .bottom-nav .nav-item {
    font-size: 10px;
  }
}

@media (max-width: 350px) {
  .media-grid {
    grid-template-columns: 1fr;
  }
}
.workspace-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.workspace-selector {
  display: grid;
  gap: 4px;
  min-width: min(280px, 100%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workspace-selector select {
  min-height: 40px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0 34px 0 12px;
  font: inherit;
}

.workspace-selector.compact {
  min-width: 220px;
}

.media-screen-head-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.media-intake-open-button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 1.2;
  white-space: nowrap;
}

.media-intake-open-button .icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

@media (max-width: 720px) {
  .workspace-toolbar,
  .media-screen-head-actions {
    justify-content: stretch;
  }

  .media-screen-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .workspace-selector,
  .workspace-selector.compact,
  .workspace-selector select,
  .media-screen-head-actions .asset-upload-control,
  .media-screen-head-actions > .small-button {
    width: 100%;
  }

  .media-intake-create {
    grid-template-columns: 1fr;
  }

  .media-intake-create > button,
  .media-intake-created > button {
    width: 100%;
  }

  .media-intake-created {
    align-items: stretch;
    flex-direction: column;
  }
}

.inbox-owner-filters {
  margin: 10px 0;
}

.inbox-assignment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0;
  color: var(--muted);
  font-size: 12px;
}

.inbox-assignment-row select {
  min-height: 32px;
  max-width: 180px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.inbox-thread {
  display: grid;
  gap: 7px;
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.inbox-thread-message {
  width: min(88%, 560px);
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface);
}

.inbox-thread-message.outgoing {
  justify-self: end;
  background: color-mix(in srgb, var(--teal) 12%, var(--surface));
}

.inbox-thread-message span {
  color: var(--muted);
  font-size: 11px;
}

.inbox-thread-message p {
  margin: 4px 0 0;
}

.content-view-controls {
  display: inline-flex;
  gap: 4px;
  margin-right: 10px;
}

.content-select-box {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.content-select-box span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.backlog-item-card,
.content-visual-card {
  position: relative;
}

.backlog-item-card .backlog-item-main {
  padding-left: 44px;
}

.content-batch-bar {
  position: sticky;
  z-index: 4;
  top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgb(23 33 38 / 10%);
}

.content-batch-bar > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.content-visual-grid,
.content-feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.content-feed-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}

.content-visual-card > button {
  display: grid;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  overflow: hidden;
  text-align: left;
}

.content-visual-card img,
.content-visual-card video,
.content-visual-empty {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--surface-soft);
}

.content-visual-empty {
  display: grid;
  place-items: center;
}

.content-visual-card > button > span {
  display: grid;
  gap: 3px;
  padding: 10px;
}

.content-visual-card small {
  color: var(--muted);
}

.content-feed-card > button {
  border: 0;
  border-radius: 0;
}

.content-feed-card > button > span {
  display: none;
}

[data-calendar-drag-content] {
  cursor: grab;
}

[data-calendar-drag-content].is-dragging {
  opacity: .45;
}

.day.calendar-drop-active {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .content-list-head {
    align-items: start;
  }

  .content-list-head > div {
    display: grid;
    gap: 6px;
  }

  .content-view-controls {
    margin-right: 0;
    overflow-x: auto;
    max-width: 100%;
  }

  .content-batch-bar {
    align-items: stretch;
    flex-direction: column;
  }

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

.editor-approval-panel {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.editor-approval-head,
.approval-link-row,
.approval-comment-add {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.editor-approval-head h3 {
  margin: 0;
}

.approval-create-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 84px minmax(160px, 1fr) minmax(190px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.approval-create-row input,
.approval-create-row select,
.approval-link-row input,
.approval-comment-add textarea {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 10px;
}

.approval-create-row > label:not(.approval-required) {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.approval-required {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  color: var(--muted);
  font-size: 12px;
}

.approval-required input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.approval-gate {
  padding-left: 10px;
  border-left: 3px solid var(--amber);
  color: var(--muted);
  font-size: 13px;
}

.approval-gate.is-ready {
  border-left-color: var(--green);
  color: var(--text);
}

.approval-link-row input {
  flex: 1 1 auto;
}

.approval-history,
.approval-comments {
  display: grid;
  gap: 8px;
}

.approval-history > div,
.approval-comment {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.approval-history p,
.approval-comment p {
  margin: 0;
}

@media (max-width: 980px) {
  .approval-create-row {
    grid-template-columns: minmax(0, 1fr) minmax(84px, 0.35fr);
  }

  .approval-create-row > input,
  .approval-create-row > button,
  .approval-required {
    grid-column: 1 / -1;
  }
}

.approval-history small,
.approval-comment span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 720px) {
  .approval-create-row {
    grid-template-columns: 1fr;
  }

  .approval-link-row,
  .approval-comment-add {
    align-items: stretch;
    flex-direction: column;
  }

  .approval-link-row input,
  .approval-comment-add textarea,
  .approval-link-row button,
  .approval-comment-add button {
    width: 100%;
  }
}

.editor-mentions-panel {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.editor-mentions-head div,
.editor-mention-row > div:first-child {
  display: grid;
  gap: 3px;
}

.editor-mentions-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.mention-directory-form {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(130px, .6fr) auto;
  gap: 8px;
}

.mention-directory-form input,
.mention-directory-form select {
  min-height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.editor-mentions-head span,
.editor-mention-row span,
.editor-mention-row small {
  color: var(--muted);
  font-size: 12px;
}

.editor-mention-add {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, .7fr) auto;
  gap: 8px;
  align-items: end;
}

.editor-mention-add label,
.mention-position label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.editor-mention-add select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

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

.editor-mention-row {
  display: grid;
  grid-template-columns: minmax(140px, .7fr) minmax(200px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.mention-position {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) 1fr 1fr;
  gap: 8px;
}

.mention-position select {
  min-height: 32px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

@media (max-width: 720px) {
  .editor-mention-add,
  .editor-mention-row,
  .mention-directory-form {
    grid-template-columns: 1fr;
  }
}

/* Product workflow v122: calm daily shell and consistent command placement. */

.topbar-command-area {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-create-button {
  min-width: 132px;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--teal);
  border-radius: var(--radius-sm);
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 780;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.topbar-create-button .icon {
  width: 18px;
  height: 18px;
}

.topbar-create-button:hover {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.topbar-create-button:disabled {
  opacity: .52;
}

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

.today-workspace,
.today-primary-column,
.today-secondary-column {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 18px;
}

.today-workspace .section {
  grid-column: auto;
  grid-row: auto;
  margin: 0;
}

.today-secondary-column {
  gap: 14px;
}

.today-system-section .row {
  min-height: 54px;
}

.section-link-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  background: transparent;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 760;
}

.section-link-button .icon {
  width: 15px;
  height: 15px;
}

.content-command-bar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.content-command-bar .content-flow-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.content-command-bar .content-flow-step {
  padding: 7px 8px;
  border: 0;
  background: var(--surface-soft);
}

.content-command-bar .content-flow-step small {
  display: none;
}

.content-source-menu {
  position: relative;
}

.content-source-menu > summary {
  min-width: 132px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  list-style: none;
  cursor: pointer;
}

.content-source-menu > summary::-webkit-details-marker {
  display: none;
}

.content-source-menu-panel {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  right: 0;
  width: min(320px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(15, 23, 25, .16);
}

.content-source-menu-panel .small-button {
  min-height: 44px;
}

.content-source-context {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.content-source-context > .small-button {
  width: fit-content;
  min-height: 40px;
}

@media (min-width: 1024px) {
  [data-screen-name="today"] {
    display: block;
    width: 100%;
  }

  [data-screen-name="today"] > .today-workspace {
    width: 100%;
  }

  .today-workspace {
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr);
    gap: 24px;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 64px;
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .screen-title {
    font-size: 21px;
  }

  .screen-subtitle,
  .screen-title-row .role-pill {
    display: none;
  }

  .topbar-command-area,
  .top-actions {
    gap: 6px;
  }

  .section-link-button {
    min-height: 44px;
  }

  .topbar-create-button {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }

  .topbar-create-button span,
  .account-switch-text,
  .account-switch-chevron {
    display: none;
  }

  .account-switch {
    width: 44px;
    min-width: 44px;
    padding: 0;
    justify-content: center;
  }

  .content-command-bar {
    grid-template-columns: 1fr;
  }

  .content-command-bar .content-flow-steps {
    overflow-x: auto;
  }

  .content-source-menu > summary {
    width: 100%;
  }

  .content-source-menu-panel {
    position: static;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
  }
}

/* Search has no second entry point, so hiding it takes the feature away rather than
   moving it. The cutoff sat at 390px — the width of the most common iPhone — which put
   it out of reach on the very device the panel is designed for. Kept only for screens
   narrower than any current phone, where the header genuinely runs out of room. */
@media (max-width: 359px) {
  .top-actions [data-search-open] {
    display: none;
  }
}

/* Full-screen guided composer. */

.backlog-overlay:has(.backlog-editor-card) {
  display: block;
  padding: 0;
  background: var(--surface);
  backdrop-filter: none;
}

.backlog-editor-card {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0;
  border-radius: 0;
  background: var(--surface);
}

.backlog-editor-card .backlog-overlay-head {
  min-height: 68px;
  margin: 0;
  padding:
    max(12px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    12px
    max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
}

.backlog-editor-card .backlog-overlay-body {
  min-height: 0;
  padding: 18px max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
}

.backlog-editor-card .backlog-form {
  width: min(100%, 1240px);
  margin-inline: auto;
}

.editor-stage-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.editor-stage-button {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  text-align: left;
}

.editor-stage-button > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.editor-stage-button > span .icon {
  width: 15px;
  height: 15px;
}

.editor-stage-button strong {
  min-width: 0;
  color: inherit;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.editor-stage-button.complete > span {
  background: var(--green-soft);
  color: var(--green);
}

.editor-stage-button.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.editor-stage-button.active > span {
  background: var(--teal);
  color: #fff;
}

.editor-stage-panel {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.editor-stage-panel[hidden] {
  display: none;
}

.editor-stage-panel > .editor-step-heading:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.composer-panel > .editor-step-heading:not(:first-child) {
  margin-top: 12px;
}

.editor-stage-footer {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding:
    10px
    max(18px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 -8px 20px rgba(15, 23, 25, .06);
}

.editor-stage-footer .small-button {
  min-width: 124px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.editor-stage-footer .small-button:first-child .icon {
  transform: rotate(180deg);
}

.editor-stage-complete {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 760;
}

.editor-stage-complete .icon {
  width: 17px;
  height: 17px;
}

.backlog-editor-card .editor-action-dock {
  position: sticky;
  z-index: 6;
  bottom: 0;
  left: auto;
  width: auto;
  margin: 16px 0 0;
  padding:
    10px
    max(18px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}

.backlog-form[data-editor-active-stage="brief"] .instagram-preview-panel {
  display: none;
}

/* The publish stage is the composer now, so the preview column stays beside it. */
.composer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.composer-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 720;
}

.composer-tab.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.composer-tab.active .tag {
  border-color: rgba(255, 255, 255, .32);
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.composer-tab .tag {
  min-height: 18px;
  padding: 0 6px;
  font-size: 10px;
}

.composer-panel {
  display: grid;
  gap: 12px;
}

/* A class-level display beats the [hidden] attribute, which is how every inactive
   tab used to render stacked under the shared one. */
.composer-panel[hidden] {
  display: none;
}

.composer-channel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-tint);
}

.composer-channel-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.composer-channel-head strong {
  font-size: 13px;
}

.composer-channel-head span {
  font-size: 11px;
  color: var(--muted);
}

.composer-counter {
  justify-self: end;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.composer-counter.warn {
  color: var(--amber);
  font-weight: 720;
}

.composer-counter.over {
  color: var(--red);
  font-weight: 740;
}

.composer-schedule {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.composer-schedule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

.composer-mode-switch {
  display: inline-flex;
  gap: 6px;
}

.composer-quick-offsets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.composer-tab-alert {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.composer-tab-alert.blocker {
  background: var(--red);
}

.composer-tab.active .composer-tab-alert {
  background: #fff;
}

.composer-channel-findings {
  display: grid;
  gap: 8px;
}

.composer-joined-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  font-size: 11px;
  color: var(--muted);
}

.composer-joined-counter strong {
  font-variant-numeric: tabular-nums;
}

.composer-joined-counter.over {
  border-color: var(--red-line);
  background: var(--red-soft);
  color: var(--red);
}

.composer-quality {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.composer-quality-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.composer-quality-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.composer-quality-head strong {
  font-size: 12px;
}

.composer-quality-head span {
  font-size: 11px;
  color: var(--muted);
}

.composer-quality-score {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-soft);
}

.instagram-preview-title {
  padding: 0 10px;
  font-size: 13px;
  font-weight: 740;
}

@media (min-width: 1024px) {
  .backlog-overlay:has(.backlog-editor-card) {
    display: block;
    padding: 0;
  }

  .backlog-overlay:has(.backlog-editor-card) .backlog-editor-card {
    width: 100%;
    max-width: none;
    max-height: 100dvh;
  }

  .backlog-editor-card .editor-compose-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 28px;
  }

  .backlog-editor-card .instagram-preview-panel {
    top: 8px;
  }
}

@media (max-width: 600px) {
  .backlog-editor-card .backlog-overlay-head {
    min-height: 60px;
    padding-right: 12px;
    padding-left: 14px;
  }

  .backlog-editor-card .backlog-overlay-body {
    padding: 12px 12px 18px;
  }

  .editor-stage-nav {
    gap: 5px;
  }

  .editor-stage-button {
    min-height: 62px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 4px;
    padding: 6px 4px;
    text-align: center;
  }

  .editor-stage-button > span {
    width: 24px;
    height: 24px;
  }

  .editor-stage-button strong {
    font-size: 10px;
    line-height: 1.15;
  }

  .editor-stage-footer {
    padding-right: 12px;
    padding-left: 12px;
  }

  .editor-stage-footer .small-button {
    min-width: 112px;
  }
}

/* Media workspace views and non-blocking mobile inspector. */

.media-view-controls {
  height: 44px;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.media-view-controls .small-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.media-view-controls .small-button + .small-button {
  border-left: 1px solid var(--line);
}

.media-view-controls .icon {
  width: 16px;
  height: 16px;
}

.media-filter-disclosure {
  margin-top: 8px;
}

.media-filter-disclosure > summary {
  width: fit-content;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
}

.media-filter-disclosure > summary::-webkit-details-marker {
  display: none;
}

.media-filter-disclosure[open] > summary {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.media-filter-disclosure .asset-filter-row {
  margin-top: 8px;
}

.media-stats {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.media-stat {
  flex: 0 0 auto;
  min-width: 116px;
  min-height: 44px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
}

.media-stat strong {
  font-size: 15px;
}

.media-list {
  min-width: 720px;
  display: grid;
  border-top: 1px solid var(--line);
}

.media-catalog:has(.media-list) {
  overflow-x: auto;
}

@media (min-width: 1280px) {
  .media-screen:not(.media-screen--inspecting) .media-workspace {
    grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
  }

  .media-screen:not(.media-screen--inspecting) .media-inspector--empty {
    display: none;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .media-screen:not(.media-screen--inspecting) .media-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .media-screen:not(.media-screen--inspecting) .media-inspector--empty {
    display: none;
  }
}

.media-list-row {
  min-width: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: 36px minmax(260px, 1.5fr) 90px minmax(170px, 1fr) 110px auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.media-list-row--selected {
  background: var(--teal-soft);
}

.media-list-row--checked {
  box-shadow: inset 3px 0 0 var(--green);
}

.media-list-check {
  width: 36px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.media-list-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--teal);
}

.media-list-check span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.media-list-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.media-list-thumb {
  width: 48px;
  height: 48px;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #111719;
}

.media-list-thumb .asset-thumb-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-list-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.media-list-copy strong,
.media-list-copy small,
.media-list-usage {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-list-copy strong {
  font-size: 12px;
}

.media-list-copy small,
.media-list-type,
.media-list-usage {
  color: var(--muted);
  font-size: 10px;
}

.media-list-actions {
  display: flex;
  gap: 5px;
}

.media-list-actions .icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
}

@media (max-width: 1023px) {
  .media-inspector-backdrop {
    inset: 0;
  }

  .media-screen--inspecting .media-tile-actions,
  .media-screen--inspecting .media-list-actions {
    display: none;
  }

  .media-screen-head-actions {
    align-items: stretch;
  }

  .media-view-controls {
    flex: 1 1 180px;
  }
}

@media (max-width: 767px) {
  .media-catalog:has(.media-list) {
    overflow-x: visible;
  }

  .media-list {
    min-width: 0;
  }

  .media-list-row {
    min-height: 64px;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 6px;
    padding-right: 6px;
    padding-left: 4px;
  }

  .media-list-main {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 7px;
  }

  .media-list-thumb {
    width: 44px;
    height: 44px;
  }

  .media-list-type,
  .media-list-usage,
  .media-list-row > .asset-badge {
    display: none;
  }

  .media-list-actions {
    gap: 2px;
  }

  .media-list-actions .icon-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .media-screen-head-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .media-screen-head-actions .workspace-selector,
  .media-screen-head-actions .media-view-controls {
    grid-column: 1 / -1;
    width: 100%;
  }

  .media-screen-head-actions .media-intake-open-button,
  .media-screen-head-actions .asset-upload-control {
    width: 100%;
    min-width: 0;
  }

  .media-stat {
    min-width: 104px;
  }
}

/* Calendar: week planning on desktop, agenda on mobile. */

.calendar-desktop-week {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.calendar-week-column {
  min-width: 130px;
  min-height: 430px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.calendar-week-column:last-child {
  border-right: 0;
}

.calendar-week-column.active {
  background: var(--surface-tint);
}

.calendar-week-day {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.calendar-week-day span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.calendar-week-day strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-size: 20px;
}

.calendar-week-day small {
  color: var(--faint);
  font-size: 10px;
}

.calendar-week-column.active .calendar-week-day {
  box-shadow: inset 0 3px 0 var(--teal);
}

.calendar-week-events {
  min-height: 360px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 8px;
}

.calendar-week-post,
.calendar-week-empty {
  width: 100%;
  min-width: 0;
  min-height: 70px;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--teal-line);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm);
  background: var(--teal-soft);
  color: var(--text);
  text-align: left;
}

.calendar-week-post strong {
  color: var(--teal-dark);
  font-size: 11px;
}

.calendar-week-post > span:not(.inline-tags) {
  font-size: 11px;
  font-weight: 720;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.calendar-week-empty {
  min-height: 56px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border-style: dashed;
  border-left-width: 1px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.calendar-week-empty .icon {
  width: 16px;
  height: 16px;
}

.calendar-mobile-agenda {
  display: none;
}

.calendar-screen > .section {
  margin-top: 20px;
}

@media (min-width: 1024px) {
  [data-screen-name="calendar"] {
    display: block;
    width: 100%;
  }

  [data-screen-name="calendar"] > .section {
    margin-top: 20px;
  }
}

@media (max-width: 767px) {
  .calendar-desktop-week {
    display: none;
  }

  .calendar-mobile-agenda {
    display: block;
  }

  .calendar-mobile-agenda .week-strip {
    grid-template-columns: repeat(7, minmax(58px, 1fr));
    scroll-snap-type: x proximity;
  }

  .calendar-mobile-agenda .day {
    scroll-snap-align: start;
  }
}

.settings-disclosure {
  border-top: 1px solid var(--line);
}

.settings-disclosure > summary {
  min-height: 48px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
}

.settings-disclosure > summary::-webkit-details-marker {
  display: none;
}

.settings-disclosure > summary .icon {
  width: 17px;
  height: 17px;
}

.settings-disclosure > summary .chevron {
  color: var(--muted);
  transition: transform .15s ease;
}

.settings-disclosure[open] > summary .chevron {
  transform: rotate(90deg);
}

.settings-disclosure > .settings-section {
  margin-bottom: 12px;
}

/* ── Ретушь ─────────────────────────────────────────────────────────────── */

.retouch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  cursor: crosshair;
  touch-action: none;
}

.retouch-controls {
  display: grid;
  gap: 12px;
  padding: 8px 0 4px;
}

.retouch-animate {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm, 8px);
  background: rgb(0 0 0 / 4%);
}

.retouch-tool-hint {
  color: var(--muted, #647176);
  line-height: 1.35;
}

.enhance-tool-grid {
  display: grid;
  gap: 9px;
}

.enhance-tool-card {
  min-width: 0;
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.enhance-tool-card header {
  display: grid;
  gap: 3px;
}

.enhance-tool-card header strong {
  color: var(--text);
  font-size: 12px;
}

.enhance-tool-card header small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.enhance-tool-card > .small-button {
  width: 100%;
  min-height: 40px;
}

.enhance-motion {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: clip;
}

.enhance-motion summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 10px 34px 10px 11px;
  cursor: pointer;
  list-style: none;
  position: relative;
}

.enhance-motion summary::-webkit-details-marker { display: none; }

.enhance-motion summary::after {
  content: "+";
  position: absolute;
  right: 12px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.enhance-motion[open] summary::after { content: "−"; }

.enhance-motion summary > span {
  display: grid;
  gap: 3px;
}

.enhance-motion summary strong {
  color: var(--text);
  font-size: 12px;
}

.enhance-motion summary small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.enhance-motion-body {
  display: grid;
  gap: 9px;
  padding: 11px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

/* The batch switch sits with the save controls, where the decision it changes is made. */
.batch-apply {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 10px 0 2px;
}

/* ── Цветовые пресеты и подпись ──────────────────────────────────────────── */

/* Six thumbnails never fit a 290px control column, and stacking them buries the
   sliders below the fold. A scroller is what Instagram and Lightroom both do, and it
   behaves the same under a finger and under a trackpad. */
.look-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.look-chip {
  flex: 0 0 auto;
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted, #647176);
  font-size: 11px;
  scroll-snap-align: start;
  cursor: pointer;
}

.look-chip img {
  width: 60px;
  height: 60px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm, 8px);
  object-fit: cover;
  background: var(--surface-muted, #eef2f3);
}

.look-chip.active img {
  border-color: var(--teal);
}

.look-chip.active {
  color: var(--text);
  font-weight: 680;
}

/* The caption is positioned in normalized frame coordinates, the same values sent to
   Pillow. It stays inert outside the Text tab so dragging the photo remains natural. */
.overlay-preview {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.overlay-preview--interactive {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
}

.overlay-preview-bar {
  position: absolute;
  max-width: 88%;
  transform: translate(-50%, -50%);
  padding: 0.5em 0.6em;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: .35em;
  background: rgb(0 0 0 / 63%);
  color: #fff;
  font-size: 4cqh;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  box-shadow: 0 2px 10px rgb(0 0 0 / 24%);
}

.overlay-preview--interactive .overlay-preview-bar {
  pointer-events: auto;
  cursor: move;
  touch-action: none;
}

.overlay-preview--interactive .overlay-preview-bar:hover,
.overlay-preview--interactive .overlay-preview-bar:focus-visible,
.overlay-preview-bar.is-dragging {
  outline: 2px solid rgb(255 255 255 / 82%);
  outline-offset: 3px;
}

.overlay-preview-logo {
  position: absolute;
  right: 2%;
  bottom: 2%;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgb(255 255 255 / 85%);
  color: #111;
  font-size: 3cqh;
  font-weight: 680;
}

.overlay-font-sans { font-family: Arial, "Helvetica Neue", sans-serif; }
.overlay-font-serif { font-family: Georgia, "Times New Roman", serif; }
.overlay-font-condensed { font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif; font-weight: 760; }
.overlay-font-mono { font-family: "Courier New", ui-monospace, monospace; }

.overlay-controls,
.enhance-controls {
  display: grid;
  gap: 12px;
}

.overlay-font-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.overlay-font-field legend {
  margin-bottom: 7px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 720;
}

.overlay-font-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.overlay-font-option {
  min-width: 0;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.overlay-font-option.active {
  border-color: var(--teal);
  background: var(--surface-tint);
  color: var(--teal-dark);
  box-shadow: inset 0 0 0 1px var(--teal-line);
}

.overlay-position-control,
.overlay-logo-toggle {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.overlay-position-control > div,
.overlay-logo-toggle > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.overlay-position-control strong,
.overlay-logo-toggle strong {
  color: var(--text);
  font-size: 12px;
}

.overlay-position-control small,
.overlay-logo-toggle small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
}

.overlay-position-control .small-button {
  flex: 0 0 auto;
  min-height: 38px;
}

.overlay-logo-toggle {
  cursor: pointer;
}

.overlay-logo-toggle input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--teal);
}

/* A link that has to sit in a row of buttons and not look like the odd one out. */
.asset-download {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.asset-download--compact {
  min-width: 0;
}

/* The reason a paid control is grey. Not an error — nothing has gone wrong yet — so it
   reads as guidance rather than as the red of a failed run. */
.tool-blocked-reason {
  display: block;
  color: var(--muted, #647176);
  line-height: 1.35;
}

.tool-blocked-reason[hidden] {
  display: none;
}

.retouch-applied-steps {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 10px;
  border-radius: var(--radius-sm, 8px);
  background: rgb(0 0 0 / 4%);
}

/* ── Коллаж ─────────────────────────────────────────────────────────────── */

.collage-card {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
}

.collage-preview-wrap {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}

/* The preview mirrors the server layout, so what is on screen is what gets built. */
.collage-preview {
  position: relative;
  width: min(280px, 70vw);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 12%);
}

.collage-cell {
  position: absolute;
  box-sizing: border-box;
}

/* Free mode: the cell is the grab target, so the browser must not claim the gesture
   for scrolling or for a text selection. */
.collage-cell.is-free {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.collage-cell.is-free.is-dragging {
  cursor: grabbing;
}

.collage-cell.is-free:focus {
  outline: none;
}

.collage-cell.is-free.is-selected,
.collage-cell.is-free:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}

/* Big enough to hit with a thumb, and outside the photo so it never hides content. */
.collage-cell-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px 0 6px 0;
  background: var(--teal);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 70%);
  cursor: nwse-resize;
  touch-action: none;
}

/* Frames no longer tile the canvas, so its edge needs to be visible on its own. */
.collage-preview.is-free {
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 25%);
}

.collage-free-hint {
  margin: 0;
  text-align: center;
  color: var(--muted, #647176);
  font-size: 0.85rem;
  line-height: 1.35;
}

.collage-cell > span {
  display: block;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* No placeholder fill: in "fit whole" mode the gap around a photo must show the
     collage background, which is what the server actually renders there. */
}

.collage-controls {
  display: grid;
  gap: 12px;
  padding: 8px 0 4px;
}

.collage-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.collage-control-row > span {
  font-weight: 650;
}

.collage-control-row > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.collage-control-row input[type="color"] {
  width: 44px;
  height: 32px;
  padding: 0;
  border: 1px solid #c7d2d5;
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

@media (max-width: 480px) {
  .collage-control-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

.editor-collage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.editor-collage-row small {
  color: var(--muted, #647176);
  line-height: 1.35;
}

/* Audit repairs: keep controls readable and reachable at every supported width. */
.filter {
  white-space: nowrap;
}

.media-showing-count {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.media-folder-button span {
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.content-select-box {
  width: 32px;
  height: 32px;
}

.content-select-box input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.crop-range-label input[type="range"] {
  min-height: 28px;
}

.calendar-week-toolbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 44px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-week-toolbar > strong {
  min-width: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.25;
}

.calendar-week-previous .chevron {
  transform: rotate(180deg);
}

.calendar-loading {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.calendar-empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
}

@media (min-width: 1280px) {
  .media-folder-desktop {
    max-height: none;
    overflow: visible;
  }
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .backlog-overlay:has([data-tasks-create-form]) {
    grid-template-columns: minmax(420px, 520px);
  }
}

@media (min-width: 721px) and (max-width: 1023px) {
  .screen-title-row .role-pill {
    display: none;
  }

  .screen-title {
    font-size: 24px;
  }
}

@media (max-width: 1023px) {
  [data-screen-name="create"] .filters {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .calendar-desktop-week {
    display: none;
  }

  .calendar-mobile-agenda {
    display: block;
  }

  .calendar-mobile-agenda .week-strip {
    grid-template-columns: repeat(7, minmax(40px, 1fr));
    overflow-x: visible;
  }
}

@media (max-width: 600px) {
  [data-screen-name="inbox"] .tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  [data-screen-name="inbox"] .tab {
    min-width: 0;
    padding-right: 4px;
    padding-left: 4px;
    font-size: 11px;
    line-height: 1.15;
    white-space: normal;
  }

  .content-view-controls {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
  }

  .content-view-controls .small-button {
    min-width: 0;
    padding-right: 4px;
    padding-left: 4px;
    font-size: 11px;
  }

  .content-select-box {
    width: 44px;
    height: 44px;
  }

  .content-select-box input,
  .media-tile-check input {
    width: 20px;
    height: 20px;
  }

  .media-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .media-stat {
    min-width: 0;
  }

  .media-screen-head-actions .asset-upload-control > span,
  .media-screen-head-actions .asset-upload-control > span > span {
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }

  .calendar-week-toolbar {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .calendar-week-toolbar > .small-button {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .calendar-week-toolbar > .icon-button:last-of-type {
    grid-column: 3;
    grid-row: 1;
  }
}
