:root {
  color-scheme: dark;
  --ink: #eaf2f8;
  --muted: #a8bccb;
  --muted-strong: #8da3b5;
  /* Échelle typographique partagée avec la vitrine : chaque niveau est
     nettement distinct du suivant, pour que la hiérarchie se lise d'un coup. */
  --text-display: clamp(2rem, 4vw, 3.4rem);
  --text-title: clamp(1.5rem, 2.2vw, 2rem);
  --text-section: 1.25rem;
  --text-body: .95rem;
  --text-label: .82rem;
  --text-meta: .75rem;
  --panel: rgba(12, 28, 43, 0.82);
  --panel-solid: #0d2030;
  --line: rgba(135, 176, 197, 0.16);
  --teal: #46dccb;
  --teal-deep: #0c9e96;
  --blue: #4d8cff;
  --danger: #ff7d85;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #07111f; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(28, 126, 145, 0.24), transparent 32rem),
    radial-gradient(circle at 90% 78%, rgba(51, 93, 171, 0.18), transparent 34rem),
    linear-gradient(145deg, #07111f 0%, #081725 48%, #07121c 100%);
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .14;
  pointer-events: none;
}
.ambient-one { top: -16rem; right: -8rem; background: var(--teal); }
.ambient-two { bottom: -18rem; left: 26%; background: var(--blue); }

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(28rem, .88fr);
  min-height: 100vh;
}

.intro-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: clamp(2rem, 5vw, 5.5rem);
  border-right: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  width: fit-content;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -.04em;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid rgba(103, 238, 221, .5);
  border-radius: .7rem;
  color: #06151b;
  background: linear-gradient(135deg, #7cf3df, #35c5bd);
  box-shadow: 0 0 30px rgba(70, 220, 203, .22);
}

.intro-copy { max-width: 46rem; margin: 5rem 0; }
.eyebrow {
  margin: 0 0 .8rem;
  color: var(--teal);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.intro-copy h1 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(3rem, 6.7vw, 6.6rem);
  font-weight: 680;
  letter-spacing: -.072em;
  line-height: .94;
}
.intro-copy h1 span { color: #81a5b7; }
.lead {
  max-width: 38rem;
  margin: 2rem 0 0;
  color: #a9bdc9;
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  line-height: 1.72;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #a8bbc7;
  font-size: .8rem;
}
.trust-list li { display: flex; gap: .55rem; align-items: center; }
.trust-list span { color: var(--teal); font-family: ui-monospace, monospace; font-size: .68rem; }

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 5rem);
  background: rgba(5, 15, 26, .28);
  backdrop-filter: blur(20px);
}
.status-line {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: min(100%, 31rem);
  margin: 0 auto 1.2rem;
  color: var(--muted);
  font-size: .76rem;
}
.status-dot {
  display: inline-block;
  width: .52rem;
  height: .52rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #748393;
  box-shadow: 0 0 0 4px rgba(116, 131, 147, .1);
}
.status-dot.ok { background: var(--teal); box-shadow: 0 0 0 4px rgba(70, 220, 203, .1), 0 0 14px rgba(70, 220, 203, .5); }
.status-dot.error { background: var(--danger); }
.status-dot.pending { animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.auth-card {
  width: min(100%, 31rem);
  margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: linear-gradient(145deg, rgba(18, 39, 56, .9), rgba(9, 25, 38, .92));
  box-shadow: var(--shadow);
}
.auth-card h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -.045em; }
.muted { margin: .65rem 0 1.8rem; color: var(--muted); line-height: 1.55; }

.surface-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem;
  margin-bottom: 1.6rem;
  padding: .32rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: rgba(3, 13, 22, .45);
}
.surface-switch label { cursor: pointer; }
.surface-switch input { position: absolute; opacity: 0; pointer-events: none; }
.surface-switch span {
  display: block;
  padding: .68rem .55rem;
  border-radius: .62rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  transition: .18s ease;
}
.surface-switch input:checked + span { color: #dffcf7; background: rgba(70, 220, 203, .13); box-shadow: inset 0 0 0 1px rgba(70, 220, 203, .2); }
.surface-switch input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }

