/* ModTool V1 — interface creator-only, isolée du reste du dashboard. */
.modtool-page {
  display: grid;
  gap: var(--st-space-5);
  margin: 0 auto;
  max-width: 90rem;
  width: 100%;
}

.modtool-hero {
  align-items: flex-end;
  background: var(--st-bg-panel);
  border: var(--st-border-width) solid var(--st-border);
  border-radius: var(--st-radius-lg);
  box-shadow: var(--st-shadow-surface), var(--st-shadow-inset);
  display: flex;
  gap: var(--st-space-5);
  justify-content: space-between;
  padding: var(--st-space-6);
}

.modtool-hero h1 {
  font-size: var(--st-font-size-2xl);
  margin: var(--st-space-1) 0 var(--st-space-2);
}

.modtool-hero p { margin: 0; }

.modtool-model,
.modtool-role {
  align-items: center;
  background: var(--st-gold-soft);
  border: var(--st-border-width) solid var(--st-gold);
  border-radius: var(--st-radius-pill);
  color: var(--st-gold);
  display: inline-flex;
  font-size: var(--st-font-size-xs);
  font-weight: var(--st-weight-bold);
  letter-spacing: .08em;
  padding: var(--st-space-2) var(--st-space-3);
  white-space: nowrap;
}

.modtool-layout {
  align-items: start;
  display: grid;
  gap: var(--st-space-5);
  grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
}

.modtool-card {
  background: var(--st-bg-panel);
  border: var(--st-border-width) solid var(--st-border);
  border-radius: var(--st-radius-lg);
  box-shadow: var(--st-shadow-surface), var(--st-shadow-inset);
  padding: var(--st-space-5);
}

.modtool-card h2,
.modtool-card h3,
.modtool-card p { margin-top: 0; }

.modtool-card-heading {
  color: var(--st-off-white);
  font-size: var(--st-font-size-sm);
  font-weight: var(--st-weight-bold);
  letter-spacing: .06em;
  margin-bottom: var(--st-space-4);
  text-transform: uppercase;
}

.modtool-directory {
  position: sticky;
  top: var(--st-space-4);
}

.modtool-search,
.modtool-form label {
  display: grid;
  gap: var(--st-space-2);
}

.modtool-search input,
.modtool-form select {
  padding: var(--st-space-2) var(--st-space-3);
  width: 100%;
}

.modtool-user-list {
  display: grid;
  gap: var(--st-space-2);
  margin-top: var(--st-space-4);
  max-height: 34rem;
  overflow: auto;
}

.modtool-user {
  align-items: flex-start;
  background: var(--st-bg-elevated);
  border: var(--st-border-width) solid var(--st-border);
  border-radius: var(--st-radius-md);
  color: var(--st-off-white);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-weight: var(--st-weight-semibold);
  gap: var(--st-space-1);
  min-height: 3.75rem;
  padding: var(--st-space-3);
  text-align: left;
  width: 100%;
}

.modtool-user span {
  color: var(--st-slate);
  font-size: var(--st-font-size-xs);
  font-weight: var(--st-weight-medium);
}

.modtool-user:hover,
.modtool-user.active {
  border-color: var(--st-gold);
}

.modtool-user.active {
  box-shadow: var(--st-shadow-focus);
}

.modtool-detail {
  display: grid;
  gap: var(--st-space-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modtool-identity,
.modtool-empty {
  grid-column: 1 / -1;
}

.modtool-identity {
  background: var(--st-bg-elevated);
}

.modtool-role { margin-bottom: var(--st-space-3); }
.modtool-role.role-team_eunomie { border-color: var(--st-cyan); color: var(--st-cyan); }
.modtool-role.role-creator { box-shadow: var(--st-shadow-beacon); }

.modtool-protection {
  border-left: var(--st-space-1) solid var(--st-gold);
  color: var(--st-slate);
  margin-bottom: 0;
  padding-left: var(--st-space-3);
}

.modtool-form {
  align-items: end;
  display: grid;
  gap: var(--st-space-3);
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: var(--st-space-4);
}

.modtool-page .button.primary {
  background: var(--st-gradient-brand);
  border-color: var(--st-gold);
  color: var(--st-bg-deep);
}

.modtool-grant-list {
  display: grid;
  gap: var(--st-space-2);
  margin: var(--st-space-4) 0;
}

.modtool-grant {
  align-items: center;
  background: var(--st-bg-elevated);
  border: var(--st-border-width) solid var(--st-border);
  border-radius: var(--st-radius-md);
  display: flex;
  gap: var(--st-space-3);
  justify-content: space-between;
  min-height: 3rem;
  padding: var(--st-space-2) var(--st-space-3);
}

.modtool-grant code {
  color: var(--st-off-white);
  overflow-wrap: anywhere;
}

@media (max-width: 70rem) {
  .modtool-detail { grid-template-columns: 1fr; }
}

@media (max-width: 48rem) {
  .modtool-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: var(--st-space-5);
  }

  .modtool-layout { grid-template-columns: 1fr; }
  .modtool-directory { position: static; }
  .modtool-user-list { max-height: 20rem; }
  .modtool-form { grid-template-columns: 1fr; }
  .modtool-form .button { width: 100%; }
}
