:root {
  --orange: #ff4d00;
  --black: #0a0a0a;
  --white: #fff;
  --canvas: #f5f5f3;
  --surface: #fff;
  --surface-2: #eee;
  --text: #111;
  --muted: #737373;
  --line: #dededb;
  --success: #14a36f;
  --warning: #bf7415;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] {
  --canvas: #0f0f0f;
  --surface: #171717;
  --surface-2: #242424;
  --text: #f7f7f5;
  --muted: #9b9b9b;
  --line: #303030;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
}
* {
  box-sizing: border-box;
}
html {
  font-family: Inter, system-ui, sans-serif;
  background: var(--canvas);
  color: var(--text);
}
body {
  margin: 0;
  background: var(--canvas);
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(255, 77, 0, 0.25);
  outline-offset: 2px;
}
.shell {
  min-height: 100vh;
}
.sidebar {
  width: 252px;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--black);
  color: #fff;
  padding: 27px 17px 20px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.platform-brand {
  padding: 3px 10px 27px;
  display: flex;
  flex-direction: column;
}
.brand-number {
  font-family: "Space Grotesk";
  font-size: 28px;
  line-height: 0.9;
  letter-spacing: -0.07em;
  color: var(--orange);
  font-weight: 700;
}
.platform-brand > span:last-child {
  font-family: "Space Grotesk";
  font-size: 11px;
  margin-top: 6px;
}
.client-switcher-wrap {
  padding: 0 7px 22px;
}
.client-switcher-wrap label {
  display: block;
  font-size: 8px;
  color: #777;
  margin: 0 0 7px;
}
.client-switcher-wrap select {
  width: 100%;
  border: 1px solid #333;
  background: #171717;
  color: #fff;
  border-radius: 8px;
  padding: 10px;
  font-size: 10px;
}
.sidebar nav {
  display: grid;
  gap: 4px;
}
.nav {
  border: 0;
  background: transparent;
  color: #939393;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 11px;
}
.nav i {
  font-style: normal;
  width: 18px;
  text-align: center;
  font-size: 14px;
}
.nav:hover {
  color: #fff;
  background: #181818;
}
.nav.active {
  background: #27201d;
  color: #fff;
}
.nav.active i {
  color: var(--orange);
}
.admin-only {
  display: none;
}
.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 13px;
}
.safe-mode {
  border-top: 1px solid #292929;
  padding: 16px 9px 0;
  display: flex;
  gap: 10px;
}
.safe-mode > b,
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(20, 163, 111, 0.13);
  margin-top: 3px;
}
.safe-mode strong,
.safe-mode span {
  display: block;
  font-size: 8px;
}
.safe-mode span {
  color: #747474;
  margin-top: 3px;
}
main {
  margin-left: 252px;
  min-height: 100vh;
}
.topbar {
  height: 78px;
  position: sticky;
  top: 0;
  z-index: 15;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  padding: 0 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar p {
  font-size: 8px;
  color: var(--muted);
  margin: 0 0 5px;
}
.topbar h1 {
  font-family: "Space Grotesk";
  font-size: 16px;
  margin: 0;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.context-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 99px;
  padding: 8px 12px;
  font-size: 9px;
  font-weight: 700;
}
.round-button,
.avatar {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.avatar {
  border: 0;
  cursor: pointer;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.mobile-menu {
  display: none;
}
.view {
  display: none;
  padding: 30px 34px 55px;
  max-width: 1500px;
  margin: auto;
}
.view.active {
  display: block;
}
.overview-hero {
  min-height: 260px;
  background: var(--black);
  color: #fff;
  border-radius: 4px;
  padding: 40px 42px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.overview-hero h2,
.page-heading h2 {
  font-family: "Space Grotesk";
  letter-spacing: -0.045em;
}
.overview-hero h2 {
  font-size: 38px;
  line-height: 1.02;
  margin: 15px 0 12px;
}
.overview-hero p {
  font-size: 11px;
  color: #aaa;
  max-width: 570px;
  line-height: 1.65;
  margin: 0 0 20px;
}
.hero-1011 {
  position: absolute;
  right: -28px;
  bottom: -73px;
  font-family: "Space Grotesk";
  font-weight: 700;
  font-size: 210px;
  letter-spacing: -0.12em;
  color: #181818;
  line-height: 1;
}
.overline {
  font-size: 8px;
  color: var(--orange);
  font-weight: 700;
}
.orange-button,
.quiet-button,
.disabled-action {
  border-radius: 7px;
  border: 0;
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 700;
}
.orange-button {
  background: var(--orange);
  color: #fff;
}
.orange-button:hover {
  background: #df4300;
}
.quiet-button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}
.disabled-action {
  background: var(--surface-2);
  color: var(--muted);
  width: 100%;
}
.full {
  width: 100%;
}
.status-line {
  display: flex;
  gap: 28px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--surface);
  padding: 13px 18px;
  font-size: 8px;
  color: var(--muted);
}
.status-line span:first-child {
  color: var(--text);
  display: flex;
  gap: 9px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--surface);
}
.metrics article {
  padding: 20px 22px;
  border-right: 1px solid var(--line);
}
.metrics article:last-child {
  border: 0;
}
.metrics span,
.metrics small {
  display: block;
  font-size: 8px;
  color: var(--muted);
}
.metrics strong {
  font-family: "Space Grotesk";
  font-size: 28px;
  display: block;
  margin: 7px 0 3px;
}
.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.overview-grid {
  display: grid;
  grid-template-columns: 1.55fr 0.75fr;
  gap: 15px;
  margin-top: 15px;
}
.overview-grid > .surface {
  padding: 21px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 13px;
}
.section-title h3,
.guardrail h3 {
  font-size: 12px;
  margin: 0 0 5px;
}
.section-title p,
.guardrail p {
  font-size: 9px;
  color: var(--muted);
  margin: 0;
}
.activity-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.activity-date {
  background: var(--surface-2);
  padding: 8px 4px;
  border-radius: 7px;
  text-align: center;
  font-size: 8px;
}
.activity-date strong {
  font-size: 13px;
  display: block;
}
.activity-row h4 {
  font-size: 10px;
  margin: 0 0 3px;
}
.activity-row p {
  font-size: 8px;
  color: var(--muted);
  margin: 0;
}
.mini-status,
.read-only-badge {
  font-size: 7px;
  background: #fff0e9;
  color: #b83900;
  border-radius: 99px;
  padding: 6px 8px;
  font-style: normal;
  font-weight: 700;
}
.guardrail {
  background: var(--black);
  color: #fff !important;
}
.guardrail p {
  color: #999;
}
.lock-icon {
  color: var(--orange);
  font-size: 24px;
}
.guardrail ul {
  list-style: none;
  padding: 12px 0 0;
  margin: 12px 0 0;
  border-top: 1px solid #2c2c2c;
}
.guardrail li {
  font-size: 8px;
  color: #aaa;
  padding: 5px 0;
}
.guardrail li:before {
  content: "✓";
  color: var(--orange);
  margin-right: 8px;
}
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 23px;
}
.page-heading h2 {
  font-size: 27px;
  margin: 6px 0;
}
.page-heading p {
  font-size: 10px;
  color: var(--muted);
  margin: 0;
}
.studio-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 20px;
}
.creator {
  padding: 24px;
  display: grid;
  gap: 18px;
}
.creator label {
  display: grid;
  gap: 7px;
  font-size: 9px;
  font-weight: 700;
}
.creator input,
.creator textarea,
.creator select,
.period {
  background: var(--canvas);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px;
  font-size: 10px;
}
.creator textarea {
  resize: vertical;
  line-height: 1.5;
}
.creator small {
  font-size: 7px;
  color: var(--muted);
  text-align: center;
}
.form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.creative-preview {
  position: sticky;
  top: 104px;
}
.concept-card {
  aspect-ratio: 1;
  background: linear-gradient(135deg, #111 0, #111 55%, #ff4d00 55%);
  color: #fff;
  padding: 9%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}
.concept-card:before {
  content: "1011";
  position: absolute;
  right: -3%;
  top: -8%;
  font-family: "Space Grotesk";
  font-size: 110px;
  color: rgba(255, 255, 255, 0.07);
  letter-spacing: -0.1em;
}
.concept-card span {
  font-size: 7px;
  color: #ff9a70;
}
.concept-card strong {
  font-family: "Space Grotesk";
  font-size: 32px;
  line-height: 1;
  margin: 12px 0;
}
.concept-card p {
  max-width: 330px;
  font-size: 9px;
  line-height: 1.5;
}
.concept-card em {
  font-size: 7px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 99px;
  padding: 6px 8px;
  font-style: normal;
}
.approval-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 8px;
}
.permission-strip,
.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  margin-bottom: 14px;
}
.permission-strip b {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-top: 3px;
}
.permission-strip b.warning {
  background: var(--warning);
}
.permission-strip strong,
.permission-strip p,
.warning-banner strong,
.warning-banner p {
  display: block;
  margin: 0;
  font-size: 9px;
}
.permission-strip p,
.warning-banner p {
  color: var(--muted);
  font-size: 8px;
  margin-top: 4px;
}
.facebook-posts {
  display: grid;
  gap: 11px;
}
.facebook-post-row {
  display: grid;
  grid-template-columns: 175px 1fr 190px;
  min-height: 175px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.facebook-post-media {
  background: #111;
  position: relative;
}
.facebook-post-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.facebook-post-media.no-media {
  display: grid;
  place-items: center;
  color: #666;
  font-family: "Space Grotesk";
  font-size: 25px;
}
.facebook-post-content {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}
.facebook-post-date {
  font-size: 7px;
  color: var(--orange);
  font-weight: 700;
  margin-bottom: 9px;
}
.facebook-post-message {
  white-space: pre-line;
  font-size: 9px;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
}
.facebook-post-id {
  font-size: 7px;
  color: var(--muted);
  margin-top: auto;
  padding-top: 10px;
}
.facebook-post-stats {
  padding: 18px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.facebook-post-stats h4 {
  font-size: 9px;
  margin: 0 0 10px;
}
.engagement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.engagement-stat {
  background: var(--canvas);
  border-radius: 6px;
  padding: 8px;
}
.engagement-stat strong,
.engagement-stat span {
  display: block;
}
.engagement-stat strong {
  font-size: 12px;
}
.engagement-stat span {
  font-size: 6px;
  color: var(--muted);
}
.engagement-note {
  margin: 8px 0 10px;
  font-size: 7px;
  color: var(--muted);
}
.facebook-link {
  margin-top: auto;
  text-decoration: none;
  color: var(--orange);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  font-size: 8px;
  font-weight: 700;
}
.loading-state {
  min-height: 250px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.loading-state i {
  width: 23px;
  height: 23px;
  border: 2px solid var(--line);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-state strong {
  font-size: 10px;
}
.loading-state span {
  font-size: 8px;
  color: var(--muted);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.warning-banner {
  border-color: #f1c8b8;
  background: #fff7f3;
}
.warning-banner > span {
  color: var(--orange);
}
[data-theme="dark"] .warning-banner {
  background: #251711;
  border-color: #543021;
}
.campaign-table {
  overflow: hidden;
}
.table-head,
.table-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  padding: 13px 17px;
  align-items: center;
}
.table-head {
  background: var(--surface-2);
  font-size: 7px;
  color: var(--muted);
}
.table-row {
  border-top: 1px solid var(--line);
  font-size: 9px;
}
.table-row em {
  font-style: normal;
  color: var(--warning);
  font-size: 8px;
}
.client-list {
  padding: 10px;
}
.client-row {
  display: grid;
  grid-template-columns: 45px 1fr auto auto;
  gap: 13px;
  align-items: center;
  padding: 13px;
}
.client-monogram {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--black);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.client-row strong,
.client-row span {
  display: block;
  font-size: 10px;
}
.client-row span {
  font-size: 8px;
  color: var(--muted);
  margin-top: 3px;
}
.client-row em {
  font-size: 8px;
  color: var(--success);
  font-style: normal;
}
.empty-client {
  border-top: 1px solid var(--line);
  padding: 25px;
  text-align: center;
  color: var(--muted);
}
.empty-client span {
  font-size: 20px;
}
.empty-client p {
  font-size: 8px;
}
.connections-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 13px;
}
.connection-card,
.security-card {
  padding: 25px;
}
.facebook-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #1877f2;
  color: #fff;
  display: grid;
  place-items: center;
  font: bold 25px Arial;
}
.connection-card h3,
.security-card h3 {
  font-size: 12px;
}
.connection-card p {
  font-size: 9px;
  color: var(--muted);
  line-height: 1.5;
}
.connection-card .full + .full {
  margin-top: 8px;
}
.connection-card small {
  display: block;
  text-align: center;
  font-size: 7px;
  color: var(--muted);
  margin-top: 9px;
}
.security-card ul {
  list-style: none;
  padding: 0;
}
.security-card li {
  font-size: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.security-card li:before {
  content: "✓";
  color: var(--orange);
  margin-right: 9px;
}
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--black);
  color: #fff;
  border-left: 3px solid var(--orange);
  padding: 13px 17px;
  display: flex;
  gap: 10px;
  min-width: 280px;
  transform: translateY(140%);
  opacity: 0;
  transition: 0.25s;
  z-index: 50;
}
.toast.visible {
  transform: none;
  opacity: 1;
}
.toast > b {
  color: var(--orange);
}
.toast strong,
.toast p {
  display: block;
  font-size: 9px;
  margin: 0;
}
.toast p {
  font-size: 7px;
  color: #aaa;
  margin-top: 3px;
}
@media (max-width: 1050px) {
  .sidebar {
    width: 220px;
  }
  main {
    margin-left: 220px;
  }
  .overview-grid,
  .studio-grid {
    grid-template-columns: 1fr;
  }
  .creative-preview {
    position: static;
  }
  .facebook-post-row {
    grid-template-columns: 150px 1fr;
  }
  .facebook-post-stats {
    grid-column: 1/-1;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 120px 1fr 150px;
    gap: 10px;
    align-items: center;
  }
  .facebook-post-stats h4 {
    margin: 0;
  }
  .engagement-note {
    grid-column: 1/-1;
    order: 1;
    margin: 0;
  }
  .facebook-link {
    margin: 0;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metrics article:nth-child(2) {
    border-right: 0;
  }
  .connections-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .sidebar {
    transform: translateX(-100%);
    transition: 0.2s;
    width: 240px;
  }
  .sidebar.open {
    transform: none;
  }
  .topbar {
    padding: 0 15px;
  }
  .mobile-menu {
    display: block;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 18px;
  }
  main {
    margin-left: 0;
  }
  .view {
    padding: 22px 15px 40px;
  }
  .topbar > div:first-of-type {
    flex: 1;
    margin-left: 8px;
  }
  .context-chip {
    display: none;
  }
  .overview-hero {
    padding: 28px 22px;
  }
  .overview-hero h2 {
    font-size: 29px;
  }
  .hero-1011 {
    font-size: 130px;
    opacity: 0.7;
  }
  .status-line {
    overflow: auto;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .page-heading {
    align-items: flex-start;
    gap: 12px;
  }
  .page-heading h2 {
    font-size: 22px;
  }
  .facebook-post-row {
    grid-template-columns: 1fr;
  }
  .facebook-post-media {
    min-height: 260px;
  }
  .facebook-post-stats {
    grid-column: auto;
    display: flex;
  }
  .campaign-table {
    overflow: auto;
  }
  .table-head,
  .table-row {
    min-width: 650px;
  }
  .toast {
    left: 14px;
    right: 14px;
    min-width: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
.platform-brand {
  padding: 0 10px 25px;
  align-items: flex-start;
}
.platform-brand img {
  width: 80px;
  height: 52px;
  object-fit: contain;
  object-position: left center;
  display: block;
}
.platform-brand > span:last-child {
  font-size: 10px;
  margin-top: 5px;
  color: #b7b7b7;
  letter-spacing: -0.02em;
}
.auth-gate {
  background: rgba(10, 10, 10, 0.94);
}
.auth-logo {
  display: flex;
  align-items: flex-end;
  gap: 11px;
  background: #000;
  margin: -34px -34px 28px;
  padding: 26px 34px 22px;
  border-radius: 13px 13px 0 0;
}
.auth-logo img {
  width: 92px;
  height: 62px;
  object-fit: contain;
  object-position: left center;
}
.auth-logo span {
  font-family: "Space Grotesk";
  font-size: 10px;
  color: #b7b7b7;
  margin-bottom: 7px;
}
.brand-editor {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 260px;
  gap: 14px;
  align-items: start;
}
.brand-index {
  position: sticky;
  top: 105px;
  display: grid;
  gap: 4px;
  padding: 8px;
}
.brand-index > strong {
  font-family: "Space Grotesk";
  font-size: 11px;
  padding: 10px 8px 14px;
}
.brand-index button {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  border-radius: 6px;
  padding: 10px;
  font-size: 9px;
}
.brand-index button.active {
  background: var(--black);
  color: #fff;
}
.brand-sheet {
  padding: 26px;
}
.brand-section {
  display: none;
}
.brand-section.active {
  display: block;
}
.brand-section h3 {
  font-family: "Space Grotesk";
  font-size: 18px;
  margin: 0 0 22px;
}
.brand-sheet label,
.production-brief label,
.copy-editor label,
.workflow-actions label {
  display: grid;
  gap: 7px;
  font-size: 8px;
  font-weight: 700;
  margin-bottom: 15px;
}
.brand-sheet input,
.brand-sheet textarea,
.production-brief input,
.production-brief textarea,
.production-brief select,
.copy-editor input,
.copy-editor textarea,
.workflow-actions input,
.reference-panel select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--canvas);
  color: var(--text);
  border-radius: 7px;
  padding: 11px;
  font-size: 9px;
  line-height: 1.5;
}
.brand-sheet textarea,
.production-brief textarea,
.copy-editor textarea {
  resize: vertical;
}
.brand-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  margin-top: 25px;
  padding-top: 18px;
}
.brand-actions > span {
  margin-right: auto;
  font-size: 8px;
  color: var(--muted);
}
.knowledge-queue {
  padding: 18px;
  position: sticky;
  top: 105px;
}
.knowledge-queue h3 {
  font-size: 11px;
  margin: 0;
}
.knowledge-queue p {
  font-size: 8px;
  color: var(--muted);
}
.knowledge-list {
  display: grid;
  gap: 7px;
  margin: 15px 0;
}
.knowledge-list article {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
}
.knowledge-list article > b,
.knowledge-list article > strong,
.knowledge-list article > span {
  display: block;
}
.knowledge-list article > b {
  font-size: 7px;
  color: var(--orange);
}
.knowledge-list article > strong {
  font-size: 9px;
  margin: 5px 0;
}
.knowledge-list article > span {
  font-size: 7px;
  color: var(--muted);
}
.knowledge-list article > div {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}
.knowledge-list article button {
  border: 1px solid var(--line);
  background: var(--canvas);
  color: var(--text);
  font-size: 7px;
  padding: 5px;
  border-radius: 4px;
}
.creation-paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 15px;
}
.creation-path {
  min-height: 155px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 25px;
  text-align: left;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 18px;
  align-items: start;
}
.creation-path.dark {
  background: #000;
  color: #fff;
}
.creation-path > span {
  width: 44px;
  height: 44px;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk";
  font-weight: 700;
}
.creation-path h3 {
  font-family: "Space Grotesk";
  font-size: 17px;
  margin: 2px 0 8px;
}
.creation-path p {
  font-size: 9px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 430px;
}
.creation-path.dark p {
  color: #999;
}
.creation-paths.compact {
  grid-template-columns: 1fr 1fr;
}
.creation-paths.compact .creation-path {
  min-height: 0;
  padding: 12px 16px;
  grid-template-columns: 26px 1fr;
}
.creation-paths.compact .creation-path > span {
  width: 24px;
  height: 24px;
  font-size: 9px;
}
.creation-paths.compact h3 {
  font-size: 10px;
  margin: 0;
}
.creation-paths.compact p {
  display: none;
}
.production-desk {
  display: grid;
  grid-template-columns: 245px minmax(420px, 1fr) 245px;
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 720px;
}
.production-brief,
.production-history {
  padding: 18px;
  background: var(--canvas);
}
.production-brief {
  border-right: 1px solid var(--line);
}
.production-history {
  border-left: 1px solid var(--line);
}
.production-brief > header,
.production-history > header,
.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.production-brief > header > span,
.production-history > header > span {
  font-family: "Space Grotesk";
  font-size: 12px;
  font-weight: 700;
}
.production-history > header > b {
  font-size: 7px;
  padding: 5px 7px;
  background: #fff0e9;
  color: #a93700;
  border-radius: 20px;
}
.icon-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}
.reference-panel {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 15px;
  display: grid;
  gap: 8px;
}
.reference-panel h4 {
  font-size: 9px;
  margin: 0;
}
.check-line {
  display: flex !important;
  grid-template-columns: auto 1fr !important;
  align-items: center;
  gap: 7px !important;
  margin: 2px 0 !important;
  font-weight: 500 !important;
}
.production-canvas {
  /* <main> hérite sinon de la marge de la zone principale de l'application. */
  margin: 0;
  padding: 20px;
  min-width: 0;
}
.canvas-toolbar {
  margin-bottom: 10px;
}
.canvas-toolbar > div {
  display: flex;
  gap: 5px;
  overflow: auto;
}
.canvas-toolbar > div button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 7px;
  padding: 7px 9px;
  border-radius: 5px;
}
.canvas-toolbar > div button.active {
  background: var(--black);
  color: #fff;
}
.copy-editor {
  padding: 20px 0 0;
}
.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.project-list {
  display: grid;
  gap: 5px;
  max-height: 240px;
  overflow: auto;
}
.project-list > button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 10px;
  text-align: left;
  border-radius: 6px;
}
.project-list > button.active {
  border-color: var(--orange);
}
.project-list strong,
.project-list span {
  display: block;
  font-size: 8px;
}
.project-list span {
  font-size: 7px;
  color: var(--muted);
  margin-top: 4px;
}
.version-list {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}
.version-list article {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 8px;
}
.version-list b {
  color: var(--orange);
  font-size: 8px;
}
.version-list strong,
.version-list span {
  display: block;
  font-size: 8px;
}
.version-list span {
  font-size: 6px;
  color: var(--muted);
  margin-top: 2px;
}
.workflow-actions {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  margin-top: 15px;
  padding-top: 15px;
}
.workflow-actions label {
  margin: 3px 0;
}
.library-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 15px;
  align-items: start;
}
.upload-drop {
  padding: 22px;
  position: sticky;
  top: 105px;
  display: grid;
  gap: 12px;
}
.upload-drop input[type="file"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.upload-drop > label {
  border: 1px dashed var(--line);
  padding: 32px 15px;
  text-align: center;
  cursor: pointer;
}
.upload-drop > label strong,
.upload-drop > label span {
  display: block;
}
.upload-drop > label strong {
  font-size: 10px;
}
.upload-drop > label span,
.upload-drop small {
  font-size: 7px;
  color: var(--muted);
  margin-top: 5px;
}
.upload-drop select {
  border: 1px solid var(--line);
  background: var(--canvas);
  color: var(--text);
  padding: 10px;
  border-radius: 6px;
  font-size: 8px;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.media-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}
.media-tile > img,
.document-preview {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #0a0a0a;
}
.document-preview {
  display: grid;
  place-items: center;
  color: #fff;
  font-family: "Space Grotesk";
  font-size: 18px;
}
.media-tile > div:last-child {
  padding: 11px;
}
.media-tile strong,
.media-tile span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-tile strong {
  font-size: 9px;
}
.media-tile span {
  font-size: 7px;
  color: var(--muted);
  margin-top: 4px;
}
@media (max-width: 1250px) {
  .brand-editor {
    grid-template-columns: 150px 1fr;
  }
  .knowledge-queue {
    grid-column: 2;
    position: static;
  }
  .production-desk {
    grid-template-columns: 210px minmax(350px, 1fr);
  }
  .production-history {
    grid-column: 1/-1;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
  }
  .production-history > header {
    grid-column: 1/-1;
    margin: 0;
  }
}
@media (max-width: 850px) {
  .brand-editor {
    grid-template-columns: 1fr;
  }
  .brand-index {
    position: static;
    grid-template-columns: repeat(2, 1fr);
  }
  .knowledge-queue {
    grid-column: auto;
  }
  .creation-paths {
    grid-template-columns: 1fr;
  }
  .production-desk {
    grid-template-columns: 1fr;
  }
  .production-brief {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .production-history {
    grid-column: auto;
    grid-template-columns: 1fr;
    border-left: 0;
  }
  .library-layout {
    grid-template-columns: 1fr;
  }
  .upload-drop {
    position: static;
  }
  .media-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .brand-sheet {
    padding: 18px;
  }
  .brand-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .brand-actions > span {
    margin: 0;
  }
  .media-grid {
    grid-template-columns: 1fr;
  }
  .editor-actions {
    flex-direction: column;
  }
  .production-canvas {
    padding: 12px;
  }
}
.auth-gate {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.92);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.auth-gate[hidden] {
  display: none;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 34px;
  box-shadow: var(--shadow);
}
.auth-card h2,
.dialog-title h2 {
  font-family: "Space Grotesk";
  margin: 18px 0 6px;
}
.auth-card > p,
.auth-card small {
  font-size: 9px;
  color: var(--muted);
  line-height: 1.5;
}
.auth-card label,
.client-form label {
  display: grid;
  gap: 7px;
  font-size: 9px;
  font-weight: 700;
  margin: 16px 0;
}
.auth-card input,
.client-form input {
  background: var(--canvas);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
}
.auth-error {
  color: #d94b42 !important;
  min-height: 14px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  width: min(520px, calc(100% - 30px));
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}
.client-form {
  padding: 26px;
}
.dialog-title,
.dialog-actions,
.heading-actions,
.client-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dialog-title h2 {
  margin: 5px 0;
}
.dialog-actions {
  justify-content: flex-end;
  margin-top: 22px;
}
.archive-toggle {
  font-size: 8px;
  color: var(--muted);
}
.client-row + .client-row {
  border-top: 1px solid var(--line);
}
.client-row em.archived {
  color: var(--muted);
}
.client-actions {
  justify-content: flex-end;
}
.client-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* File de publication */
.publication-queue {
  margin-bottom: 18px;
  padding: 18px;
  font-size: 9px;
}
.queue-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.queue-header h3 {
  margin: 0 auto 0 0;
  font-size: 12px;
}
.queue-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.queue-item > div:first-child {
  min-width: 0;
}
.queue-header select {
  padding: 4px 8px;
  font-size: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
}
.queue-caption {
  margin: 6px 0;
  font-size: 10px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.queue-meta,
.queue-attempts {
  margin: 4px 0;
  color: var(--muted);
  font-size: 8px;
}
.queue-error {
  margin: 6px 0;
  color: var(--warning);
  font-size: 9px;
}
.queue-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.job-status {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 7px;
  font-weight: 700;
  white-space: nowrap;
}
.job-published {
  background: var(--success);
  color: var(--white);
}
.job-failed {
  background: var(--warning);
  color: var(--white);
}
@media (max-width: 700px) {
  .queue-item {
    flex-direction: column;
  }
  .queue-side {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

/* Mise en route des clients */
.onboarding-panel {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}
.onboarding-card {
  padding: 18px;
  font-size: 9px;
}
.onboarding-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.onboarding-card h3,
.onboarding-card h4 {
  margin: 0 0 8px;
  font-size: 12px;
}
.onboarding-steps {
  display: grid;
  gap: 10px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}
.onboarding-steps li {
  display: flex;
  gap: 10px;
  color: var(--muted);
}
.onboarding-steps li.done {
  color: var(--text);
}
.onboarding-steps li.done b {
  color: var(--success);
}
.onboarding-steps span {
  display: block;
  font-size: 8px;
  color: var(--warning);
}
.onboarding-blocker {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--warning);
  background: var(--surface-2);
  font-size: 9px;
  line-height: 1.5;
}
.onboarding-card select {
  padding: 4px 8px;
  font-size: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
}
.invite-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 14px;
}
.invite-form label {
  display: grid;
  gap: 4px;
  flex: 1 1 200px;
}
.invite-form input {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 9px;
}
#invite-result code,
.reset-result code {
  display: block;
  margin: 8px 0;
  padding: 8px;
  overflow-wrap: anywhere;
  background: var(--surface-2);
  border-radius: 8px;
}

/* Assistant IA du studio */
.ai-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
}
.ai-panel label {
  display: grid;
  gap: 4px;
}
.ai-generations {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ai-generation {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.ai-generation header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ai-generation header small {
  color: var(--muted);
}
.ai-variant {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ai-variant p {
  margin: 0;
  white-space: pre-line;
}
.ai-variant small {
  color: var(--muted);
}
.ai-variant button {
  justify-self: start;
}
.ai-image {
  width: min(100%, 320px);
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
}
.ai-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--canvas);
  color: var(--text);
  border-radius: 7px;
  padding: 11px;
  line-height: 1.5;
  resize: vertical;
}

/* Vue d'ensemble */
.overview-content > .surface {
  margin-top: 15px;
  padding: 21px;
}
.overview-action {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 11px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.overview-action:hover strong {
  color: var(--orange);
}
.overview-action > b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 10px;
}
.overview-action.action-failed > b,
.overview-action.action-expired_page > b {
  background: var(--warning);
  color: var(--white);
}
.overview-action.action-review > b {
  background: var(--orange);
  color: var(--white);
}
.overview-action strong {
  display: block;
  font-size: 10px;
}
.overview-action small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}
.table-scroll {
  overflow-x: auto;
}
.overview-clients table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
}
.overview-clients th,
.overview-clients td {
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
.overview-clients thead th {
  border-top: 0;
  color: var(--muted);
  font-weight: 600;
}
.overview-clients th small {
  display: block;
  color: var(--warning);
  font-weight: 400;
}
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.link-button:hover {
  color: var(--orange);
}
.page-active {
  color: var(--success);
}
.page-expired,
.overview-clients .warn {
  color: var(--warning);
}
.page-none {
  color: var(--muted);
}
.overview-activity {
  margin: 0;
  padding: 0;
  list-style: none;
}
.overview-activity li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 9px;
}
.overview-activity span {
  color: var(--muted);
  font-size: 8px;
}
.overview-activity time {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  color: var(--muted);
  font-size: 8px;
}
@media (max-width: 900px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

/* Calendrier éditorial */
.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.cal-toolbar h3 {
  margin: 0;
  font-size: 13px;
}
.cal-nav {
  display: flex;
  gap: 6px;
}
.cal-nav .active {
  border-color: var(--orange);
  color: var(--orange);
}
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.cal-legend .cal-item {
  cursor: default;
}
.cal-legend small {
  color: var(--muted);
  font-size: 8px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
}
.cal-head {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}
.cal-day {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 105px;
  min-width: 0;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 8px;
}
.cal-week .cal-day {
  min-height: 260px;
}
.cal-day:nth-child(7n) {
  border-right: 0;
}
.cal-day strong {
  font-size: 10px;
}
.cal-day.outside {
  background: var(--canvas);
  color: var(--muted);
}
.cal-day.today strong {
  color: var(--orange);
}
.cal-day.drop {
  outline: 2px dashed var(--orange);
  outline-offset: -3px;
}
.cal-item {
  display: grid;
  gap: 1px;
  width: 100%;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-left: 3px solid var(--muted);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 8px;
  text-align: left;
  cursor: pointer;
}
.cal-legend .cal-item {
  display: inline-block;
  width: auto;
}
.cal-item[draggable="true"] {
  cursor: grab;
}
.cal-item time {
  color: var(--muted);
}
.cal-item span {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-item small {
  color: var(--muted);
}
.cal-planned {
  border: 1px dashed var(--muted);
  border-left: 3px dashed var(--muted);
  background: transparent;
}
.cal-queued,
.cal-publishing {
  border-left-color: var(--orange);
}
.cal-published {
  border-left-color: var(--success);
}
.cal-failed {
  border-left-color: var(--warning);
  color: var(--warning);
}
@media (max-width: 760px) {
  .cal-grid {
    grid-template-columns: repeat(7, 110px);
    overflow-x: auto;
  }
}

/* Aperçu fidèle du post Facebook (couleurs Facebook, indépendantes du thème) */
.preview-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}
#post-preview {
  flex: 1 1 280px;
  max-width: 500px;
}
.preview-checks {
  flex: 1 1 180px;
}
.fb-post {
  overflow: hidden;
  border: 1px solid #dadde1;
  border-radius: 8px;
  background: #fff;
  color: #050505;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.34;
}
.fb-post header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 0;
}
.fb-avatar {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1877f2;
  color: #fff;
  font-size: 14px;
}
.fb-post header strong {
  display: block;
  font-size: 15px;
}
.fb-post header small {
  color: #65676b;
  font-size: 13px;
}
.fb-more {
  margin-left: auto;
  color: #65676b;
}
.fb-text {
  padding: 4px 16px 12px;
  overflow-wrap: anywhere;
}
.fb-link {
  color: #385898;
}
.fb-empty {
  color: #65676b;
}
.fb-see-more {
  padding: 0;
  border: 0;
  background: none;
  color: #050505;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.fb-media {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: #f0f2f5;
  color: #65676b;
  font-size: 13px;
}
.fb-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fb-post footer {
  display: flex;
  justify-content: space-around;
  margin: 0 12px;
  padding: 8px 0;
  border-top: 1px solid #ced0d4;
  color: #65676b;
  font-size: 14px;
  font-weight: 600;
}
.preview-checks h4 {
  margin: 0 0 8px;
  font-size: 10px;
}
.preview-checks ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 9px;
}
.preview-checks li {
  padding: 7px 9px 7px 24px;
  border-radius: 6px;
  background: var(--surface-2);
  position: relative;
}
.preview-checks li::before {
  position: absolute;
  left: 8px;
  font-weight: 700;
}
.check-error::before {
  content: "✕";
  color: var(--warning);
}
.check-warn::before {
  content: "!";
  color: var(--warning);
}
.check-info::before {
  content: "i";
  color: var(--muted);
}
.check-ok::before {
  content: "✓";
  color: var(--success);
}
.check-error {
  color: var(--warning);
}