.field { display: block; margin: 0 0 1.15rem; }
.field span { display: block; margin-bottom: .5rem; color: #c5d3dc; font-size: .78rem; font-weight: 680; }
.field input {
  width: 100%;
  height: 3.15rem;
  padding: 0 1rem;
  border: 1px solid rgba(141, 174, 194, .22);
  border-radius: .72rem;
  outline: none;
  color: var(--ink);
  background: rgba(4, 15, 25, .66);
  transition: border .18s, box-shadow .18s;
}
.field input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(70, 220, 203, .11); }
.form-error { margin: .3rem 0 1rem; color: var(--danger); font-size: .82rem; line-height: 1.5; }
.form-success { margin: .3rem 0 1rem; color: var(--teal); font-size: .82rem; line-height: 1.5; }
.primary-button, .ghost-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 3.15rem;
  padding: 0 1.15rem;
  border: 0;
  border-radius: .72rem;
  color: #031515;
  background: linear-gradient(120deg, #78eedc, #43cdc6);
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s, filter .18s;
}
.primary-button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; filter: saturate(.4); opacity: .7; transform: none; }
.security-note { margin: 1.2rem 0 0; color: #6f8797; font-size: .7rem; line-height: 1.55; }

.app-shell { position: relative; z-index: 1; min-height: 100vh; }
.app-shell:not([hidden]) { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.7rem 1.25rem;
  border-right: 1px solid var(--line);
  background: rgba(5, 16, 27, .72);
  backdrop-filter: blur(18px);
}
.wordmark.compact { margin: 0 .65rem 2.8rem; }
.main-nav { display: grid; gap: .38rem; }
.nav-item {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-height: 2.8rem;
  padding: 0 .8rem;
  border-radius: .65rem;
  color: #8ea5b5;
  font-size: .82rem;
  font-weight: 650;
  text-decoration: none;
}
.nav-item > span { width: 1rem; color: #7994a5; text-align: center; }
.nav-item.active { color: #dffbf7; background: rgba(70, 220, 203, .1); }
.nav-item.active > span { color: var(--teal); }
.nav-item.disabled { opacity: .52; cursor: not-allowed; }
.nav-item small { margin-left: auto; font-size: .55rem; letter-spacing: .06em; text-transform: uppercase; }
.sidebar-footer { display: grid; gap: .6rem; margin-top: auto; padding: 1rem .65rem 0; border-top: 1px solid var(--line); font-size: .68rem; }
.sidebar-footer a { color: #a6bdca; text-decoration: none; }
.sidebar-footer span { color: #557080; }

.workspace { min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 7.4rem;
  padding: 1.6rem clamp(1.5rem, 4vw, 4.5rem);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 31, .46);
  backdrop-filter: blur(14px);
}
.topbar h1 { margin: 0; font-size: clamp(1.55rem, 2.4vw, 2.15rem); letter-spacing: -.045em; }
.account-actions { display: flex; align-items: center; gap: .8rem; }
.service-chip { display: flex; align-items: center; gap: .5rem; padding: .68rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .72rem; }
.ghost-button { width: auto; min-height: 2.55rem; color: #b8cad5; border: 1px solid var(--line); background: rgba(16, 34, 48, .5); font-size: .75rem; }
.ghost-button:hover { border-color: rgba(70, 220, 203, .35); color: #e5fbf7; }
.workspace-error { margin: 1rem clamp(1.5rem, 4vw, 4.5rem) 0; padding: .8rem 1rem; border: 1px solid rgba(255, 125, 133, .22); border-radius: .7rem; color: #ffabb1; background: rgba(127, 35, 47, .16); font-size: .76rem; }

.content { max-width: 90rem; margin: 0 auto; padding: clamp(1.5rem, 4vw, 4.5rem); }
.hero-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 15rem;
  overflow: hidden;
  padding: clamp(1.6rem, 4vw, 3.5rem);
  border: 1px solid rgba(70, 220, 203, .18);
  border-radius: 1.4rem;
  background: linear-gradient(120deg, rgba(14, 53, 62, .82), rgba(12, 30, 48, .72));
  box-shadow: var(--shadow);
}
.hero-card::after { content: ""; position: absolute; width: 24rem; height: 24rem; right: -10rem; top: -12rem; border-radius: 50%; background: rgba(70, 220, 203, .08); }
.hero-card > div:first-child { position: relative; z-index: 1; max-width: 44rem; }
.hero-card h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.058em; }
.hero-card p:last-child { max-width: 42rem; margin: 1rem 0 0; color: #9eb5c2; line-height: 1.65; }
.hero-orbit { position: relative; z-index: 1; display: grid; place-items: center; width: 7rem; height: 7rem; margin: 0 3vw; border: 1px solid rgba(88, 233, 216, .3); border-radius: 50%; box-shadow: 0 0 0 1.3rem rgba(70, 220, 203, .035), 0 0 0 2.6rem rgba(70, 220, 203, .018); }
.hero-orbit span { display: grid; place-items: center; width: 3.3rem; height: 3.3rem; border-radius: 1rem; color: #07191e; background: var(--teal); font-size: 1.4rem; font-weight: 850; transform: rotate(-8deg); }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; margin-top: 1.2rem; }
.card { padding: 1.6rem; border: 1px solid var(--line); border-radius: 1.15rem; background: var(--panel); box-shadow: 0 15px 45px rgba(0, 0, 0, .12); }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.card h3 { margin: 0; font-size: 1.3rem; letter-spacing: -.035em; }
.badge { padding: .42rem .62rem; border: 1px solid rgba(70, 220, 203, .18); border-radius: 999px; color: var(--teal); background: rgba(70, 220, 203, .07); font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.identity-list { margin: 0; }
.identity-list > div { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 1rem; padding: .82rem 0; border-top: 1px solid var(--line); }
.identity-list dt { color: #6e8797; font-size: .72rem; }
.identity-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: #c5d6df; font-size: .78rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.readiness-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.readiness-list li { display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: .7rem; padding: .74rem 0; border-top: 1px solid var(--line); }
.readiness-list li > span { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: .5rem; font-size: .7rem; }
.check { color: var(--teal); background: rgba(70, 220, 203, .1); }
.wait { color: #7f96a5; background: rgba(127, 150, 165, .1); }
.readiness-list strong, .readiness-list small { display: block; }
.readiness-list strong { color: #cad9e1; font-size: .78rem; }
.readiness-list small { margin-top: .2rem; color: #698292; font-size: .67rem; }
.readiness-list em { color: var(--teal); font-size: .62rem; font-style: normal; font-weight: 800; text-transform: uppercase; }
.readiness-list em.pending-label { color: #738a99; }
.notice { display: flex; align-items: center; gap: 1rem; margin-top: 1.2rem; padding: 1.1rem 1.3rem; border: 1px solid rgba(77, 140, 255, .2); border-radius: 1rem; background: rgba(34, 71, 117, .18); }
.notice > div { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; flex: 0 0 auto; border-radius: .6rem; color: #7eacff; background: rgba(77, 140, 255, .12); }
.notice p { margin: 0; color: #91a9ba; font-size: .75rem; line-height: 1.55; }
.notice strong { color: #c7d8e3; }

.control-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.6rem;
  margin-top: 1.2rem;
}

.control-panel.hidden { display: none; }

/* Un seul niveau de conteneur visible par écran : la carte porte le cadre,
   le panneau qui la contient reste transparent et ne fait qu'espacer. */
.control-card {
  padding: 1.5rem 1.6rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: rgba(7, 17, 31, .38);
}



.control-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .95rem;
}

.control-card h3 {
  margin: .15rem 0 0;
  font-size: var(--text-section);
  letter-spacing: -.03em;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.button-row > * {
  flex: 1 1 12rem;
}

.secondary {
  color: #c7d8e3;
  border: 1px solid var(--line);
  background: rgba(16, 34, 48, .5);
}

.secondary:hover {
  border-color: rgba(70, 220, 203, .35);
  color: #e5fbf7;
}

.compact {
  min-height: 2.55rem;
  padding: 0 .8rem;
  font-size: .75rem;
}

.stack {
  display: grid;
  gap: .75rem;
}

.stack label,
.checkbox-line {
  display: grid;
  gap: .35rem;
  color: #c5d3dc;
  font-size: var(--text-label);
  font-weight: 620;
}

.stack input,
.stack select,
.stack textarea {
  width: 100%;
  border: 1px solid rgba(141, 174, 194, .22);
  border-radius: .72rem;
  outline: none;
  color: var(--ink);
  background: rgba(4, 15, 25, .66);
}

.stack input,
.stack select {
  min-height: 3rem;
  padding: 0 .9rem;
}

.stack textarea {
  min-height: 7rem;
  padding: .85rem .9rem;
  resize: vertical;
}

.stack input:focus,
.stack select:focus,
.stack textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(70, 220, 203, .11);
}

.stack button { width: 100%; }

.activation-result {
  display: grid;
  gap: .65rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(70, 220, 203, .2);
  border-radius: .8rem;
  background: rgba(70, 220, 203, .06);
}

.activation-result label {
  display: grid;
  gap: .35rem;
  color: #c5d3dc;
  font-size: .78rem;
  font-weight: 680;
}

.activation-result input {
  min-height: 3rem;
  width: 100%;
  padding: 0 .9rem;
  border: 1px solid rgba(141, 174, 194, .22);
  border-radius: .72rem;
  color: var(--ink);
  background: rgba(4, 15, 25, .66);
}

.quota-form {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(6rem, .7fr) minmax(6rem, .7fr) auto;
  gap: .5rem;
  width: 100%;
  margin-top: .75rem;
}

.quota-form input,
.quota-form select {
  min-height: 2.55rem;
  min-width: 0;
  padding: 0 .65rem;
  border: 1px solid rgba(141, 174, 194, .22);
  border-radius: .65rem;
  color: var(--ink);
  background: rgba(4, 15, 25, .66);
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: .6rem;
  grid-auto-flow: column;
  justify-content: start;
}

.checkbox-line input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.list {
  display: grid;
  gap: .7rem;
  margin-top: .95rem;
}

.list-item {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem 1rem;
  border: 1px solid var(--line);
  border-radius: .95rem;
  background: rgba(5, 15, 26, .32);
}

.list-item strong {
  display: block;
  color: #e5fbf7;
}

.list-item p,
.list-item small {
  display: block;
  margin: .2rem 0 0;
  color: #91a9ba;
  line-height: 1.5;
}

.list-item .button-row { flex: 0 0 auto; }
.list-item > .stack { flex: 1 1 auto; min-width: 0; }

.muted { color: #91a9ba; }

.hidden { display: none !important; }

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .intro-panel { min-height: auto; padding-bottom: 2rem; border-right: 0; }
  .intro-copy { margin: 5rem 0 3rem; }
  .trust-list { display: none; }
  .auth-panel { padding-top: 1rem; padding-bottom: 4rem; }
  .app-shell:not([hidden]) { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: row; align-items: center; height: auto; padding: 1rem; }
  .wordmark.compact { margin: 0; }
  .main-nav { display: none; }
  .sidebar-footer { margin: 0 0 0 auto; padding: 0; border: 0; }
  .sidebar-footer span { display: none; }
}

@media (max-width: 650px) {
  .intro-panel { padding: 1.5rem; }
  .intro-copy { margin: 4rem 0 1rem; }
  .intro-copy h1 { font-size: 3.4rem; }
  .auth-panel { padding: 1rem; }
  .auth-card { padding: 1.4rem; border-radius: 1.1rem; }
  .topbar { align-items: flex-start; min-height: auto; padding: 1.2rem; }
  .topbar .eyebrow { display: none; }
  .topbar h1 { font-size: 1.25rem; }
  .service-chip { display: none; }
  .content { padding: 1rem; }
  .hero-card { min-height: 12rem; }
  .hero-orbit { display: none; }
  .grid { grid-template-columns: 1fr; }
  .control-panel { grid-template-columns: 1fr; }
  .quota-form { grid-template-columns: 1fr; }
  .sidebar-footer a { font-size: .65rem; }
}

/* ===== Console opérateur (scopé op-*) ===== */
.op-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.op-tab {
  padding: .5rem 1rem; border-radius: .6rem; border: 1px solid rgba(135,176,197,.18);
  background: transparent; color: inherit; font-weight: 700; cursor: pointer;
}
.op-tab-active { background: rgba(70,220,203,.14); border-color: rgba(70,220,203,.4); }
.op-tab-panel { display: block; }

.op-list { overflow-x: auto; }
.op-table { width: 100%; border-collapse: collapse; }
.op-table th, .op-table td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid rgba(135,176,197,.14); vertical-align: middle; }
.op-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: #9db2c4; }
.op-row { cursor: pointer; }
.op-row:hover, .op-row:focus { background: rgba(70,220,203,.08); outline: none; }
.op-sub { display: block; color: #9db2c4; font-size: .8rem; }

.op-badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.op-badge-ok { background: rgba(70,220,203,.16); color: #7cf3df; }
.op-badge-warn { background: rgba(255,196,84,.16); color: #ffc454; }
.op-badge-danger { background: rgba(255,110,110,.16); color: #ff8f8f; }

.op-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin: 1rem 0; }
.op-usage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; margin: 1rem 0; }
.op-usage-card { justify-content: space-between; padding: .9rem 1rem; border-radius: .8rem; border: 1px solid rgba(135,176,197,.16); background: rgba(4,15,25,.4); display: flex; flex-direction: column; gap: .35rem; }
.op-usage-label { min-height: 2.4em; font-size: .8rem; line-height: 1.2; color: var(--muted); }

.op-quota-editor { margin-top: 1.2rem; }
.op-quota-row { display: grid; grid-template-columns: minmax(0,1fr) 8rem 9rem auto; gap: .6rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid rgba(135,176,197,.1); }
.op-quota-label { font-weight: 600; }
@media (max-width: 720px) {
  .op-quota-row { grid-template-columns: 1fr 1fr; }
  .op-quota-label { grid-column: 1 / -1; }
}

/* ===== App utilisateur (scopé tn-*) ===== */
button.nav-item {
  width: 100%;
  text-align: left;
  font: inherit;
  border: 0;                 /* sinon la bordure par défaut du navigateur s'affiche */
  background: transparent;
  cursor: pointer;
}

.tn-toolbar { display: flex; align-items: flex-end; gap: .6rem; flex-wrap: wrap; }
.tn-inline-field { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; color: #9db2c4; }
.tn-inline-field select { min-width: 11rem; }

.tn-thread {
  display: flex; flex-direction: column; gap: .9rem;
  overflow-y: auto; padding: .4rem .2rem 1rem;
}
.tn-bubble { padding: .85rem 1rem; border-radius: .9rem; border: 1px solid rgba(135,176,197,.16); max-width: 46rem; }
.tn-bubble p { margin: 0; white-space: pre-wrap; }
.tn-bubble-user { align-self: flex-end; background: rgba(77,140,255,.14); border-color: rgba(77,140,255,.32); }
.tn-bubble-assistant { align-self: flex-start; background: rgba(4,15,25,.45); }

.tn-sources { margin-top: .75rem; padding-top: .6rem; border-top: 1px solid rgba(135,176,197,.14); }
.tn-sources-title { margin: 0 0 .35rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: #9db2c4; }
.tn-sources ul { margin: 0; padding-left: 1rem; display: flex; flex-direction: column; gap: .35rem; }
.tn-sources small { display: block; color: #9db2c4; font-size: .78rem; }
.tn-no-source { margin: .6rem 0 0; font-size: .82rem; color: #ffc454; }

.tn-feedback { display: flex; align-items: center; gap: .5rem; margin-top: .7rem; flex-wrap: wrap; }
.tn-feedback-note { font-size: .78rem; color: #7cf3df; }

.tn-composer { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: end; margin-top: .8rem; }
.tn-composer textarea { width: 100%; resize: vertical; }

.tn-list { overflow-x: auto; }
.tn-table td:last-child { text-align: right; white-space: nowrap; }

@media (max-width: 720px) {
  .tn-composer { grid-template-columns: 1fr; }
  .tn-bubble { max-width: 100%; }
}

.op-hint { display: block; margin-top: .25rem; color: #9db2c4; font-size: .78rem; }

/* ===== Navigation par sections et tableaux triables ===== */
.nav-group {
  margin: 1.1rem 0 .35rem;
  padding: 0 .2rem;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #7e93a6;
}

.op-sort {
  background: none; border: 0; padding: 0; font: inherit; color: inherit;
  text-transform: uppercase; letter-spacing: .06em; font-size: .75rem;
  cursor: pointer;
}
.op-sort:hover { color: #7cf3df; }

.op-columns { margin-bottom: .8rem; font-size: .82rem; }
.op-columns summary { cursor: pointer; color: #9db2c4; }
.op-column-list { display: flex; flex-wrap: wrap; gap: .8rem; padding: .6rem .2rem 0; }
.op-column-choice { display: flex; align-items: center; gap: .35rem; }

.op-advanced { margin: .4rem 0; }
.op-advanced summary { cursor: pointer; color: #9db2c4; font-size: .85rem; }
.op-advanced label { display: block; margin-top: .6rem; }

/* ===== Saisie guidée et premiers pas ===== */
.help-toggle {
  margin-left: .4rem; width: 1.25rem; height: 1.25rem; padding: 0;
  border-radius: 50%; border: 1px solid rgba(135,176,197,.35);
  background: transparent; color: #9db2c4; font-size: .72rem; line-height: 1;
  cursor: pointer;
}
.help-toggle:hover { color: #7cf3df; border-color: rgba(70,220,203,.5); }

.tn-fieldset { border: 0; padding: 0; margin: 0; }
.tn-fieldset legend { padding: 0; font-size: .9rem; }
.tn-role-list { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.tn-role-choice {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .6rem .75rem; border-radius: .7rem;
  border: 1px solid rgba(135,176,197,.16); background: rgba(4,15,25,.35);
}
.tn-role-choice small { display: block; color: #9db2c4; font-size: .78rem; margin-top: .15rem; }

.tn-onboarding { margin-bottom: 1.2rem; }
.tn-steps { margin: 1rem 0 1.1rem; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.tn-steps li { display: grid; gap: .2rem; }
.tn-steps li span { color: #9db2c4; font-size: .85rem; }
.tn-steps li button { justify-self: start; margin-top: .3rem; }
.tn-step-done { color: #7cf3df; }
.tn-step-done span { color: #9db2c4; }

/* ===== Corrections d'ergonomie : aide, profils, rôles ===== */
.field-label { display: flex; align-items: center; gap: .1rem; }
.stack .help-toggle,
.tn-fieldset .help-toggle { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; }

.tn-profile-list { display: grid; gap: .4rem; margin-top: .5rem; }
.tn-profile,
.tn-role-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: .55rem;
  padding: .5rem .65rem;
  border-radius: .6rem;
  border: 1px solid transparent;
  font-weight: 400;
  cursor: pointer;
}
.tn-profile:hover,
.tn-role-choice:hover { background: rgba(70, 220, 203, .06); }
.tn-profile-active { border-color: rgba(70, 220, 203, .38); background: rgba(70, 220, 203, .09); }
.tn-profile input,
.tn-role-choice input { width: .95rem; height: .95rem; margin: 0; accent-color: #46dccb; }
.tn-profile strong,
.tn-role-choice strong { font-size: .84rem; font-weight: 620; }
.tn-profile small,
.tn-role-choice small { display: block; color: #8da3b5; font-size: .76rem; margin-top: .1rem; }

.tn-role-list { gap: .15rem; }

/* ===== Hiérarchie et bandeaux de statut ===== */
.page-kicker {
  margin: 0;
  color: var(--teal);
  font-size: var(--text-meta);
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.control-card > p,
.tn-onboarding p,
.muted { font-size: var(--text-body); line-height: 1.6; }
.op-sub, .op-hint, .tn-sources small, .tn-role-choice small, .tn-profile small,
.list-item small { color: var(--muted); font-size: var(--text-meta); }

/* Les résultats ne sont plus des blocs de code : ce sont des bandeaux lisibles
   qui apparaissent après une action et disparaissent quand il n'y a rien à dire. */
.status-banner {
  margin: 1rem 0 0;
  padding: .75rem 1rem;
  border-radius: .7rem;
  border: 1px solid var(--line);
  background: rgba(4, 15, 25, .5);
  color: var(--ink);
  font-size: var(--text-label);
  line-height: 1.5;
}
.status-banner[hidden] { display: none; }
.status-ok { border-color: rgba(70, 220, 203, .38); background: rgba(70, 220, 203, .1); color: #9df6e6; }
.status-error { border-color: rgba(255, 125, 133, .38); background: rgba(127, 35, 47, .18); color: #ffb3b8; }

/* ===== La conversation occupe toute la hauteur disponible ===== */
.workspace { display: flex; flex-direction: column; min-height: 100vh; }
.content { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; width: 100%; }
.content > [data-app-panel] { min-height: 0; }
.content > [data-app-panel="assistant"]:not([hidden]) {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  margin-top: 0;
}
[data-app-panel="assistant"] > .control-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.tn-thread { flex: 1 1 auto; max-height: none; min-height: 12rem; }
.tn-composer { margin-top: auto; padding-top: .8rem; }

@media (max-width: 900px) {
  .workspace { min-height: auto; }
  .tn-thread { min-height: 18rem; }
}

/* ===== Un seul système de contrôles ============================
   Les champs et boutons vivaient hors de .stack sans aucun style :
   composeur de conversation, barre d'outils, lignes de quota. Ces
   règles de base donnent la même apparence partout. */
input, select, textarea {
  color: var(--ink);
  background: rgba(4, 15, 25, .66);
  border: 1px solid rgba(141, 174, 194, .22);
  border-radius: .72rem;
}
input, select { min-height: 2.9rem; padding: 0 .8rem; }
textarea { padding: .7rem .8rem; }
input::placeholder, textarea::placeholder { color: #6f8797; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(70, 220, 203, .11);
}
input[type="checkbox"], input[type="radio"] { min-height: 0; padding: 0; }

/* Bouton d'action par défaut : ce qui n'est ni secondaire, ni discret. */
.control-card button:not(.secondary):not(.ghost-button):not(.help-toggle):not(.op-sort):not(.op-link-danger):not(.op-breadcrumb button),
.tn-composer button {
  min-height: 2.9rem;
  padding: 0 1.15rem;
  border: 0;
  border-radius: .72rem;
  color: #031515;
  background: linear-gradient(120deg, #78eedc, #43cdc6);
  font-weight: 700;
  cursor: pointer;
}
.control-card button:not(.secondary):not(.ghost-button):not(.help-toggle):not(.op-sort):not(.op-link-danger):not(.op-breadcrumb button):hover,
.tn-composer button:hover { filter: brightness(1.07); }
.control-card button.danger { color: #ffb3b8; background: rgba(127, 35, 47, .3); }

/* Les boutons d'en-tête de carte gardent leur largeur naturelle. */
.control-card-head .button-row > *,
.tn-toolbar .button-row > * { flex: 0 0 auto; }

/* .stack label imposait sa grille aux profils et aux droits. */
.stack .tn-profile,
.stack .tn-role-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: .6rem;
  font-size: var(--text-label);
}
.stack .tn-profile-list { gap: .3rem; }
.stack .tn-role-list { display: grid; gap: .2rem; }

/* Une pastille ne s'étire pas sur toute la carte. */
.op-usage-card .op-badge { align-self: flex-start; }

/* Lignes de quota : alignement propre des contrôles natifs. */
.op-quota-row input, .op-quota-row select { min-height: 2.6rem; }

/* Les actions d'une ligne de liste restent côte à côte. */
.list-item .button-row > * { flex: 0 0 auto; }

/* Dépliants : le triangle natif ne suit pas la charte. */
.op-columns summary,
.op-advanced summary { list-style: none; display: inline-flex; align-items: center; gap: .4rem; }
.op-columns summary::-webkit-details-marker,
.op-advanced summary::-webkit-details-marker { display: none; }
.op-columns summary::before,
.op-advanced summary::before { content: "▸"; color: var(--teal); transition: transform .15s ease; }
.op-columns[open] summary::before,
.op-advanced[open] summary::before { transform: rotate(90deg); }

/* Une ligne d'organisation s'annonce comme cliquable. */
#platformTenantList .op-row td:last-child::after { content: "›"; float: right; color: var(--muted); font-size: 1.1rem; line-height: 1; }

/* ===== Tableau de bord opérateur ===== */
.op-dashboard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.op-dashboard-head h2 { margin: .2rem 0 .4rem; font-size: var(--text-title); letter-spacing: -.04em; }
.op-dashboard-head p { margin: 0; max-width: 46rem; }
.op-dashboard-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.6rem; margin-top: 1.6rem; }
.op-dashboard-columns + .control-card { margin-top: 1.6rem; }
#dashboardEngineSummary p:first-child { margin-top: 0; }
#dashboardAlerts .list-item, #dashboardRecent .list-item { cursor: pointer; }

/* ===== Hiérarchie des actions et de la fiche ===== */
.op-primary {
  border: 0;
  border-radius: .72rem;
  color: #031515;
  background: linear-gradient(120deg, #78eedc, #43cdc6);
  font-weight: 700;
  cursor: pointer;
}
.op-primary:hover { filter: brightness(1.07); }

/* Une action destructive ne domine pas l'écran. */
.op-link-danger {
  padding: 0;
  border: 0;
  background: none;
  color: #ff9aa1;
  font-size: var(--text-label);
  text-decoration: underline;
  text-underline-offset: .25rem;
  cursor: pointer;
}
.op-link-danger:hover { color: #ffc2c6; }

.op-breadcrumb { margin-bottom: .6rem; }
.op-breadcrumb button {
  padding: 0; border: 0; background: none;
  color: var(--muted); font-size: var(--text-label); cursor: pointer;
}
.op-breadcrumb button:hover { color: var(--teal); }

.op-detail-section { margin-top: 1.8rem; }
.op-detail-section h4 { margin: 0 0 .6rem; font-size: var(--text-section); letter-spacing: -.02em; }
.op-quota-label { display: grid; gap: .1rem; }

/* En-tête resserré : la console n'a pas besoin de 7,4 rem pour se présenter. */
.topbar { min-height: 5rem; padding-top: 1.1rem; padding-bottom: 1.1rem; }
.topbar h1 { font-size: clamp(1.35rem, 1.9vw, 1.75rem); }

/* Six chiffres clés : trois par ligne plutôt qu'une orpheline. */
#dashboardTiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { #dashboardTiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { #dashboardTiles { grid-template-columns: minmax(0, 1fr); } }

/* ===== Qualité documentaire ===== */
.tn-issue-list { margin: .4rem 0 1rem; padding-left: 1.1rem; display: grid; gap: .5rem; }
.tn-issue-list li { display: grid; gap: .1rem; }
.tn-issue-list strong { font-size: var(--text-meta); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tn-issue-list span { font-size: var(--text-label); }
#qualityList .op-table td:nth-child(2) { white-space: nowrap; }

/* ===== Historique et comparaison de versions ===== */
.tn-version-current { background: rgba(70, 220, 203, .07); }
.tn-diff {
  max-height: 22rem;
  overflow: auto;
  padding: .8rem 1rem;
  border-radius: .7rem;
  border: 1px solid var(--line);
  background: rgba(4, 15, 25, .55);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.tn-diff-add { color: #7cf3df; }
.tn-diff-del { color: #ff9aa1; }
#qualityComparison:not(:empty) { margin-top: 1.2rem; }

.tn-ai-opinion { margin: 1rem 0; padding: .9rem 1rem; border-radius: .8rem; border: 1px solid rgba(77,140,255,.2); background: rgba(77,140,255,.06); }
.tn-ai-opinion h4 { margin: 0 0 .4rem; }
.tn-ai-opinion p { margin: 0 0 .5rem; }
