:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-hover: #f1f5f9;
  --text: #111827;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e5e7eb;
  --line-strong: #dbe2ea;
  --primary: #5b5bd6;
  --primary-dark: #4646bf;
  --primary-soft: #eeeeff;
  --success: #0f9f6e;
  --success-soft: #eafaf4;
  --warning: #b7791f;
  --warning-soft: #fff7e6;
  --danger: #d14343;
  --danger-soft: #fff0f0;
  --info: #2563eb;
  --info-soft: #eff6ff;
  --sidebar: #111827;
  --sidebar-soft: #1f2937;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow-md: 0 12px 30px rgba(15,23,42,.08);
  --shadow-lg: 0 24px 60px rgba(15,23,42,.14);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-width: 252px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.optional { color: var(--muted-2); font-weight: 500; font-size: 12px; }
.eyebrow { display: inline-block; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

/* Buttons */
.primary-btn, .secondary-btn, .ghost-btn, .icon-btn {
  border: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; transition: .18s ease; text-decoration: none;
}
.primary-btn { background: var(--primary); color: #fff; padding: 11px 16px; box-shadow: 0 6px 14px rgba(91,91,214,.18); }
.primary-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.secondary-btn { background: #fff; color: #273247; border: 1px solid var(--line-strong); padding: 10px 14px; }
.secondary-btn:hover { background: var(--surface-hover); }
.ghost-btn { background: transparent; color: #475569; padding: 8px 10px; }
.ghost-btn:hover { background: var(--surface-hover); }
.icon-btn { width: 38px; height: 38px; background: #fff; color: #475569; border: 1px solid var(--line); font-size: 22px; }
.full { width: 100%; }
.small { padding: 7px 10px; border-radius: 8px; font-size: 12px; }
.danger-btn { color: var(--danger); border-color: #fecaca; }
.danger-btn:hover { background: var(--danger-soft); }
.text-link { color: var(--primary); font-weight: 700; font-size: 13px; }
.icon-action { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #475569; background: #fff; font-weight: 800; }
.icon-action:hover { background: var(--surface-hover); color: var(--primary); }

/* Auth */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 15% 15%, #e8e8ff 0, transparent 35%), radial-gradient(circle at 85% 80%, #e5f2ff 0, transparent 30%), #f7f8fc; }
.auth-shell { width: min(1080px, 100%); min-height: 640px; display: grid; grid-template-columns: 1.05fr .95fr; border: 1px solid rgba(255,255,255,.7); background: rgba(255,255,255,.8); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lg); backdrop-filter: blur(10px); }
.auth-brand-panel { padding: 46px; background: linear-gradient(145deg, #17172d, #262654 58%, #4646a8); color: #fff; display: flex; flex-direction: column; }
.brand-lockup, .sidebar-brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; background: linear-gradient(145deg, #7c7cff, #5b5bd6); color: #fff; font-weight: 900; font-size: 13px; letter-spacing: -.03em; box-shadow: 0 8px 20px rgba(91,91,214,.3); }
.auth-brand-panel .brand-lockup strong { font-size: 19px; letter-spacing: -.03em; }
.auth-brand-copy { margin: auto 0; max-width: 480px; }
.auth-brand-copy .eyebrow { color: #b9b9ff; }
.auth-brand-copy h1 { margin: 12px 0 16px; font-size: clamp(34px, 4vw, 52px); line-height: 1.02; letter-spacing: -.045em; }
.auth-brand-copy p { margin: 0; color: #d9dded; font-size: 17px; line-height: 1.7; }
.auth-feature-list { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-feature-list span { border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); padding: 7px 10px; border-radius: 999px; font-size: 12px; color: #e7e9f4; }
.auth-form-panel { padding: 56px; display: flex; flex-direction: column; justify-content: center; background: rgba(255,255,255,.94); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #f1f3f8; border-radius: 12px; margin-bottom: 28px; }
.auth-tab { border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.auth-tab.is-active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.auth-form { display: none; gap: 18px; }
.auth-form.is-active { display: grid; }
.auth-form-heading h2 { margin: 0 0 5px; font-size: 27px; letter-spacing: -.035em; }
.auth-form-heading p { margin: 0; color: var(--muted); }

/* Forms */
label { display: grid; gap: 7px; color: #334155; font-weight: 650; }
input, textarea, select { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--text); padding: 11px 12px; outline: 0; transition: .15s ease; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,91,214,.12); }
textarea { resize: vertical; min-height: 110px; }
.field-help, .hint { color: var(--muted); font-size: 12px; font-weight: 500; }
.form-message { min-height: 20px; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.form-message.success { color: var(--success); }
.form-message.error { color: var(--danger); }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.stacked-field { gap: 8px; }
.clean-fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
.clean-fieldset > legend { padding: 0; margin-bottom: 2px; color: #273247; font-weight: 800; }
.choice-grid { display: grid; gap: 12px; }
.choice-grid.two { grid-template-columns: 1fr 1fr; }
.choice-card { position: relative; cursor: pointer; display: block; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card > span { min-height: 78px; display: flex; flex-direction: column; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; transition: .18s ease; }
.choice-card strong { color: #1f2937; }
.choice-card small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.choice-card:hover > span { border-color: #c9c9f5; background: #fafaff; }
.choice-card input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px rgba(91,91,214,.08); }
.content-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.upload-zone { display: flex; align-items: center; gap: 13px; border: 1px dashed #cbd5e1; border-radius: 12px; padding: 14px 16px; background: var(--surface-soft); cursor: pointer; position: relative; }
.upload-zone:hover { border-color: var(--primary); background: #f8f8ff; }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone > span:nth-child(2) { display: grid; gap: 2px; }
.upload-zone small { color: var(--muted); }
.upload-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #fff; border: 1px solid var(--line); color: var(--primary); font-weight: 900; }
.toggle-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: var(--surface-soft); cursor: pointer; }
.toggle-row input { position: absolute; opacity: 0; width: 1px; }
.toggle-switch { width: 40px; height: 22px; border-radius: 99px; background: #cbd5e1; position: relative; flex: 0 0 auto; transition: .2s; }
.toggle-switch:after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.toggle-row input:checked + .toggle-switch { background: var(--primary); }
.toggle-row input:checked + .toggle-switch:after { transform: translateX(18px); }
.toggle-row > span:last-child { display: grid; gap: 2px; }
.toggle-row small { color: var(--muted); font-weight: 500; }

/* App shell */
.saas-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: var(--sidebar-width); padding: 20px 14px; background: var(--sidebar); color: #dce2ee; display: flex; flex-direction: column; }
.sidebar-brand { padding: 0 8px 22px; }
.sidebar-brand strong { color: #fff; font-size: 18px; letter-spacing: -.03em; }
.sidebar-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #9da8ba; font-weight: 650; transition: .15s ease; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.is-active { background: rgba(124,124,255,.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(124,124,255,.18); }
.nav-link svg { width: 18px; height: 18px; }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; }
.credit-card-mini { display: grid; gap: 2px; padding: 13px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.04); }
.credit-card-mini span, .credit-card-mini small { color: #94a3b8; font-size: 11px; }
.credit-card-mini strong { color: #fff; font-size: 18px; }
.credit-card-mini .ghost-btn { margin-top: 7px; color: #fff; background: rgba(255,255,255,.08); }
.user-menu-card { display: grid; grid-template-columns: 34px 1fr 28px; align-items: center; gap: 9px; padding: 8px; border-radius: 11px; background: rgba(255,255,255,.04); }
.user-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #343453; color: #fff; font-weight: 800; }
.user-meta { min-width: 0; display: grid; }
.user-meta strong { color: #fff; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { color: #8f9bad; font-size: 10px; }
.logout-icon { color: #9da8ba; text-align: center; }
.logout-icon:hover { color: #fff; }
.app-main { margin-left: var(--sidebar-width); min-height: 100vh; }
.topbar { min-height: 82px; padding: 16px 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 18px; position: sticky; top: 0; z-index: 30; }
.topbar-copy { min-width: 0; }
.topbar-copy h1 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.topbar-copy p { margin: 3px 0 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 680px; }
.topbar-actions { margin-left: auto; display: flex; gap: 9px; }
.mobile-menu-btn { display: none; }
.page-content { padding: 26px 30px 50px; max-width: 1600px; margin: 0 auto; }

/* Cards / layout */
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-heading h3 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.notice { border-radius: 12px; padding: 12px 14px; margin-bottom: 18px; font-weight: 650; }
.notice.success { background: var(--success-soft); color: #087a54; border: 1px solid #c5f0de; }
.notice.error { background: var(--danger-soft); color: #a93434; border: 1px solid #ffd0d0; }
.welcome-banner { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 26px 28px; border-radius: 20px; color: #fff; background: linear-gradient(125deg, #292954, #4d4da9 62%, #6f6fe7); box-shadow: 0 16px 38px rgba(61,61,132,.18); margin-bottom: 20px; }
.welcome-banner .eyebrow { color: #cacaFF; }
.welcome-banner h2 { margin: 7px 0 6px; font-size: 25px; letter-spacing: -.035em; }
.welcome-banner p { margin: 0; color: #dedff5; max-width: 720px; }
.welcome-banner .primary-btn { background: #fff; color: #343473; box-shadow: none; white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 17px 18px; box-shadow: var(--shadow-sm); display: grid; gap: 2px; }
.metric-card > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric-card strong { font-size: 28px; line-height: 1.2; letter-spacing: -.04em; }
.metric-card small { color: var(--muted-2); }
.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 18px; margin-bottom: 18px; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.empty-state { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 22px; }
.empty-state.large { min-height: 300px; }
.empty-state h3, .empty-state h4 { margin: 8px 0 3px; color: var(--text); }
.empty-state p { margin: 0 0 14px; }
.empty-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 24px; }

/* Project lists */
.project-list-compact { display: grid; }
.project-row { display: grid; grid-template-columns: 38px 1fr auto 24px; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid #eef1f5; }
.project-row:first-child { border-top: 0; }
.project-row:hover .project-row-copy strong { color: var(--primary); }
.project-favicon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #4242a0; background: linear-gradient(145deg, #efefff, #e1e1ff); font-weight: 900; }
.project-favicon.large { width: 44px; height: 44px; }
.project-favicon.xl { width: 56px; height: 56px; border-radius: 15px; font-size: 18px; }
.project-row-copy { min-width: 0; display: grid; }
.project-row-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-row-copy small, .project-row-stats { color: var(--muted); font-size: 11px; }
.project-row-stats b { color: var(--text); }
.row-chevron { color: var(--muted-2); font-size: 22px; }
.recent-content-list { display: grid; }
.recent-content-row { display: grid; grid-template-columns: 9px 1fr 32px; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #eef1f5; }
.recent-content-row:first-child { border-top: 0; }
.recent-content-row > div { min-width: 0; display: grid; }
.recent-content-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.recent-content-row small { color: var(--muted); font-size: 11px; }
.content-type-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.section-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.search-field { flex: 1; max-width: 420px; position: relative; }
.search-field span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.search-field input { padding-left: 34px; background: #fff; }
.toolbar-count { margin-left: auto; color: var(--muted); font-size: 12px; }
.project-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.project-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-sm); transition: .18s ease; }
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #d6d6f4; }
.project-card-top { display: flex; align-items: center; justify-content: space-between; }
.status-dot-live { color: #087a54; background: var(--success-soft); border: 1px solid #c5f0de; border-radius: 999px; padding: 4px 7px; font-size: 10px; font-weight: 800; }
.project-card h3 { margin: 16px 0 2px; font-size: 17px; }
.project-url { color: var(--muted); font-size: 12px; }
.project-url:hover { color: var(--primary); }
.project-card-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0; }
.project-card-metrics span { padding: 10px; border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 11px; }
.project-card-metrics b { display: block; color: var(--text); font-size: 16px; }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #eef1f5; padding-top: 13px; }
.project-card-footer small { color: var(--muted-2); }

/* Project detail */
.project-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.project-hero-main { display: flex; align-items: center; gap: 14px; }
.project-hero h2 { margin: 0 0 2px; font-size: 24px; letter-spacing: -.035em; }
.project-hero a { color: var(--muted); font-size: 12px; }
.project-stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 18px; overflow: hidden; }
.project-stat-strip > div { padding: 14px 18px; border-left: 1px solid var(--line); display: grid; gap: 2px; }
.project-stat-strip > div:first-child { border-left: 0; }
.project-stat-strip span { color: var(--muted); font-size: 11px; }
.project-stat-strip strong { font-size: 17px; }
.workflow-composer { background: #fff; border: 1px solid #dcdcf6; border-radius: 18px; box-shadow: var(--shadow-md); margin-bottom: 20px; overflow: hidden; }
.workflow-composer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fafaff, #fff); }
.workflow-composer-head h3 { margin: 3px 0 2px; font-size: 19px; }
.workflow-composer-head p { margin: 0; color: var(--muted); font-size: 12px; }
.workflow-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 430px); align-items: start; }
.workflow-form { padding: 22px; display: grid; gap: 20px; }
.wp-options { display: none; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.wp-options.show { display: grid; }
.publish-grid { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.publish-grid label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.publish-grid input[type=radio] { width: auto; }
.schedule-time input { width: 210px; }
.workflow-actions { display: flex; align-items: center; gap: 9px; padding-top: 4px; }
.status-card { border-left: 1px solid var(--line); background: #0f172a; color: #e2e8f0; padding: 20px; min-width: 0; }
.status-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.status-head .eyebrow { color: #9fa8ff; }
.status-head h3 { margin: 2px 0 0; color: #fff; font-size: 15px; }
.status-tools { display: flex; align-items: center; gap: 12px; }
.status-card .ghost-btn { color: #dbe3ef; background: rgba(255,255,255,.08); }
.status-card pre { margin: 0; height: 430px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: #0b1220; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; padding: 14px; color: #cbd5e1; font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.result-box { display: grid; gap: 8px; margin-top: 12px; }
.result-box a { color: #b9c5ff; text-decoration: underline; }
.project-tabs { display: flex; gap: 6px; margin: 22px 0 10px; }
.project-tab { border: 0; background: transparent; color: var(--muted); font-weight: 750; padding: 9px 12px; border-radius: 9px; }
.project-tab span { margin-left: 4px; color: var(--muted-2); }
.project-tab.is-active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.project-tab-panel { display: none; }
.project-tab-panel.is-active { display: block; }
.workflow-history-list { display: grid; gap: 12px; }
.workflow-card { border: 1px solid var(--line); border-radius: 13px; padding: 15px; background: #fff; }
.workflow-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.workflow-head > div { display: grid; gap: 2px; }
.workflow-head small { color: var(--muted); }
.workflow-links { display: flex; gap: 8px; margin-top: 10px; }
.workflow-links a { color: var(--primary); font-size: 12px; font-weight: 750; }
.generated-content-list { display: grid; gap: 7px; margin-top: 12px; }
.generated-content-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 11px; border-radius: 10px; background: var(--surface-soft); }
.generated-content-item > div:first-child { min-width: 0; display: grid; }
.generated-content-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.generated-content-item small { color: var(--muted); font-size: 10px; }
.content-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.content-actions a { color: var(--primary); font-size: 11px; font-weight: 750; }

/* Content library */
.content-toolbar select { width: auto; min-width: 170px; background: #fff; }
.content-library-list { display: grid; }
.content-library-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 4px; border-top: 1px solid #edf0f4; }
.content-library-row:first-child { border-top: 0; }
.content-main { min-width: 0; display: flex; align-items: center; gap: 12px; }
.content-main > div { min-width: 0; display: grid; }
.content-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-main small { color: var(--muted); font-size: 11px; }
.content-file-icon { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-weight: 900; }
.content-row-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; }
.saas-table { width: 100%; border-collapse: collapse; }
.saas-table th { text-align: left; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.saas-table td { padding: 12px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.saas-table tr:last-child td { border-bottom: 0; }
.saas-table td strong { display: block; font-size: 12px; }
.saas-table td small { color: var(--muted); font-size: 10px; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-pill.success { background: var(--success-soft); color: #087a54; }
.status-pill.info { background: var(--info-soft); color: #1d4ed8; }
.status-pill.warning { background: var(--warning-soft); color: #94620d; }
.status-pill.danger { background: var(--danger-soft); color: #b23838; }
.status-pill.neutral { background: #eef2f7; color: #64748b; }

/* Invoices */
.invoice-overview { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.invoice-summary-card { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 18px; display: grid; gap: 2px; box-shadow: var(--shadow-sm); }
.invoice-summary-card.accent { background: linear-gradient(135deg, #282852, #5454ba); border-color: transparent; color: #fff; }
.invoice-summary-card span { color: var(--muted); font-size: 11px; font-weight: 700; }
.invoice-summary-card.accent span, .invoice-summary-card.accent small { color: #d6d8f5; }
.invoice-summary-card strong { font-size: 26px; letter-spacing: -.04em; }
.invoice-summary-card small { color: var(--muted-2); }
.invoice-actions { display: flex; gap: 6px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f1f5f9; padding: 3px 6px; border-radius: 6px; font-size: 10px; }

/* Settings / contact */
.settings-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.settings-form { display: grid; gap: 14px; }
.account-detail-list { display: grid; margin-bottom: 18px; }
.account-detail-list > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 0; border-top: 1px solid #eef1f5; }
.account-detail-list > div:first-child { border-top: 0; }
.account-detail-list span { color: var(--muted); }
.contact-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 22px; align-items: stretch; }
.contact-pitch { border-radius: 20px; padding: 32px; background: linear-gradient(145deg, #18182f, #31316d); color: #fff; }
.contact-pitch .eyebrow { color: #bbbbff; }
.contact-pitch h2 { margin: 10px 0 12px; font-size: 29px; line-height: 1.12; letter-spacing: -.04em; }
.contact-pitch p { color: #d7daeb; line-height: 1.75; }
.contact-benefits { display: grid; gap: 8px; margin-top: 24px; }
.contact-benefits span { padding: 10px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: rgba(255,255,255,.05); }
.contact-form { display: grid; gap: 15px; }

/* Modals */
.modal-backdrop { position: fixed; z-index: 100; inset: 0; background: rgba(15,23,42,.56); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(4px); }
.modal-card { width: min(500px, 100%); position: relative; background: #fff; border-radius: 20px; padding: 26px; box-shadow: var(--shadow-lg); animation: modalIn .18s ease; }
.modal-card.compact { width: min(420px, 100%); }
.modal-card h2 { margin: 5px 0 6px; font-size: 24px; letter-spacing: -.035em; }
.modal-card > p { margin: 0 0 18px; color: var(--muted); }
.modal-close { position: absolute; top: 13px; right: 13px; width: 34px; height: 34px; border-radius: 9px; border: 0; background: var(--surface-soft); color: var(--muted); font-size: 22px; }
.modal-form { display: grid; gap: 14px; }
.price-preview { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; margin: 4px 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.price-preview span { color: var(--muted); }
.price-preview strong { font-size: 20px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

/* Responsive */
@media (max-width: 1120px) {
  .project-card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .workflow-layout { grid-template-columns: 1fr; }
  .status-card { border-left: 0; border-top: 1px solid var(--line); }
  .status-card pre { height: 300px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .span-7, .span-5 { grid-column: auto; }
}
@media (max-width: 860px) {
  :root { --sidebar-width: 0px; }
  .sidebar { width: 252px; transform: translateX(-100%); transition: .2s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .mobile-menu-btn { display: inline-flex; }
  .topbar { padding: 14px 18px; }
  .page-content { padding: 20px 18px 40px; }
  .topbar-actions .secondary-btn { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .project-card-grid { grid-template-columns: 1fr; }
  .settings-grid, .contact-layout { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: 320px; padding: 30px; }
  .auth-form-panel { padding: 34px 28px; }
}
@media (max-width: 620px) {
  .topbar-copy p { display: none; }
  .topbar-actions .primary-btn { font-size: 0; width: 40px; height: 40px; padding: 0; }
  .topbar-actions .primary-btn:after { content: "+"; font-size: 20px; }
  .welcome-banner { align-items: flex-start; flex-direction: column; }
  .metric-grid, .invoice-overview, .form-grid.two, .choice-grid.two, .content-type-grid, .project-stat-strip { grid-template-columns: 1fr; }
  .project-stat-strip > div { border-left: 0; border-top: 1px solid var(--line); }
  .project-stat-strip > div:first-child { border-top: 0; }
  .project-hero { align-items: flex-start; }
  .project-hero .primary-btn { white-space: nowrap; }
  .section-toolbar, .content-toolbar { flex-wrap: wrap; }
  .content-toolbar select { width: 100%; }
  .content-library-row { align-items: flex-start; flex-direction: column; }
  .content-row-actions { width: 100%; justify-content: flex-end; }
  .generated-content-item { align-items: flex-start; flex-direction: column; }
  .auth-page { padding: 10px; }
  .auth-shell { border-radius: 18px; }
}

/* Content architecture & bulk export */
.project-hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.content-toolbar { justify-content: space-between; gap: 14px; }
.content-toolbar-filters { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.danger-text { color: #b23838 !important; }
.danger-text:hover { background: var(--danger-soft) !important; }
.content-library-row.is-removing { opacity: .45; pointer-events: none; }
@media (max-width: 860px) {
  .content-toolbar-filters { width: 100%; flex-wrap: wrap; }
  .content-toolbar-filters .search-field { flex: 1 1 100%; }
  .content-toolbar > .primary-btn { width: 100%; justify-content: center; }
}
@media (max-width: 620px) {
  .project-hero-actions { width: 100%; justify-content: stretch; }
  .project-hero-actions .primary-btn, .project-hero-actions .secondary-btn { flex: 1 1 100%; justify-content: center; }
}
.workflow-footnote { margin-top: 10px; color: var(--muted); font-size: 11px; }

/* Workflow persistence, detail & destructive actions */
.inline-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.workflow-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.workflow-card-actions .workflow-footnote { margin-top: 0; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 750; margin-bottom: 12px; }
.back-link:hover { color: var(--primary); }
.workflow-detail-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, #fff, #fafbff); box-shadow: var(--shadow-sm); }
.workflow-detail-title h2 { margin: 4px 0 4px; font-size: 27px; letter-spacing: -.04em; }
.workflow-detail-title p { margin: 0; color: var(--muted); }
.workflow-detail-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.workflow-live-grid { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.65fr); gap: 18px; margin-bottom: 18px; align-items: stretch; }
.workflow-live-summary { display: flex; flex-direction: column; }
.workflow-progress-large { margin: 8px 0 18px; padding: 16px; border-radius: 14px; background: var(--surface-soft); }
.workflow-progress-large > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.workflow-progress-large span { color: var(--muted); font-size: 11px; font-weight: 750; }
.workflow-progress-large strong { font-size: 22px; letter-spacing: -.03em; }
.progress-track { height: 8px; border-radius: 999px; background: #e7eaf2; overflow: hidden; }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #7474ee); transition: width .25s ease; }
.workflow-detail-meta { display: grid; gap: 0; margin-bottom: 18px; }
.workflow-detail-meta > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid #eef1f5; }
.workflow-detail-meta > div:first-child { border-top: 0; }
.workflow-detail-meta span { color: var(--muted); font-size: 11px; }
.workflow-detail-meta strong { font-size: 12px; text-align: right; }
.workflow-control-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: auto; }
.workflow-live-logs { min-width: 0; }
.workflow-live-logs pre { margin: 0; height: 520px; overflow: auto; white-space: pre-wrap; word-break: break-word; border-radius: 12px; padding: 14px; background: #11131d; color: #d9e0f2; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.runner-info { display: grid; gap: 12px; }
.runner-info p { margin: 0; color: var(--muted); line-height: 1.65; }
.runner-info code { display: block; max-width: 100%; overflow-wrap: anywhere; white-space: normal; padding: 10px 12px; border: 1px solid var(--line); }

@media (max-width: 980px) {
  .workflow-live-grid { grid-template-columns: 1fr; }
  .workflow-live-logs pre { height: 420px; }
}
@media (max-width: 620px) {
  .workflow-detail-hero { align-items: flex-start; flex-direction: column; padding: 18px; }
  .workflow-detail-actions { width: 100%; justify-content: stretch; }
  .workflow-detail-actions > * { flex: 1 1 100%; justify-content: center; }
  .workflow-card-actions { align-items: flex-start; flex-direction: column; }
  .workflow-card-actions .inline-actions { width: 100%; justify-content: flex-end; }
}

/* Bulk content selection */
.primary-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: .5;
  transform: none;
  box-shadow: none;
}

.content-bulk-scope { min-width: 0; }
.content-bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 6px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.content-select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.content-select-all-label input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.content-selection-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.content-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}
.content-library-row {
  position: relative;
  transition: background-color .16s ease, opacity .16s ease;
}
.content-library-row.is-selected {
  background: #f4f4ff;
  border-radius: 11px;
}
.content-select-control {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  cursor: pointer;
}
.content-select-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.content-select-control span {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1.5px solid #aeb7c6;
  border-radius: 5px;
  background: #fff;
  transition: .14s ease;
}
.content-select-control input:checked + span {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,91,214,.12);
}
.content-select-control input:checked + span::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}
.content-select-control input:focus-visible + span {
  outline: 3px solid rgba(91,91,214,.22);
  outline-offset: 2px;
}
.content-main { flex: 1 1 auto; }

@media (max-width: 760px) {
  .content-bulk-bar { align-items: flex-start; flex-wrap: wrap; }
  .content-bulk-actions { width: 100%; margin-left: 0; justify-content: stretch; }
  .content-bulk-actions > * { flex: 1 1 210px; }
}

@media (max-width: 620px) {
  .content-library-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 13px 4px;
  }
  .content-main { width: 100%; }
  .content-row-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .content-bulk-actions > * { flex: 1 1 100%; justify-content: center; }
}

/* Options éditoriales et médias des workflows */
.project-editorial-brief-card { margin-bottom: 18px; }
.project-brief-form { display: grid; gap: 10px; }
.project-brief-form textarea { width: 100%; min-height: 150px; resize: vertical; }
.project-brief-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.project-brief-actions small { color: var(--muted); line-height: 1.45; }
.fixed-option-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid #cfe8d8; border-radius: 12px; background: #f4fbf6; }
.fixed-option-row > span:last-child { display: grid; gap: 3px; }
.fixed-option-row strong { color: #1f5134; }
.fixed-option-row small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.fixed-option-icon { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; background: #dff3e5; color: #237543; font-weight: 900; }
.compact-choice-grid .choice-card > span { min-height: 70px; }
.blog-media-panel, .external-linking-panel { padding-top: 2px; }

@media (max-width: 700px) {
  .project-brief-actions { align-items: stretch; flex-direction: column; }
  .project-brief-actions .secondary-btn { width: 100%; }
}

/* V6 — paramètres projet centralisés et workflow compact */
.project-settings-card { margin-bottom: 18px; padding: 18px 20px; }
.compact-heading { margin-bottom: 14px; }
.project-settings-form { display: grid; gap: 13px; }
.project-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.project-settings-grid label { min-width: 0; }
.project-settings-grid small { color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-settings-form input { padding: 9px 11px; }
.brief-disclosure { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); overflow: hidden; }
.brief-disclosure summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; }
.brief-disclosure summary::-webkit-details-marker { display: none; }
.brief-disclosure summary > span:first-child { min-width: 0; display: grid; gap: 2px; }
.brief-disclosure summary strong { color: var(--text); }
.brief-disclosure summary small { color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brief-disclosure[open] summary { border-bottom: 1px solid var(--line); background: #fff; }
.brief-disclosure textarea { border: 0; border-radius: 0; min-height: 120px; box-shadow: none; background: #fff; }
.brief-disclosure textarea:focus { box-shadow: inset 0 0 0 2px rgba(91,91,214,.16); }
.project-settings-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-height: 38px; }
.project-settings-actions .form-message { margin: 0 auto 0 0; min-height: 0; }
.project-modal-card { width: min(760px, 100%); }
.project-create-form { gap: 12px; }
.create-brief summary > span:last-child { color: var(--primary); font-size: 18px; }

.project-context-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); }
.project-context-bar > span { min-width: 0; display: grid; gap: 1px; padding: 9px 11px; background: var(--surface-soft); }
.project-context-bar small { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.project-context-bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

.workflow-form { gap: 14px; }
.workflow-form .clean-fieldset { gap: 9px; }
.workflow-form .choice-card > span { min-height: 62px; padding: 11px 12px; }
.workflow-form .choice-card small { line-height: 1.3; }
.workflow-option-stack { display: grid; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff; }
.workflow-option-row { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 66px; padding: 10px 12px; border-top: 1px solid var(--line); }
.workflow-option-row:first-child { border-top: 0; }
.workflow-option-label { color: #273247; font-size: 12px; font-weight: 800; white-space: nowrap; }
.workflow-option-copy { min-width: 0; display: grid; gap: 1px; }
.workflow-option-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.workflow-option-copy small { color: var(--muted); font-size: 11px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.segmented-control { display: inline-grid; grid-template-columns: repeat(2, minmax(54px, auto)); gap: 3px; padding: 3px; border-radius: 9px; background: #eef1f6; }
.segmented-control.wide { grid-template-columns: repeat(2, minmax(88px, auto)); }
.segmented-control label { display: block; cursor: pointer; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span { display: block; padding: 6px 10px; border-radius: 7px; color: var(--muted); font-size: 11px; font-weight: 800; text-align: center; white-space: nowrap; }
.segmented-control input:checked + span { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.inline-warning { grid-column: 2 / 4; margin: -5px 0 2px; color: var(--warning); font-size: 11px; }

@media (max-width: 980px) {
  .project-context-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-option-row { grid-template-columns: 100px minmax(0, 1fr) auto; }
}

@media (max-width: 700px) {
  .project-settings-grid { grid-template-columns: 1fr; }
  .project-settings-grid small, .brief-disclosure summary small { white-space: normal; }
  .project-settings-actions { align-items: stretch; flex-direction: column; }
  .project-settings-actions .secondary-btn { width: 100%; }
  .project-context-bar { grid-template-columns: 1fr 1fr; }
  .workflow-option-row { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .workflow-option-label { grid-column: 1 / 2; }
  .workflow-option-copy { grid-column: 1 / 2; }
  .segmented-control { grid-column: 2; grid-row: 1 / 3; }
  .workflow-option-copy small { white-space: normal; }
  .inline-warning { grid-column: 1 / 3; margin-top: 2px; }
}

/* ========================================================================== 
   V13 - interface fonctionnelle et progressive
   Aucun panneau plein écran, aucune zone cliquable invisible, aucun stepper.
   ========================================================================== */
html { scroll-behavior: auto; }
button, a, input, textarea, select, label { touch-action: manipulation; }
.primary-btn, .secondary-btn, .ghost-btn, .icon-btn {
  min-height: 40px;
  transform: none !important;
  transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease, color .14s ease;
}
.primary-btn:hover, .project-card:hover { transform: none !important; }
.primary-btn:focus-visible, .secondary-btn:focus-visible, .ghost-btn:focus-visible,
.icon-btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible,
.choice-card:focus-within > span, .segmented-control label:focus-within span {
  outline: 3px solid rgba(91, 91, 214, .22);
  outline-offset: 2px;
}

.project-card { display: flex; flex-direction: column; min-width: 0; }
.project-card-footer { margin-top: auto; }
.project-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eef1f5;
}
.project-card-actions .primary-btn,
.project-card-actions .secondary-btn { justify-content: center; text-align: center; }
.project-card-actions .danger-text { grid-column: 1 / -1; justify-self: start; }

.project-hero-actions { align-items: center; flex-wrap: wrap; }
.project-settings-card, .workflow-composer { scroll-margin-top: 82px; }
.project-settings-card { overflow: visible; }
.project-brief-field { gap: 7px; }
.project-brief-field > span { font-weight: 750; color: #273247; }

.workflow-composer {
  position: static !important;
  inset: auto !important;
  z-index: auto !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  padding: 0 !important;
  background: #fff;
  overflow: visible;
}
.workflow-composer-head { position: static; }
.workflow-layout { align-items: start; overflow: visible; }
.workflow-form { min-width: 0; overflow: visible; }
.workflow-actions {
  position: static !important;
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  background: transparent;
  flex-wrap: wrap;
}
.workflow-actions #startBtn { min-width: 190px; }
.status-card { position: static; top: auto; align-self: start; }
.choice-card, .segmented-control label, .upload-zone { -webkit-tap-highlight-color: transparent; }
.choice-card > span, .segmented-control span { user-select: none; }

@media (max-width: 860px) {
  .topbar-actions .primary-btn {
    width: auto;
    height: 40px;
    padding: 0 13px;
    font-size: 12px;
  }
  .topbar-actions .primary-btn::after { content: none; }
  .workflow-layout { grid-template-columns: 1fr; }
  .status-card { border-left: 0; border-top: 1px solid #243047; }
}

@media (max-width: 620px) {
  .page-content { padding-left: 14px; padding-right: 14px; }
  .project-card-actions { grid-template-columns: 1fr; }
  .project-card-actions .danger-text { grid-column: auto; }
  .project-card-actions .primary-btn,
  .project-card-actions .secondary-btn,
  .project-card-actions .ghost-btn,
  .project-hero-actions .primary-btn,
  .project-hero-actions .secondary-btn,
  .project-hero-actions .ghost-btn,
  .workflow-actions .primary-btn,
  .workflow-actions .secondary-btn,
  .workflow-actions .ghost-btn { width: 100%; justify-content: center; }
  .workflow-composer-head { align-items: center; }
  .workflow-option-row { grid-template-columns: 1fr; }
  .workflow-option-label, .workflow-option-copy, .segmented-control, .inline-warning {
    grid-column: 1;
    grid-row: auto;
  }
  .segmented-control { width: 100%; grid-template-columns: 1fr 1fr; }
  .segmented-control span { min-height: 40px; display: grid; place-items: center; }
}

/* V14 — projets centrés sur les contenus, netlinking, CMS directs et éditeur */
.cms-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cms-output-options {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}
.cms-action-panel { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.cms-action-panel .field-help { margin: 0; }
.cms-options-head { display: grid; gap: 3px; }
.cms-options-head strong { font-size: 14px; }
.cms-options-head small, .cms-publish-toggle small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.cms-publish-toggle { display: flex; align-items: center; gap: 8px; font-weight: 750; }
.cms-publish-toggle input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.form-grid.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.netlinking-inputs {
  display: grid;
  gap: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.netlinking-rows-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.netlinking-rows-head > div { display: grid; gap: 2px; }
.netlinking-rows-head small { color: var(--muted); font-size: 11px; }
.netlinking-rows { display: grid; gap: 10px; }
.netlinking-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.netlinking-row label { min-width: 0; font-size: 11px; }
.netlinking-row input { width: 100%; min-width: 0; padding: 9px 10px; }
.netlinking-row-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  padding-top: 2px;
  flex-wrap: nowrap;
}
.netlinking-row-actions .ghost-btn {
  flex: 0 0 auto;
  min-width: 104px;
  justify-content: center;
  white-space: nowrap;
}
.netlinking-upload { margin-top: 4px; }

.active-generation-panel { margin-bottom: 18px; }
.active-generation-list { display: grid; }
.active-generation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 2px;
  border-top: 1px solid var(--line);
}
.active-generation-row:first-child { border-top: 0; }
.active-generation-row > div:first-child { display: grid; gap: 2px; }
.active-generation-row small { color: var(--muted); font-size: 11px; }
.project-contents-panel { margin-top: 18px; }

.content-editor-modal {
  width: min(1540px, 98vw);
  height: 96vh;
  max-height: 96vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 18px;
}
.content-editor-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-right: 46px;
}
.content-editor-title-row label { font-weight: 800; white-space: nowrap; }
.content-editor-title-row input { min-width: 0; font-size: 16px; font-weight: 750; }
.content-editor-title-row .status-pill { white-space: nowrap; }
.content-editor-netlinking {
  display: flex;
  align-items: center;
  gap: 12px 18px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #f1d8a8;
  border-radius: 11px;
  background: #fff9ec;
  font-size: 11px;
}
.content-editor-netlinking strong { width: 100%; color: #7a5412; }
.content-editor-netlinking span { overflow-wrap: anywhere; }
.content-editor-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.content-editor-body {
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 26px clamp(18px, 5vw, 64px);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: #182033;
  font-size: 15px;
  line-height: 1.72;
  outline: none;
}
.content-editor-body:focus { border-color: #b8b8ef; box-shadow: 0 0 0 3px rgba(91,91,214,.11); }
.content-editor-body h1 { margin: 0 0 24px; font-size: 30px; line-height: 1.18; }
.content-editor-body h2 { margin: 30px 0 12px; font-size: 23px; line-height: 1.25; }
.content-editor-body h3 { margin: 24px 0 10px; font-size: 19px; }
.content-editor-body p { margin: 0 0 15px; }
.content-editor-body ul, .content-editor-body ol { padding-left: 24px; }
.content-editor-body a { color: var(--primary); text-decoration: underline; }
.content-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.content-editor-footer .form-message { margin: 0; min-height: 0; }

@media (max-width: 1080px) {
  .netlinking-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .netlinking-row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 760px) {
  .cms-choice-grid, .form-grid.three { grid-template-columns: 1fr; }
  .netlinking-rows-head, .active-generation-row, .content-editor-footer { align-items: stretch; flex-direction: column; }
  .netlinking-row { grid-template-columns: 1fr; }
  .netlinking-row-actions { grid-column: 1; width: 100%; justify-content: stretch; flex-wrap: wrap; }
  .netlinking-row-actions > * { flex: 1 1 160px; justify-content: center; }
  .content-editor-title-row { grid-template-columns: auto minmax(0, 1fr); padding-right: 42px; }
  .content-editor-title-row .status-pill { grid-column: 2; justify-self: start; }
  .content-editor-modal { width: 98vw; height: 96vh; max-height: 96vh; padding: 14px; grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .content-editor-body { padding: 18px; }
  .content-editor-footer .inline-actions { width: 100%; }
  .content-editor-footer .inline-actions > * { flex: 1 1 50%; justify-content: center; }
}

/* V15 — projet simplifié : un seul nom, formulaires alignés et CTA lisible */
.form-grid.two { align-items: start; }
.project-create-form > label,
.project-settings-grid > label { align-self: start; }
.project-sitemap-field { margin-top: 2px; }
.project-settings-grid .full-span { grid-column: 1 / -1; }
.project-hero a.primary-btn,
.project-hero a.primary-btn:visited,
.project-hero a.primary-btn:hover,
.project-hero a.primary-btn:focus { color: #fff; font-size: 14px; }

@media (max-width: 700px) {
  .project-settings-grid .full-span { grid-column: auto; }
}

/* V16 — verrouillage de largeur du compositeur / correction débordement Netlinking */
.workflow-layout {
  min-width: 0;
  width: 100%;
}
.workflow-layout > * {
  min-width: 0;
  max-width: 100%;
}
.workflow-form {
  min-width: 0 !important;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.content-type-panel,
.content-type-grid,
#standardContentInputs,
.netlinking-inputs,
.netlinking-rows,
.netlinking-row,
.cms-output-options,
.workflow-option-stack {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.content-type-grid > *,
.netlinking-row > *,
.netlinking-row label,
.netlinking-row input,
.netlinking-inputs textarea,
.workflow-form textarea,
.workflow-form input,
.workflow-form select {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.content-type-grid .choice-card,
.content-type-grid .choice-card > span {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.netlinking-intro p,
.netlinking-rows-head small,
.netlinking-row-actions {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (min-width: 1121px) {
  .workflow-layout {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  }
}

/* V6 — interface allégée : moins de textes secondaires, plus d'espace utile */
.topbar-copy { gap: 0; }
.topbar-copy h1 { margin-bottom: 0; }
.welcome-banner { padding-top: 20px; padding-bottom: 20px; }
.welcome-banner h2 { margin: 0; }
.panel-heading { min-height: 38px; }
.panel-heading > h3 { margin: 0; }
.metric-card { gap: 6px; }
.metric-card strong { margin-top: 2px; }
.choice-card > span {
  min-height: 58px;
  padding: 12px 14px;
  gap: 0;
}
.workflow-form { gap: 17px; }
.workflow-composer-head { align-items: center; padding-top: 17px; padding-bottom: 17px; }
.workflow-composer-head h3 { margin: 0; }
.netlinking-intro { gap: 0; }
.netlinking-rows-head > div { gap: 0; }
.workflow-option-copy { gap: 0; }
.cms-options-head { gap: 0; }
.cms-action-panel { gap: 8px; }
.auth-form-heading { margin-bottom: 2px; }
.auth-form-heading h2 { margin-bottom: 0; }
.project-modal-card > h2,
.modal-card.compact > h2 { margin-bottom: 18px; }
.settings-grid { align-items: start; }

/* V7 — compositeur simplifié et CMS compacts */
#standardContentInputs {
  display: grid;
  gap: 16px;
}
#csvUploadZone {
  margin-top: 4px;
}

.content-type-grid .choice-card strong,
.cms-choice-grid .choice-card strong,
.workflow-composer-head h3,
.cms-action-row > strong,
.clean-fieldset > legend {
  white-space: nowrap;
}

.workflow-option-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 64px;
  padding: 11px 14px;
}
.workflow-option-copy {
  display: none;
}
.workflow-option-label {
  font-size: 13px;
}
.workflow-option-row .segmented-control {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}
.inline-warning {
  grid-column: 1 / -1;
  margin: -2px 0 1px;
}

.destination-panel {
  margin-bottom: 12px;
}

.cms-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.cms-action-row > strong {
  min-width: 0;
  color: #273247;
  font-size: 13px;
  font-weight: 800;
}
.cms-action-control {
  flex: 0 0 auto;
  grid-template-columns: minmax(72px, auto) minmax(108px, auto);
}
.cms-action-control span {
  padding-left: 14px;
  padding-right: 14px;
}

.wp-options,
.cms-output-options {
  margin-top: 2px;
}
.wp-options {
  gap: 16px;
  padding: 16px;
}
.cms-output-options {
  gap: 16px;
  padding: 16px;
  background: #fff;
}
.cms-output-options .form-grid,
.wp-options .form-grid {
  gap: 14px;
}
.cms-options-head,
.cms-action-panel {
  display: none;
}

@media (max-width: 700px) {
  .content-type-grid .choice-card strong,
  .cms-choice-grid .choice-card strong {
    white-space: normal;
  }
  .workflow-option-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .workflow-option-row .segmented-control {
    grid-column: 2;
    grid-row: 1;
  }
  .inline-warning {
    grid-column: 1 / -1;
  }
  .cms-action-row {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }
  .cms-action-control {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }
}


/* V8 — cartes visuelles et éditeur simplifié */
.visual-choice-card > span,
.destination-choice-card > span {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
}
.content-type-icon,
.destination-logo {
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--primary);
}
.content-type-icon svg,
.destination-logo svg {
  width: 21px;
  height: 21px;
  display: block;
}
.content-type-icon-category { color: #7c3aed; background: #f4efff; }
.content-type-icon-product { color: #0f766e; background: #ecfdf8; }
.content-type-icon-local { color: #dc5f2b; background: #fff3ec; }
.content-type-icon-netlinking { color: #b7791f; background: #fff8e8; }
.destination-logo-docx { color: #2563eb; background: #eef5ff; }
.destination-logo-wordpress { color: #21759b; background: #eef8fc; }
.destination-logo-shopify { color: #6b8e23; background: #f3f8e9; }
.destination-logo-webflow { color: #4353ff; background: #eef0ff; }
.destination-logo-drupal { color: #0678be; background: #edf7fd; }
.destination-logo-prestashop { color: #34219e; background: #f2f0ff; }
.destination-logo-webhook { color: #475569; background: #f1f5f9; }
.destination-choice-card strong,
.visual-choice-card strong { min-width: 0; }

/* V9 — rythme vertical, actions CMS unifiées et vrais logos */
.content-type-panel > legend,
.destination-panel > legend {
  margin-bottom: 12px !important;
}

.internal-linking-panel {
  row-gap: 2px;
}
.internal-linking-panel .inline-warning {
  margin: -7px 0 0;
  line-height: 1.35;
}

.destination-panel {
  margin-bottom: 18px;
}

#wpActionBar,
#directCmsAction {
  margin-top: -2px;
  margin-bottom: 2px;
}

.wp-options,
.cms-output-options {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  padding: 16px;
  gap: 16px;
  box-sizing: border-box;
}
.wp-options.show {
  display: grid;
}

.destination-logo {
  width: 46px;
  height: 38px;
  min-width: 46px;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-sizing: border-box;
  color: var(--muted);
}
.destination-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.destination-logo svg {
  width: 22px;
  height: 22px;
}
.destination-logo-docx,
.destination-logo-wordpress,
.destination-logo-shopify,
.destination-logo-webflow,
.destination-logo-drupal,
.destination-logo-prestashop {
  color: inherit;
  background: #fff;
}
.destination-logo-webhook {
  width: 46px;
  height: 38px;
}

@media (max-width: 700px) {
  .content-type-panel > legend,
  .destination-panel > legend {
    margin-bottom: 9px !important;
  }
  .internal-linking-panel .inline-warning {
    margin-top: -3px;
  }
}

/* Ajustement des proportions réelles des marques */
.destination-logo {
  width: 58px;
  height: 36px;
  min-width: 58px;
  padding: 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.destination-logo-docx,
.destination-logo-wordpress {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 1px;
}
.destination-logo-webhook {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 6px;
  border-radius: 10px;
  background: var(--surface-soft);
}

/* V10 — favicons carrés et taille homogène pour toutes les destinations */
.destination-choice-card > span {
  gap: 18px;
}
.destination-logo,
.destination-logo-docx,
.destination-logo-wordpress,
.destination-logo-shopify,
.destination-logo-webflow,
.destination-logo-drupal,
.destination-logo-prestashop,
.destination-logo-webhook {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  flex: 0 0 44px;
  padding: 5px !important;
  display: inline-grid !important;
  place-items: center;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid var(--line) !important;
  border-radius: 11px !important;
  background: #fff !important;
}
.destination-logo img {
  display: block;
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain;
  object-position: center;
}
.destination-logo svg {
  width: 28px !important;
  height: 28px !important;
}
.destination-logo-webhook {
  color: #475569;
  background: var(--surface-soft) !important;
}


/* V13 — Netlinking aligné visuellement sur les autres types de contenu */
#netlinkingInputs > .stacked-field {
  display: grid;
  gap: 8px;
}
#netlinkingInputs .netlinking-rows-head {
  margin-top: 0;
}
#netlinkingInputs .netlinking-rows-head > strong {
  color: #273247;
  font-weight: 800;
}
#netlinkingInputs .upload-zone {
  margin-top: 4px;
}

/* V17 — rendu éditorial des tableaux dans « Voir le contenu » */
.content-editor-body table {
  width: 100%;
  margin: 22px 0 26px;
  border: 1px solid #dfe3eb;
  border-spacing: 0;
  border-collapse: separate;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 32, 51, .06);
  font-size: 14px;
  line-height: 1.5;
}
.content-editor-body th,
.content-editor-body td {
  padding: 12px 14px;
  vertical-align: top;
  text-align: left;
  border-right: 1px solid #e6e9ef;
  border-bottom: 1px solid #e6e9ef;
}
.content-editor-body th:last-child,
.content-editor-body td:last-child { border-right: 0; }
.content-editor-body tr:last-child > th,
.content-editor-body tr:last-child > td { border-bottom: 0; }
.content-editor-body th {
  background: #f5f6fa;
  color: #252b3b;
  font-weight: 800;
}
.content-editor-body tbody tr:nth-child(even) td { background: #fafbfc; }
.content-editor-body tbody tr:hover td { background: #f6f7fb; }
.content-editor-body table p { margin: 0; }

@media (max-width: 760px) {
  .content-editor-body table {
    min-width: 680px;
    margin: 18px 0 22px;
    font-size: 13px;
  }
  .content-editor-body th,
  .content-editor-body td { padding: 10px 12px; }
  .content-editor-body { overflow: auto; }
}
