:root {
  color-scheme: light;
  --bg: #f5f8fc;
  --surface: #ffffff;
  --ink: #06080b;
  --muted: #5d6773;
  --line: #d9e4f2;
  --line-strong: #bfd0e7;
  --blue: #2875f0;
  --orange: #ff5a12;
  --green: #257553;
  --green-soft: #eaf7f0;
  --red: #b64038;
  --red-soft: #fff0ee;
  --yellow: #9b6707;
  --yellow-soft: #fff5dc;
  --shadow: 0 20px 55px rgba(28, 61, 104, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 42% -10%, rgba(40, 117, 240, 0.12), transparent 32rem),
    linear-gradient(180deg, #edf5ff 0%, var(--bg) 32%, #ffffff 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid rgba(40, 117, 240, 0.24);
  outline-offset: 3px;
}

.app-shell {
  width: min(1580px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 44px) 48px;
}

.topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(26px, 4vw, 54px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 14px 34px rgba(40, 117, 240, 0.22);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.05;
}

.brand small,
.topbar p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar p {
  margin: 0;
}

.page-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.page-title h1 {
  margin: 0;
  font-size: clamp(52px, 7vw, 112px);
  line-height: 0.86;
  letter-spacing: 0;
}

.page-title p {
  max-width: 410px;
  margin: 0 0 8px;
  color: #485462;
  font-size: 15px;
  line-height: 1.55;
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.widget-card {
  min-width: 0;
}

.card-link {
  min-height: 310px;
  height: 100%;
  display: grid;
  grid-template-rows: 146px 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(6, 8, 11, 0.03);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.card-link:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.preview {
  display: block;
  min-height: 146px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #f8fbff, #e7f2ff);
  position: relative;
  overflow: hidden;
}

.preview::before,
.preview::after {
  content: "";
  position: absolute;
  border-radius: 6px;
}

.preview-header::before {
  inset: 28px 28px auto;
  height: 18px;
  background: #fff;
  box-shadow: 0 28px 0 #fff, 0 56px 0 rgba(40, 117, 240, 0.14);
}

.preview-header::after {
  right: 30px;
  top: 32px;
  width: 70px;
  height: 10px;
  background: var(--blue);
}

.preview-cube::before {
  width: 86px;
  height: 86px;
  left: calc(50% - 43px);
  top: 31px;
  background: linear-gradient(135deg, var(--blue), #8bb8ff);
  transform: rotate(45deg) skew(-8deg, -8deg);
  box-shadow: 20px 18px 0 rgba(255, 90, 18, 0.22);
}

.preview-carousel::before {
  width: 44%;
  height: 82px;
  left: 28%;
  top: 33px;
  background: #fff;
  box-shadow: -78px 16px 0 rgba(255,255,255,0.62), 78px 16px 0 rgba(255,255,255,0.62);
}

.preview-cards::before {
  inset: 26px;
  background:
    linear-gradient(#fff, #fff) left top / 47% 38% no-repeat,
    linear-gradient(#fff, #fff) right top / 47% 38% no-repeat,
    linear-gradient(#fff, #fff) left bottom / 47% 38% no-repeat,
    linear-gradient(#fff, #fff) right bottom / 47% 38% no-repeat;
}

.preview-form::before {
  inset: 25px 28px;
  background:
    linear-gradient(#fff, #fff) 0 0 / 100% 20px no-repeat,
    linear-gradient(#fff, #fff) 0 34px / 100% 20px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 74px / 48% 22px no-repeat;
}

.preview-player::before {
  width: 78%;
  height: 58px;
  left: 11%;
  top: 44px;
  background: rgba(6, 8, 11, 0.86);
  box-shadow: 0 18px 38px rgba(6, 8, 11, 0.18);
}

.preview-logic::before {
  inset: 28px 30px;
  background:
    linear-gradient(90deg, var(--blue), var(--green)) 0 0 / 100% 8px no-repeat,
    repeating-linear-gradient(180deg, #fff 0 17px, transparent 17px 28px);
}

.card-body {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 15px;
}

.card-line,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.category,
.card-footer,
.latest-change {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.category,
.status {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  background: #fff;
}

.rating {
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
}

.card-body strong {
  font-size: 20px;
  line-height: 1.08;
}

.card-description {
  color: #4d5968;
  font-size: 13px;
  line-height: 1.42;
}

.latest-change {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.status-valide,
.status-validé {
  border-color: rgba(37, 117, 83, 0.24);
  background: var(--green-soft);
  color: var(--green);
}

.status-brouillon,
.status-interessant,
.status-intéressant,
.status-a-ameliorer,
.status-à-améliorer {
  border-color: rgba(155, 103, 7, 0.24);
  background: var(--yellow-soft);
  color: var(--yellow);
}

.status-abandonne,
.status-abandonné {
  border-color: rgba(182, 64, 56, 0.22);
  background: var(--red-soft);
  color: var(--red);
}

.detail-view {
  max-width: 1180px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.widget-sheet {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: 34px;
  align-items: start;
}

.sheet-preview {
  position: sticky;
  top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.sheet-preview .preview {
  min-height: min(52vw, 520px);
  border-bottom: 0;
}

.sheet-main {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  padding: clamp(20px, 3vw, 34px);
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.sheet-head p {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.sheet-head h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 76px);
  line-height: 0.92;
}

.lead {
  margin: 0 0 24px;
  color: #455261;
  font-size: 18px;
  line-height: 1.6;
}

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

.facts div {
  min-height: 112px;
  padding: 15px;
  background: #fff;
}

.facts dt {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.facts dd {
  margin: 0;
  color: #253140;
  font-size: 14px;
  line-height: 1.45;
}

.actions {
  margin: 0 0 30px;
}

.primary-action,
.disabled-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.primary-action {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
}

.disabled-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.timeline {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.timeline h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

.timeline ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 15px 15px 16px 44px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 20px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.timeline li.is-recommended {
  border-color: rgba(40, 117, 240, 0.38);
}

.timeline li.is-recommended::before {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(40, 117, 240, 0.12);
}

.version-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.timeline time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.timeline strong {
  display: block;
  margin: 5px 0;
  font-size: 16px;
}

.timeline p {
  margin: 0;
  color: #4d5968;
  font-size: 14px;
  line-height: 1.5;
}

.retain-tag {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(40, 117, 240, 0.1);
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  white-space: nowrap;
}

.prompt-block {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.prompt-block summary {
  cursor: pointer;
  color: #263140;
  font-size: 12px;
  font-weight: 900;
  padding: 10px 12px;
  text-transform: uppercase;
}

.prompt-block pre {
  margin: 0;
  border-top: 1px solid var(--line);
  background: #11151b;
  color: #edf5ff;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  padding: 12px;
}

.deployment-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 320px);
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 4px;
}

.deployment-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  padding: 13px;
}

.deployment-card span,
.no-deployments {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.deployment-card strong {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.2;
}

.deployment-card p {
  font-size: 13px;
}

.deployment-card a {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.prompt-factors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prompt-factors span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(40, 117, 240, 0.18);
  border-radius: 999px;
  background: rgba(40, 117, 240, 0.07);
  color: #215da8;
  padding: 2px 7px;
  text-transform: none;
}

.no-deployments {
  margin-top: 12px !important;
  color: #7b8490 !important;
  text-transform: none;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1240px) {
  .widget-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .page-title,
  .widget-sheet {
    display: block;
  }

  .page-title p {
    margin-top: 12px;
  }

  .widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sheet-preview {
    position: static;
    margin-bottom: 18px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 16px 12px 34px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .page-title h1 {
    font-size: 54px;
  }

  .widget-grid,
  .facts {
    grid-template-columns: 1fr;
  }

  .card-link {
    min-height: 0;
  }

  .sheet-head {
    display: grid;
  }

  .sheet-head h1 {
    font-size: 42px;
  }

  .timeline li {
    padding-left: 36px;
  }

  .timeline li::before {
    left: 13px;
  }
}