/* Analyse */
.analytics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 9px;
}
.analytics-toolbar small {
  margin-right: auto;
  color: var(--muted);
}
.analytics-toolbar select {
  margin-left: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
}
.analytics-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--warning);
  background: var(--surface-2);
  font-size: 9px;
}
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.stat-tiles article {
  padding: 16px;
}
.stat-tiles.compact article {
  padding: 8px 0;
}
.stat-tiles span,
.stat-tiles small {
  display: block;
  color: var(--muted);
  font-size: 8px;
}
.stat-tiles strong {
  display: block;
  margin: 6px 0 4px;
  font-family: "Space Grotesk";
  font-size: 22px;
}
#analytics-content > .surface {
  margin-top: 12px;
  padding: 20px;
}
.analytics-chart svg {
  display: block;
  width: 100%;
  height: 160px;
}
.chart-bar rect:first-child {
  fill: var(--orange);
}
.chart-bar .hit {
  fill: transparent;
}
.chart-bar:hover rect:first-child {
  opacity: 0.75;
}
.chart-axis {
  stroke: var(--line);
}
.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}
.analytics-chart details {
  margin-top: 10px;
  font-size: 9px;
}
.analytics-chart table {
  width: 100%;
  margin-top: 6px;
  border-collapse: collapse;
}
.analytics-chart td,
.analytics-chart th {
  padding: 4px 6px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.top-post {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 9px;
}
.top-post img,
.top-post-empty {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  background: var(--surface-2);
  object-fit: cover;
}
.top-post small {
  color: var(--muted);
}
.top-post p {
  margin: 4px 0 6px;
}
.top-post dl {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 4px;
}
.top-post dt {
  color: var(--muted);
  font-size: 8px;
}
.top-post dd {
  margin: 0;
  font-weight: 700;
}
.top-post a {
  color: var(--orange);
}

/* Rapport mensuel */
.report-document {
  max-width: 820px;
  padding: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: #111;
  font-size: 10px;
}
.report-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 3px solid var(--orange);
}
.report-head small {
  color: #737373;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.report-head h2 {
  margin: 4px 0;
  font-family: "Space Grotesk";
  font-size: 26px;
}
.report-head p {
  margin: 0;
  color: #555;
}
.report-brand {
  color: var(--orange);
  font-family: "Space Grotesk";
  font-size: 28px;
  font-weight: 700;
}
.report-document section {
  padding: 16px 0;
  border-bottom: 1px solid #e5e5e5;
  break-inside: avoid;
}
.report-document h3 {
  margin: 0 0 10px;
  font-size: 13px;
}
.report-document .top-post {
  border-top-color: #e5e5e5;
}
.report-document .top-post small,
.report-document .top-post dt,
.report-note,
.report-document footer {
  color: #737373;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
}
.report-table th,
.report-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #eee;
  text-align: right;
}
.report-table th[scope="row"],
.report-table thead th:first-child {
  text-align: left;
}
.report-table .up {
  color: #14a36f;
}
.report-table .down {
  color: #bf7415;
}
.report-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
}
.report-document footer {
  padding-top: 14px;
  font-size: 8px;
}
@media print {
  @page {
    margin: 14mm;
  }
  body,
  html {
    background: #fff !important;
  }
  .sidebar,
  .topbar,
  .toast,
  .no-print,
  .view:not(#reports-view) {
    display: none !important;
  }
  main {
    margin: 0 !important;
    padding: 0 !important;
  }
  .report-document {
    max-width: none;
    padding: 0;
    border: 0;
  }
}

