.sm-hub,
.sm-library-shell {
  width: 100%;
  max-width: 1500px;
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
}

.sm-hub {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
}

.sm-hub-hero {
  display: flex;
  min-height: 120px;
  padding: 22px 24px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background:
    radial-gradient(circle at 10% 0%, rgba(155, 135, 255, .2), transparent 34%),
    linear-gradient(135deg, rgba(22, 26, 51, .98), rgba(10, 13, 29, .98));
  border: 1px solid rgba(155, 135, 255, .2);
  border-radius: 20px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, .22);
}
.sm-hub-hero > div:first-child,
.sm-movement-library-header > div:first-child { display: block; }

.sm-hub-kicker,
.sm-library-kicker {
  display: block;
  margin-bottom: 5px;
  color: #52e2d0;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
}

.sm-hub-hero h1 {
  margin: 0;
  font-size: clamp(25px, 3vw, 38px);
  letter-spacing: -.045em;
}

.sm-hub-hero p {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--app-muted, #9da2ba);
  font-size: 12px;
}

.sm-hub-hero-actions {
  display: flex;
  max-width: 550px;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.sm-hub-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sm-hub-section {
  --section-accent: #9b87ff;
  display: grid;
  min-width: 0;
  min-height: 84px;
  padding: 13px 15px;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  color: #f7f7fb;
  background: rgba(16, 19, 38, .9);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.sm-hub-section-regie { --section-accent: #52e2d0; }
.sm-hub-section-movement { --section-accent: #ffb56b; }
.sm-hub-section.is-locked { filter: grayscale(.65); opacity: .58; }
.sm-hub-section.is-locked .sm-hub-section-count { color: #ff8999; border-color: rgba(255,114,133,.25); background: rgba(255,114,133,.08); }
.sm-hub-section:hover {
  background: rgba(23, 27, 52, .96);
  border-color: color-mix(in srgb, var(--section-accent) 42%, transparent);
  transform: translateY(-2px);
}

.sm-hub-section-mark,
.sm-hub-project-mark {
  display: grid;
  box-sizing: border-box;
  padding: 8px;
  color: #090b18;
  background: var(--section-accent);
  border-radius: 12px;
  overflow: hidden;
  place-items: center;
}

.sm-hub-section-mark img,
.sm-hub-project-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .2));
}

.sm-hub-section-mark { width: 42px; height: 42px; }
.sm-hub-section-copy { display: grid; min-width: 0; gap: 4px; }
.sm-hub-section-copy strong { font-size: 13px; }
.sm-hub-section-copy small { overflow: hidden; color: var(--app-muted, #9da2ba); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.sm-hub-section-count { min-width: 28px; padding: 5px 8px; color: var(--section-accent); background: color-mix(in srgb, var(--section-accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--section-accent) 22%, transparent); border-radius: 999px; font-size: 10px; font-weight: 900; text-align: center; }
.sm-hub-section-arrow { color: var(--section-accent); font-size: 18px; }

.sm-hub-projects {
  display: grid;
  min-height: 0;
  padding: 16px;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 11px;
  background: rgba(13, 16, 33, .93);
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: 18px;
  overflow: hidden;
}

.sm-hub-projects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.sm-hub-projects-head h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.sm-hub-projects-head .sm-hub-kicker { margin-bottom: 3px; }

.sm-hub-search {
  display: grid;
  width: min(470px, 48vw);
  height: 39px;
  padding: 0 12px;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  color: #9da2ba;
  background: rgba(5, 7, 18, .72);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px;
}

.sm-hub-search input {
  width: 100%;
  color: #fff;
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 11px;
}

.sm-hub-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.sm-hub-filters button {
  min-height: 29px;
  padding: 5px 10px;
  color: #aeb3c7;
  background: rgba(255, 255, 255, .025);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}
.sm-hub-filters button span { margin-left: 5px; opacity: .65; }
.sm-hub-filters button:hover,
.sm-hub-filters button.is-active { color: #fff; background: rgba(155, 135, 255, .13); border-color: rgba(155, 135, 255, .27); }

.sm-hub-project-list {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 7px;
  overflow: hidden auto;
}

.sm-hub-project-card {
  --section-accent: #9b87ff;
  display: grid;
  min-width: 0;
  min-height: 67px;
  padding: 9px 12px;
  grid-template-columns: 38px minmax(0, 1fr) minmax(110px, auto) 75px;
  align-items: center;
  gap: 11px;
  color: #f7f7fb;
  background: rgba(255, 255, 255, .022);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.sm-hub-project-regie { --section-accent: #52e2d0; }
.sm-hub-project-movement { --section-accent: #ffb56b; }
.sm-hub-project-card:hover { background: rgba(155, 135, 255, .07); border-color: color-mix(in srgb, var(--section-accent) 32%, transparent); transform: translateX(2px); }
.sm-hub-project-mark { width: 38px; height: 38px; }
.sm-hub-project-copy,
.sm-hub-project-detail { display: grid; min-width: 0; gap: 3px; }
.sm-hub-project-type { color: var(--section-accent); font-size: 7px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.sm-hub-project-copy strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sm-hub-project-copy small,
.sm-hub-project-detail small { overflow: hidden; color: var(--app-muted, #9da2ba); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.sm-hub-project-detail { justify-items: end; }
.sm-hub-project-detail strong { font-size: 9px; }
.sm-hub-project-open { color: var(--section-accent); font-size: 9px; font-weight: 850; text-align: right; }

.sm-hub-empty {
  display: grid;
  min-height: 135px;
  align-content: center;
  justify-items: center;
  gap: 6px;
  color: var(--app-muted, #9da2ba);
  background: rgba(255, 255, 255, .018);
  border: 1px dashed rgba(255, 255, 255, .1);
  border-radius: 13px;
  font-size: 10px;
  text-align: center;
}
.sm-hub-empty strong { color: #fff; font-size: 14px; }

.sm-library-shell .dashboard-title h2 { margin-top: 0; }
.sm-library-shell .dashboard-header { padding: 18px 20px; background: rgba(13, 16, 33, .93); border: 1px solid rgba(255, 255, 255, .085); border-radius: 18px; }
.sm-library-shell .dashboard-toolbar { border-radius: 14px; }

.sm-movement-library {
  display: grid;
  height: 100%;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
}

.sm-movement-library-header {
  display: flex;
  padding: 20px 22px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 181, 107, .13), transparent 32%),
    rgba(13, 16, 33, .95);
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: 18px;
}
.sm-movement-library-header h1 { margin: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.04em; }
.sm-movement-library-header p { margin: 6px 0 0; color: var(--app-muted, #9da2ba); font-size: 11px; }
.sm-movement-library-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }

.sm-movement-library-toolbar {
  display: flex;
  padding: 9px 11px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(13, 16, 33, .88);
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 13px;
}
.sm-movement-library-toolbar > span { color: var(--app-muted, #9da2ba); font-size: 9px; font-weight: 800; white-space: nowrap; }

.sm-movement-library-grid {
  display: grid;
  min-height: 0;
  padding: 2px;
  align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
  overflow: hidden auto;
}

.sm-movement-card {
  display: grid;
  min-width: 0;
  min-height: 150px;
  padding: 13px;
  grid-template-columns: 92px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 10px 13px;
  background: rgba(16, 19, 38, .91);
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: 16px;
  outline: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.sm-movement-card:hover,
.sm-movement-card:focus-visible { background: rgba(22, 26, 49, .97); border-color: rgba(255, 181, 107, .32); transform: translateY(-2px); }
.sm-movement-card-draft { border-color: rgba(82, 226, 208, .23); background: linear-gradient(135deg, rgba(82,226,208,.055), rgba(16,19,38,.94)); }
.sm-movement-card-draft .sm-movement-card-preview { border-color: rgba(82,226,208,.24); }
.sm-movement-card-draft .sm-movement-card-preview span { background: #52e2d0; box-shadow: 0 0 22px rgba(82,226,208,.26); }
.sm-movement-card-draft .sm-movement-card-copy > span { color: #52e2d0; }
.sm-movement-card-draft .sm-movement-card-actions button.primary { background: #52e2d0; }
.sm-movement-card-preview {
  position: relative;
  display: grid;
  grid-row: 1/3;
  width: 92px;
  min-height: 120px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px),
    #090b18;
  background-size: 16px 16px;
  border: 1px solid rgba(255, 181, 107, .18);
  border-radius: 12px;
  place-items: center;
}
.sm-movement-card-preview span { z-index: 2; display: grid; width: 38px; height: 38px; color: #101326; background: #ffb56b; border-radius: 11px; font-size: 13px; font-weight: 950; place-items: center; box-shadow: 0 0 22px rgba(255,181,107,.28); }
.sm-movement-card-preview i { position: absolute; width: 56px; height: 1px; background: rgba(82,226,208,.65); transform-origin: left; }
.sm-movement-card-preview i:nth-of-type(1) { transform: translate(45px, 22px) rotate(-25deg); }
.sm-movement-card-preview i:nth-of-type(2) { background: rgba(255,114,133,.7); transform: translate(45px, 22px) rotate(25deg); }
.sm-movement-card-preview i:nth-of-type(3) { background: rgba(155,135,255,.75); transform: translate(45px, 22px) rotate(90deg); }
.sm-movement-card-copy { display: grid; min-width: 0; align-content: center; gap: 4px; }
.sm-movement-card-copy > span { color: #ffb56b; font-size: 7px; font-weight: 900; letter-spacing: .12em; }
.sm-movement-card-copy h2 { overflow: hidden; margin: 0; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.sm-movement-card-copy p,
.sm-movement-card-copy small { margin: 0; color: var(--app-muted, #9da2ba); font-size: 8px; }
.sm-movement-card-actions { display: flex; min-width: 0; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.sm-movement-card-actions button {
  min-height: 28px;
  padding: 5px 8px;
  color: #c8ccdc;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: 7px;
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
}
.sm-movement-card-actions button.primary { color: #111322; background: #ffb56b; border-color: transparent; }
.sm-movement-card-actions button.danger { color: #ff7285; }
.sm-movement-library-status { min-height: 16px; color: #9da2ba; font-size: 9px; }
.sm-movement-library-status[data-type="error"] { color: #ff7285; }

.sm-extension-store-backdrop {
  position: fixed;
  z-index: 4200;
  display: grid;
  padding: 24px;
  background: rgba(3, 4, 12, .82);
  backdrop-filter: blur(10px);
  inset: 0;
  place-items: center;
}
.sm-extension-store-backdrop[hidden] { display: none; }
.sm-extension-store {
  display: grid;
  width: min(1120px, 100%);
  max-height: min(860px, 92vh);
  padding: 18px;
  gap: 15px;
  overflow: hidden auto;
  color: #f7f7fb;
  background:
    radial-gradient(circle at 10% 0%, rgba(242,199,92,.17), transparent 31%),
    linear-gradient(145deg, #171a31, #0b0d1c);
  border: 1px solid rgba(242,199,92,.24);
  border-radius: 22px;
  box-shadow: 0 34px 90px rgba(0,0,0,.55);
}
.sm-extension-store > header {
  display: flex;
  padding: 3px 4px 13px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sm-extension-store > header > div { display: block; }
.sm-extension-store h2 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.sm-extension-store header p { margin: 5px 0 0; color: #9da2ba; font-size: 10px; }
.sm-extension-store header > button { width: 34px; height: 34px; color: #c8ccdc; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: 9px; cursor: pointer; font-size: 20px; }
.sm-store-kicker { display: block; margin-bottom: 5px; color: #f2c75c; font-size: 8px; font-weight: 900; letter-spacing: .16em; }
.sm-extension-store-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.sm-extension-card {
  display: grid;
  min-width: 0;
  min-height: 126px;
  padding: 13px;
  grid-template-columns: 44px minmax(0,1fr) auto;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 9px 12px;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 15px;
  transition: .2s ease;
}
.sm-extension-card.is-owned { border-color: rgba(103,234,162,.28); background: rgba(103,234,162,.045); }
.sm-extension-card.is-locked { border-color: rgba(255,114,133,.22); background: rgba(255,114,133,.035); }
.sm-extension-card.is-attention { box-shadow: 0 0 0 3px rgba(242,199,92,.22); transform: translateY(-2px); }
.sm-extension-card-mark { display: grid; width: 44px; height: 44px; grid-row: 1/3; color: #11131e; background: linear-gradient(135deg,#f2c75c,#ffad55); border-radius: 12px; font-size: 10px; font-weight: 950; place-items: center; }
.sm-extension-card-copy { display: grid; min-width: 0; gap: 3px; }
.sm-extension-card-copy > span { color: #f2c75c; font-size: 7px; font-weight: 900; letter-spacing: .12em; }
.sm-extension-card-copy h3 { margin: 0; font-size: 13px; }
.sm-extension-card-copy p { margin: 0; color: #9da2ba; font-size: 8px; line-height: 1.45; }
.sm-extension-card-state { display: grid; justify-items: end; gap: 3px; }
.sm-extension-card-state strong { color: #ff8999; font-size: 9px; }
.sm-extension-card.is-owned .sm-extension-card-state strong { color: #67eaa2; }
.sm-extension-card-state small { color: #858aa1; font-size: 7px; }
.sm-extension-card > button { grid-column: 2/4; min-height: 29px; color: #19160c; background: #f2c75c; border: 0; border-radius: 8px; cursor: pointer; font-size: 8px; font-weight: 850; }
.sm-extension-card > button:disabled { color: #8ef1b5; background: rgba(103,234,162,.1); border: 1px solid rgba(103,234,162,.2); cursor: default; }
.sm-extension-license-panel { display: grid; padding: 13px; grid-template-columns: minmax(190px,.55fr) minmax(360px,1.45fr); gap: 8px 16px; background: rgba(4,6,16,.5); border: 1px solid rgba(242,199,92,.15); border-radius: 14px; }
.sm-extension-license-panel > div:first-child { display: grid; align-content: center; gap: 4px; }
.sm-extension-license-panel > div:first-child strong { font-size: 11px; }
.sm-extension-license-panel > div:first-child span { color: #9da2ba; font-size: 8px; }
.sm-extension-license-form { display: grid; grid-template-columns: minmax(180px,1fr) auto auto; gap: 6px; }
.sm-extension-license-form input { min-width: 0; height: 34px; padding: 6px 9px; color: #fff; background: #090b17; border: 1px solid rgba(255,255,255,.11); border-radius: 8px; outline: 0; font-size: 9px; }
.sm-extension-license-form input:focus { border-color: rgba(242,199,92,.5); box-shadow: 0 0 0 2px rgba(242,199,92,.08); }
.sm-extension-license-form button { min-height: 34px; padding: 6px 10px; color: #19160c; background: #f2c75c; border: 0; border-radius: 8px; cursor: pointer; font-size: 8px; font-weight: 850; }
.sm-extension-license-form button.danger { color: #ff8999; background: rgba(255,114,133,.08); border: 1px solid rgba(255,114,133,.2); }
#smLicenseMessage { min-height: 15px; grid-column: 1/-1; margin: 2px 0 0; color: #9da2ba; font-size: 8px; }
#smLicenseMessage[data-type="success"] { color: #67eaa2; }
#smLicenseMessage[data-type="error"] { color: #ff8999; }

@media (max-width: 980px) {
  .sm-hub-hero { align-items: flex-start; flex-direction: column; }
  .sm-hub-hero-actions { justify-content: flex-start; }
  .sm-hub-sections { grid-template-columns: 1fr; }
  .sm-hub { overflow: auto; }
  .sm-hub-projects { min-height: 380px; }
  .sm-movement-library-header { align-items: flex-start; flex-direction: column; }
  .sm-movement-library-actions { justify-content: flex-start; }
  .sm-extension-store-grid { grid-template-columns: 1fr; }
  .sm-extension-license-panel { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .sm-hub-projects-head { align-items: stretch; flex-direction: column; }
  .sm-hub-search { width: 100%; }
  .sm-hub-project-card { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .sm-hub-project-detail { display: none; }
  .sm-hub-project-open { font-size: 0; }
  .sm-hub-project-open::after { content: "→"; font-size: 16px; }
  .sm-extension-license-form { grid-template-columns: 1fr; }
}


/* Dashboard : cartes lisibles, y compris lorsque le mode compact est actif. */
.sm-hub-kicker { font-size: clamp(10px, .72vw, 11px); }
.sm-hub-section-copy small { font-size: clamp(10px, .76vw, 11px); }
.sm-hub-section-count,
.sm-hub-filters button { font-size: 11px; }
.sm-hub-search input { font-size: 12px; }

.sm-hub-project-card { min-height: 72px; }
.sm-compact-ui .sm-hub-project-card {
  min-height: 64px;
  padding-block: 7px;
}
.sm-compact-ui .sm-hub-project-copy,
.sm-compact-ui .sm-hub-project-detail { gap: 2px; }
.sm-hub-project-type {
  font-size: clamp(10px, .7vw, 11px);
  line-height: 1.1;
}
.sm-hub-project-copy strong {
  font-size: clamp(13px, .9vw, 14px);
  line-height: 1.2;
}
.sm-hub-project-copy small,
.sm-hub-project-detail small {
  font-size: clamp(10px, .76vw, 11px);
  line-height: 1.25;
}
.sm-hub-project-detail strong,
.sm-hub-project-open {
  font-size: clamp(10px, .76vw, 11px);
  line-height: 1.2;
}

/* Les bibliothèques secondaires conservent leur densité prévue. */
.sm-library-kicker,
.sm-movement-card-copy > span,
.sm-store-kicker,
.sm-extension-card-copy > span { font-size: clamp(9px, .62vw, 10px); }
.sm-movement-card-copy p,
.sm-movement-card-copy small,
.sm-extension-card-copy p { font-size: clamp(9px, .68vw, 11px); }
.sm-movement-card-copy strong { font-size: clamp(11px, .78vw, 12px); }
.sm-movement-library-toolbar > span,
.sm-movement-library-status,
.sm-extension-card-state strong,
.sm-extension-card-state small,
#smLicenseMessage { font-size: 10px; }
.sm-movement-card-actions button,
.sm-extension-card > button,
.sm-extension-license-form input,
.sm-extension-license-form button { font-size: 11px; }
