.srt-studio-host,
.srt-studio-host * { box-sizing: border-box; }

.srt-studio {
  --srt-primary: #5b21b6;
  --srt-secondary: #0891b2;
  --srt-accent: #a3e635;
  --srt-surface: #fff;
  --srt-ink: #172033;
  --srt-muted: #64748b;
  --srt-radius: 18px;
  --srt-font: Inter, Arial, sans-serif;
  position: relative;
  width: 100%;
  color: var(--srt-ink);
  font-family: var(--srt-font);
  line-height: 1.45;
  isolation: isolate;
}

.srt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(91, 33, 182, .12);
  border-radius: calc(var(--srt-radius) - 4px);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 12px 40px rgba(30, 41, 59, .08);
  backdrop-filter: blur(16px);
  z-index: 30;
}

.srt-toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.srt-btn {
  appearance: none;
  border: 1px solid #d8deea;
  border-radius: 10px;
  background: #fff;
  color: var(--srt-ink);
  cursor: pointer;
  font: 600 13px/1.2 var(--srt-font);
  padding: 9px 12px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.srt-btn:hover { border-color: var(--srt-secondary); box-shadow: 0 5px 16px rgba(8, 145, 178, .14); transform: translateY(-1px); }
.srt-btn-primary { background: linear-gradient(135deg, var(--srt-primary), #7c3aed); border-color: transparent; color: #fff; }
.srt-btn-export { display: inline-flex; align-items: center; gap: 7px; background: linear-gradient(135deg, var(--srt-secondary), #06b6d4); border: 0; color: #fff; list-style: none; }
.srt-btn-export::-webkit-details-marker { display: none; }
.srt-btn-export::after { content: "▾"; font-size: 10px; }

.srt-export-menu { position: relative; }
.srt-export-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 205px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
  z-index: 50;
}
.srt-export-menu-panel .srt-btn { border: 0; border-radius: 8px; text-align: left; }

.srt-export-surface {
  position: relative;
  min-width: 0;
  padding: clamp(18px, 3vw, 38px);
  overflow: hidden;
  border: 1px solid rgba(91, 33, 182, .10);
  border-radius: var(--srt-radius);
  background:
    radial-gradient(circle at 100% 0, rgba(6, 182, 212, .11), transparent 28%),
    radial-gradient(circle at 0 18%, rgba(124, 58, 237, .09), transparent 26%),
    var(--srt-surface);
  box-shadow: 0 22px 70px rgba(30, 41, 59, .09);
}
.srt-export-surface.has-no-background { background: transparent; box-shadow: none; }
.srt-transparent-export { background: transparent !important; box-shadow: none !important; border-color: transparent !important; }

.srt-document-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(100, 116, 139, .18);
}
.srt-header-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 17px;
  background: linear-gradient(145deg, var(--srt-primary), var(--srt-secondary));
  box-shadow: 0 12px 25px rgba(91, 33, 182, .22), inset 0 1px rgba(255, 255, 255, .32);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.04em;
}
.srt-document-header h2 { margin: 0; color: var(--srt-ink); font-size: clamp(22px, 3vw, 34px); line-height: 1.08; letter-spacing: -.035em; }
.srt-document-header p { margin: 6px 0 0; color: var(--srt-muted); font-size: 14px; }
.srt-header-stamp { display: grid; justify-items: end; gap: 4px; color: var(--srt-muted); }
.srt-header-stamp span { padding: 5px 10px; border-radius: 999px; background: rgba(91, 33, 182, .08); color: var(--srt-primary); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.srt-header-stamp small { font-size: 11px; }
.srt-intro { max-width: 980px; margin: -4px 0 22px; color: var(--srt-muted); font-size: 14px; }

.srt-section,
.srt-matrix-section {
  margin: 0 0 24px;
  padding: 18px;
  border: 1px solid rgba(100, 116, 139, .16);
  border-radius: calc(var(--srt-radius) - 3px);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
}
.srt-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.srt-section-heading h3 { margin: 0; color: var(--srt-ink); font-size: 18px; letter-spacing: -.02em; }
.srt-section-heading p { margin: 3px 0 0; color: var(--srt-muted); font-size: 12px; }
.srt-section-controls { display: flex; align-items: center; gap: 8px; }
.srt-section-controls select,
.srt-slice-control select { border: 1px solid #d8deea; border-radius: 9px; background: #fff; padding: 7px 30px 7px 9px; color: var(--srt-ink); }

.srt-matrix-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.srt-matrix-body.has-image { grid-template-columns: minmax(440px, 1.45fr) minmax(240px, .55fr); }
.srt-matrix-wrap { width: 100%; overflow: auto; padding: 2px; }
.srt-matrix { width: 100%; min-width: 520px; border-spacing: 5px; border-collapse: separate; table-layout: fixed; }
.srt-matrix th { padding: 8px; border: 0; background: #eef2f7; color: #334155; font-size: 11px; font-weight: 750; line-height: 1.2; text-align: center; }
.srt-matrix th:first-child { width: 142px; text-align: left; }
.srt-matrix-corner { display: grid; gap: 3px; }
.srt-matrix-corner span { color: var(--srt-secondary); }
.srt-matrix-corner b { color: var(--srt-primary); }
.srt-matrix-cell { height: 62px; padding: 8px; border-radius: 8px; text-align: center; transition: transform .15s ease; }
.srt-matrix-cell:hover { transform: scale(1.025); }
.srt-matrix-cell strong { display: block; font-size: 16px; }
.srt-matrix-cell small { display: block; margin-top: 2px; font-size: 9px; font-weight: 700; }
.srt-matrix-image { margin: 0; padding: 10px; border-radius: 13px; background: #f8fafc; }
.srt-matrix-image img { display: block; width: 100%; max-height: 430px; object-fit: contain; border-radius: 8px; }
.srt-matrix-image figcaption { margin-top: 7px; color: var(--srt-muted); font-size: 10px; text-align: center; }
.srt-matrix-image.has-error::before { content: "Image inaccessible pour l’aperçu ou l’export. Utilisez de préférence la médiathèque WordPress."; display: block; padding: 15px; color: #b91c1c; font-size: 12px; }
.srt-matrix-image.has-error img { display: none; }

.srt-risk-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.srt-risk-legend > span { display: inline-grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 7px; align-items: center; padding: 6px 10px; border: 1px solid rgba(100, 116, 139, .15); border-radius: 9px; background: #fff; }
.srt-risk-legend i { grid-row: 1 / 3; width: 10px; height: 28px; border-radius: 99px; background: var(--level); }
.srt-risk-legend b { font-size: 11px; }
.srt-risk-legend small { color: var(--srt-muted); font-size: 9px; }

.srt-table-scroll { width: 100%; overflow: auto; border: 1px solid #dfe5ee; border-radius: 12px; background: #fff; }
.srt-data-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.srt-data-table th { position: sticky; top: 0; z-index: 3; padding: 10px 9px; border-right: 1px solid rgba(255, 255, 255, .18); background: linear-gradient(180deg, #334155, #263448); color: #fff; font-size: 10px; font-weight: 750; line-height: 1.25; text-align: left; letter-spacing: .015em; }
.srt-data-table th:first-child { border-radius: 10px 0 0; }
.srt-data-table th:last-child { border-radius: 0 10px 0 0; }
.srt-data-table td { padding: 6px; border-right: 1px solid #e7ebf1; border-bottom: 1px solid #e7ebf1; background: #fff; vertical-align: top; transition: background .15s ease; }
.srt-data-table tbody tr:nth-child(even) td { background-color: #fbfcfe; }
.srt-data-table tbody tr:hover td { background-color: #f8fbff; }
.srt-data-table tbody tr:last-child td { border-bottom: 0; }
.srt-data-table td:last-child { border-right: 0; }

.srt-field {
  width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  outline: none;
  background: transparent;
  color: var(--srt-ink);
  font: 500 11px/1.35 var(--srt-font);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
textarea.srt-field { min-height: 49px; resize: vertical; overflow: hidden; }
.srt-field:hover { border-color: #d8deea; background: #fff; }
.srt-field:focus { border-color: var(--srt-secondary); background: #fff; box-shadow: 0 0 0 3px rgba(8, 145, 178, .12); }
select.srt-field { padding-right: 24px; cursor: pointer; }
.srt-score-select { border-color: rgba(91, 33, 182, .16); background: rgba(91, 33, 182, .035); font-weight: 700; }
.srt-computed { display: grid; gap: 2px; width: 100%; min-height: 47px; place-content: center; padding: 7px; border: 1px solid #d8deea; border-radius: 9px; text-align: center; }
.srt-computed strong { font-size: 15px; }
.srt-computed small { font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.srt-row-actions { width: 42px !important; min-width: 42px !important; text-align: center !important; }
.srt-remove-row { min-width: 28px; padding: 5px 8px; border: 0; background: transparent; color: #94a3b8; font-size: 18px; }
.srt-remove-row:hover { color: #ef4444; box-shadow: none; transform: none; }

.srt-image-field { display: grid; gap: 5px; }
.srt-image-preview { display: grid; place-items: center; min-height: 54px; overflow: hidden; border: 1px dashed #cbd5e1; border-radius: 7px; color: var(--srt-muted); font-size: 9px; }
.srt-image-preview img { display: block; width: 100%; max-height: 92px; object-fit: cover; }
.srt-image-field input[type="file"] { width: 100%; font-size: 8px; }

.srt-gantt { margin-top: 16px; padding: 14px; overflow: auto; border: 1px solid #dfe5ee; border-radius: 12px; background: #f8fafc; }
.srt-gantt-axis { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; margin: 0 0 10px 190px; color: var(--srt-muted); font-size: 10px; }
.srt-gantt-axis span:last-child { text-align: right; }
.srt-gantt-line { display: grid; grid-template-columns: 180px minmax(520px, 1fr); align-items: center; gap: 10px; min-height: 42px; border-top: 1px solid #e2e8f0; }
.srt-gantt-line strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.srt-gantt-track { position: relative; height: 24px; border-radius: 6px; background: repeating-linear-gradient(90deg, #eef2f7 0, #eef2f7 calc(10% - 1px), #dfe5ee 10%); }
.srt-gantt-bar { position: absolute; top: 3px; height: 18px; min-width: 12px; border-radius: 99px; box-shadow: 0 4px 10px rgba(8, 145, 178, .2); }
.srt-gantt-bar span { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; color: #fff; font-size: 8px; font-weight: 800; }

.srt-kanban,
.srt-pdca-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: start; overflow: auto; }
.srt-board-lane { min-width: 220px; padding: 10px; border: 1px solid #dfe5ee; border-radius: 13px; background: #f7f9fc; }
.srt-board-lane > header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px; margin-bottom: 9px; }
.srt-board-lane > header h4 { margin: 0; font-size: 12px; }
.srt-board-lane > header b { display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: 99px; background: #e2e8f0; color: #475569; font-size: 10px; }
.srt-lane-number { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: linear-gradient(135deg, var(--srt-primary), var(--srt-secondary)); color: #fff; font-size: 10px; font-weight: 900; }
.srt-board-cards { display: grid; gap: 9px; min-height: 70px; border-radius: 9px; transition: background .15s ease; }
.srt-board-cards.is-over { background: rgba(6, 182, 212, .10); outline: 2px dashed var(--srt-secondary); outline-offset: 3px; }
.srt-board-card { padding: 9px; border: 1px solid #dfe5ee; border-radius: 10px; background: #fff; box-shadow: 0 5px 13px rgba(15, 23, 42, .05); cursor: grab; }
.srt-board-card.is-dragging { opacity: .45; }
.srt-card-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--srt-muted); }
.srt-card-bar strong { flex: 1; color: var(--srt-primary); font-size: 10px; }
.srt-card-bar .srt-btn { margin-left: auto; }
.srt-board-card label { display: block; margin-top: 6px; }
.srt-board-card label > span { display: block; margin: 0 0 2px 3px; color: var(--srt-muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.srt-board-card .srt-field { border-color: #e2e8f0; background: #fbfcfe; font-size: 10px; }
.srt-board-card .srt-card-primary .srt-field { min-height: 58px; color: var(--srt-ink); font-size: 12px; font-weight: 700; }

.srt-action-plan { margin-top: 26px; border-top: 4px solid var(--srt-accent); }
.srt-branding { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 24px; padding-top: 13px; border-top: 1px solid rgba(100, 116, 139, .18); color: var(--srt-muted); }
.srt-branding div { display: grid; gap: 1px; }
.srt-branding strong { color: var(--srt-primary); font-size: 10px; }
.srt-branding small,
.srt-branding > span { font-size: 8px; }
.srt-empty { margin: 10px; color: var(--srt-muted); font-size: 12px; font-style: italic; }

.srt-toast { position: fixed; right: 24px; bottom: 24px; z-index: 100000; max-width: 380px; padding: 12px 16px; border-radius: 11px; background: #0f172a; color: #fff; box-shadow: 0 14px 40px rgba(15, 23, 42, .3); font-size: 13px; font-weight: 650; opacity: 0; pointer-events: none; transform: translateY(16px); transition: .2s ease; }
.srt-toast.is-visible { opacity: 1; transform: translateY(0); }
.srt-toast.is-error { background: #b91c1c; }
.srt-modal-backdrop { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .58); backdrop-filter: blur(5px); }
.srt-modal { width: min(680px, 100%); max-height: 85vh; overflow: auto; padding: 24px; border-radius: 18px; background: #fff; box-shadow: 0 25px 80px rgba(15, 23, 42, .32); }
.srt-modal header { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.srt-modal h3 { margin: 0; }
.srt-modal p,
.srt-modal li { color: #475569; font-size: 13px; }
.srt-legal-note { padding: 12px; border-left: 4px solid var(--srt-secondary); border-radius: 7px; background: #ecfeff; }
.srt-message { padding: 12px 15px; border-radius: 9px; background: #f1f5f9; color: #334155; }
.srt-message-error { background: #fef2f2; color: #991b1b; }

.srt-studio:fullscreen { overflow: auto; padding: 18px; background: #eef2f7; }
.srt-studio:fullscreen .srt-toolbar { position: sticky; top: 0; }
.srt-studio:fullscreen .srt-export-surface { max-width: 1800px; margin: auto; }

.srt-exporting .srt-toolbar,
.srt-exporting .srt-row-actions,
.srt-exporting input[type="file"],
.srt-exporting .srt-section-controls { display: none !important; }
.srt-exporting .srt-table-scroll,
.srt-exporting .srt-matrix-wrap,
.srt-exporting .srt-gantt,
.srt-exporting .srt-kanban,
.srt-exporting .srt-pdca-board { overflow: visible !important; }
.srt-exporting .srt-data-table { width: max-content; min-width: 100%; }
.srt-exporting .srt-field { border-color: transparent; }

@media (max-width: 900px) {
  .srt-toolbar { align-items: stretch; flex-direction: column; }
  .srt-toolbar-group { width: 100%; }
  .srt-export-tools { justify-content: space-between; }
  .srt-export-menu { margin-left: auto; }
  .srt-matrix-body.has-image { grid-template-columns: 1fr; }
  .srt-section-heading { align-items: stretch; flex-direction: column; }
  .srt-section-controls { justify-content: space-between; }
}

@media (max-width: 620px) {
  .srt-export-surface { padding: 14px; border-radius: 12px; }
  .srt-document-header { grid-template-columns: auto 1fr; }
  .srt-header-mark { width: 46px; height: 46px; border-radius: 13px; }
  .srt-header-stamp { display: none; }
  .srt-section,
  .srt-matrix-section { padding: 11px; }
  .srt-branding { align-items: flex-start; flex-direction: column; }
}

@media print {
  .srt-toolbar,
  .srt-row-actions,
  .srt-section-controls { display: none !important; }
  .srt-export-surface { padding: 0; border: 0; box-shadow: none; }
  .srt-table-scroll { overflow: visible; }
}