/* Studio : liste des projets */
.project-browser {
  margin-top: 15px;
  padding: 18px;
}
.browser-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.browser-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.browser-filters button {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  font-size: 8px;
  cursor: pointer;
}
.browser-filters button.active {
  border-color: var(--orange);
  color: var(--text);
}
.browser-filters span {
  margin-left: 3px;
  color: var(--muted);
}
#project-search {
  flex: 0 1 260px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--canvas);
  color: var(--text);
  font-size: 9px;
}
.project-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.project-row:hover strong {
  color: var(--orange);
}
.project-row img,
.project-thumb {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--surface-2);
  object-fit: cover;
}
.project-main strong,
.project-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-main strong {
  font-size: 10px;
}
.project-main small,
.project-meta small {
  color: var(--muted);
  font-size: 8px;
}
.project-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
}
.status-badge {
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  font-size: 8px;
  white-space: nowrap;
}
.status-in_review {
  background: var(--orange);
  color: var(--white);
}
.status-scheduled {
  border: 1px solid var(--orange);
}
.status-published {
  background: var(--success);
  color: var(--white);
}
.status-failed {
  background: var(--warning);
  color: var(--white);
}

/* Studio : workflow guidé */
.workflow-actions h4 {
  margin: 14px 0 8px;
  font-size: 10px;
}
.workflow-actions h4:first-child {
  margin-top: 0;
}
.workflow-actions button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.workflow-reason {
  display: block;
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 8px;
}
.workflow-actions textarea {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--canvas);
  color: var(--text);
  resize: vertical;
}
.decision-history {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 8px;
}
.decision-history li {
  display: grid;
  gap: 2px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}
