:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #667085;
  --line: #d0d5dd;
  --surface: #ffffff;
  --soft: #f5f7fa;
  --accent: #0a66c2;
  --accent-dark: #064681;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
}

button,
a,
input,
select,
textarea {
  font: inherit;
}

button,
a.open-target {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
}

button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

a.publisher-link {
  border: 1px solid #12b76a;
  background: #12b76a;
  color: #fff;
  border-radius: 6px;
  padding: 10px 14px;
  text-decoration: none;
}

a.publisher-link:hover {
  background: #027a48;
}

button.tertiary {
  border-color: transparent;
  background: transparent;
  color: var(--accent-dark);
}

button.active,
button.secondary.active {
  border-color: var(--accent);
  background: #e7f0fb;
  color: var(--accent-dark);
}

button:hover,
a.open-target:hover {
  background: var(--accent-dark);
}

button.secondary:hover {
  background: #eef2f6;
}

button.tertiary:hover {
  background: #eef2f6;
}

.shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

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

.top-subtitle {
  max-width: 720px;
  margin: 6px 0 0;
  color: var(--muted);
}

.eyebrow,
.muted,
.meta {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 20px;
}

.panel,
.sidebar,
.job {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 24px;
}

.login-form {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.login-form input {
  flex: 1;
}

.login-form .secondary {
  white-space: nowrap;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

.workspace,
.campaigns-view {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}

.sidebar {
  display: grid;
  gap: 14px;
  padding: 18px;
  position: sticky;
  top: 16px;
}

.sidebar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.filter-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.channel-card {
  display: grid;
  gap: 8px;
}

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

.channel {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.channel.active {
  border-color: var(--accent);
  background: #e7f0fb;
  color: var(--accent-dark);
}

.personal-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.personal-card strong {
  color: var(--text);
}

.personal-card a {
  color: var(--accent-dark);
  font-size: 13px;
}

.site-tabs {
  display: grid;
  gap: 8px;
}

.site-tab {
  width: 100%;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.site-tab.active {
  border-color: var(--accent);
  background: #e7f0fb;
  color: var(--accent-dark);
}

.site-tab:hover {
  background: #eef2f6;
  color: var(--ink);
}

.jobs {
  display: grid;
  gap: 16px;
}

.publisher-mode .sidebar {
  border-color: #12b76a;
}

.publisher-mode .job {
  border-color: #12b76a;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.12);
}

.publisher-focus::before {
  content: "Publisher assisté : ce bouton ne publie pas automatiquement. Il copie le post et ouvre LinkedIn. Publie ensuite dans LinkedIn, puis colle l'URL du post publié ci-dessous.";
  display: block;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #12b76a;
  border-radius: 6px;
  color: #027a48;
  background: #ecfdf3;
}

.campaign-builder {
  display: grid;
  gap: 18px;
}

.builder-head,
.campaign-form,
.campaign-list-wrap,
.campaign-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.builder-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.campaign-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.campaign-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.campaign-form textarea {
  min-height: 110px;
  margin: 0;
}

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

.campaign-list-wrap {
  padding: 18px;
}

.campaign-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.campaign-card {
  padding: 14px;
}

.campaign-card h3 {
  margin: 0;
  font-size: 18px;
}

.job {
  padding: 18px;
}

.job-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.badge {
  height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #e7f0fb;
  color: var(--accent-dark);
  padding: 0 10px;
  font-size: 13px;
  white-space: nowrap;
}

.article-link {
  overflow-wrap: anywhere;
}

.target-card {
  display: grid;
  gap: 4px;
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

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

.target-card a {
  color: var(--accent-dark);
  overflow-wrap: anywhere;
}

.article-link.link-warning {
  border-left: 3px solid var(--danger);
  padding-left: 10px;
}

.article-image {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  max-width: 520px;
}

.article-image img {
  display: block;
  width: 100%;
  max-height: 290px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.article-image figcaption {
  color: var(--muted);
  font-size: 13px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 260px;
  margin: 14px 0;
  resize: vertical;
  line-height: 1.5;
}

.first-comment {
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  background: #f2f7fc;
  margin-bottom: 14px;
  white-space: pre-wrap;
}

.approval-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.publish-checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.publish-checklist li {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
}

.publish-checklist li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--line);
}

.publish-checklist li.done {
  border-color: #12b76a;
  color: #027a48;
  background: #ecfdf3;
}

.publish-checklist li.done::before {
  background: #12b76a;
}

.schedule-form {
  display: grid;
  grid-template-columns: 1.2fr 180px 1fr auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.schedule-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.scheduler-state {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.scheduler-state.active {
  color: #027a48;
  font-weight: 600;
}

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

.actions,
.publish-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.publish-form {
  margin-top: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.publish-form input {
  min-width: 320px;
  flex: 1;
}

.publish-form-title {
  width: 100%;
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
}

.hidden {
  display: none !important;
}

.error {
  color: var(--danger);
}

.success {
  color: #027a48;
}

@media (max-width: 860px) {
  .workspace,
  .campaigns-view,
  .form-grid,
  .publish-checklist,
  .schedule-form {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}