.decision-history span {
  color: var(--muted);
}
.decision-history q {
  font-style: italic;
}
.decision-history a {
  color: var(--orange);
}
/* Ces conteneurs fixent un display : sans cette règle, l'attribut hidden serait ignoré. */
.canvas-toolbar[hidden],
.workflow-actions[hidden],
.project-browser[hidden],
.production-desk[hidden] {
  display: none;
}

/* Brand Intelligence : versions */
.brand-official {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--muted);
  background: var(--surface-2);
  font-size: 9px;
}
.brand-official.ok {
  border-left-color: var(--success);
}
.brand-official.pending,
.brand-official.none {
  border-left-color: var(--warning);
}
.brand-versions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.brand-versions h3 {
  margin: 0 0 8px;
  font-size: 11px;
}
.brand-version {
  display: grid;
  gap: 6px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 9px;
}
.brand-version small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}
.brand-version-actions {
  display: flex;
  gap: 6px;
}
.brand-diff[hidden] {
  display: none;
}
.brand-diff {
  padding: 8px;
  border-radius: 6px;
  background: var(--surface-2);
}
.brand-diff p {
  margin: 0 0 6px;
}
.brand-diff dl {
  margin: 0 0 8px;
}
.brand-diff dt {
  font-weight: 700;
}
.brand-diff dd {
  display: grid;
  gap: 2px;
  margin: 2px 0 0;
}
.brand-diff del {
  color: var(--muted);
}
.brand-diff ins {
  text-decoration: none;
}
.brand-diff ins::before {
  content: "→ ";
  color: var(--orange);
}

/* Brand Intelligence : connaissances vérifiées */
.knowledge-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.knowledge-tabs button {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  font-size: 8px;
  cursor: pointer;
}
.knowledge-tabs button.active {
  border-color: var(--orange);
  color: var(--text);
}
.knowledge-item {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 9px;
}
.knowledge-item header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.knowledge-item header b {
  color: var(--orange);
  font-size: 8px;
  text-transform: uppercase;
}
.knowledge-item header span,
.knowledge-item small {
  color: var(--muted);
  font-size: 8px;
}
.knowledge-item p {
  margin: 0;
}
.knowledge-item.state-approved header span {
  color: var(--success);
}
.knowledge-item.state-expired,
.knowledge-item.state-retired,
.knowledge-item.state-rejected {
  opacity: 0.65;
}
.knowledge-item div {
  display: flex;
  gap: 6px;
}
.knowledge-item div button {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 8px;
  cursor: pointer;
}
.knowledge-add,
.knowledge-ai {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 9px;
}
.knowledge-add summary,
.knowledge-ai summary {
  font-weight: 700;
  cursor: pointer;
}
.knowledge-add label {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  font-size: 8px;
  font-weight: 700;
}
.knowledge-add input,
.knowledge-add select,
.knowledge-add textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--canvas);
  color: var(--text);
  font-size: 9px;
  font-weight: 400;
}
.knowledge-ai pre {
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 8px;
  white-space: pre-wrap;
}

/* Médiathèque */
.media-grid {
  display: block;
}
.library-toolbar {
  margin-bottom: 12px;
}
#library-search {
  flex: 0 1 220px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--canvas);
  color: var(--text);
  font-size: 9px;
}
.media-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.media-tile {
  position: relative;
}
.media-badges {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.media-badges b {
  padding: 3px 6px;
  border-radius: 99px;
  background: rgba(10, 10, 10, 0.75);
  color: #fff;
  font-size: 7px;
}
.media-badges .badge-ok {
  background: var(--success);
}
.media-badges .badge-warn {
  background: var(--warning);
}
.media-badges .badge-ai {
  background: var(--orange);
}
.media-tile select {
  width: 100%;
  margin-top: 6px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--text);
  font-size: 8px;
}
.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.media-actions .quiet-button {
  padding: 5px 8px;
  font-size: 8px;
}
.upload-drop.dragging > label {
  border-color: var(--orange);
  background: var(--surface-2);
}

/* Fiche client */
#client-dialog {
  width: min(720px, calc(100vw - 32px));
}
.client-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  column-gap: 14px;
}
.client-form-grid label {
  margin: 10px 0;
}
.client-form select,
.client-form textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--canvas);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}
.client-form label[hidden] {
  display: none;
}
.client-row span {
  display: block;
}
.client-row span + span {
  margin-top: 2px;
}
.client-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}
