/* V2.8 - Base portable fichier */
.data-status {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #111722;
  color: #cbd5e4;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap
}

.data-status:hover {
  background: #18202b
}

.data-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2a85d
}

.data-dot.ok {
  background: #55c98b;
  box-shadow: 0 0 0 3px rgba(85, 201, 139, .12)
}

.data-dot.err {
  background: #e56a76
}

.portable-modal-note {
  border: 1px solid #344258;
  background: #111824;
  border-radius: 12px;
  padding: 12px 13px;
  color: #9eacc0;
  line-height: 1.5;
  font-size: 12px;
  margin-bottom: 14px
}

/* Exported paper stays light; the live editor follows the application palette. */
.paper,
.template-preview .paper {
  background: #ffffff !important;
  color: #111827 !important;
  border-color: #d7dce5 !important;
}

.editor.document-editor,
#richEditor.editor {
  background: var(--ui-sidebar) !important;
  color: var(--ui-text) !important;
  border-color: var(--ui-border) !important;
}

#richEditor.editor {
  min-height: 420px;
  border: 1px solid #d7dce5;
  border-radius: 10px;
  padding: 22px 26px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

#richEditor.editor:focus {
  outline: none;
  border-color: var(--ui-accent) !important;
  box-shadow: 0 0 0 3px rgba(110, 148, 255, .14), 0 8px 24px rgba(0, 0, 0, .12);
}

.paper {
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}

.paper a {
  color: #2457d6 !important;
}

#richEditor.editor a {
  color: var(--ui-accent) !important;
}

.paper table {
  color: #111827;
}

#richEditor.editor table {
  color: var(--ui-text);
}

.paper td,
.paper th {
  border-color: #bfc7d4 !important;
}

#richEditor.editor td,
#richEditor.editor th {
  border-color: var(--ui-border) !important;
}

.paper .page-break {
  border-color: #a8b0bd !important;
}

#richEditor.editor .page-break {
  border-color: var(--ui-border) !important;
}

.template-preview {
  background: #202631;
  border-radius: 12px;
  padding: 18px;
}

/* Toolbar reste sombre, le document seul devient blanc */
.template-editor-main .toolbar {
  margin-bottom: 8px;
}

/* V3.2 - Advanced UX */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: #7f8ba0;
  font-size: 11px;
  margin-bottom: 5px
}

.breadcrumb span {
  cursor: pointer
}

.breadcrumb span:hover {
  color: #b9c8df
}

.breadcrumb .sep {
  cursor: default;
  color: #536073
}

.context-menu {
  position: fixed;
  z-index: 99999;
  width: 240px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow: auto;
  background: #151c27;
  border: 1px solid #344155;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .42);
  padding: 6px
}

.context-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #dce5f2;
  padding: 9px 10px;
  border-radius: 7px;
  text-align: left;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  letter-spacing: 0
}

.context-menu button:hover,
.context-menu button:focus-visible {
  background: #253044
}

.context-menu button:focus-visible {
  outline: 2px solid #8198c4;
  outline-offset: -2px
}

.context-menu button:disabled {
  opacity: .45;
  cursor: default
}

.context-menu button.danger {
  color: #ff8791
}

.context-menu .ctx-sep {
  height: 1px;
  background: #2d3748;
  margin: 5px
}

.password-tools {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 7px
}

.generator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.generator-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0
}

.generator-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #111722;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  font-size: 12px
}

.generated-password {
  display: flex;
  gap: 7px;
  align-items: center;
  background: #0d131c;
  border: 1px solid #39465b;
  border-radius: 9px;
  padding: 8px;
  margin-top: 10px
}

.generated-password code {
  flex: 1;
  word-break: break-all;
  color: #dfe8f5
}

.procedure-reader {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(0, 1fr);
  overflow: hidden
}

.procedure-toc {
  border-right: 1px solid var(--line);
  background: #111720;
  padding: 16px 12px;
  overflow: auto
}

.procedure-toc h4 {
  margin: 0 0 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #8a98ad
}

.procedure-toc a {
  display: block;
  color: #9cabc0;
  text-decoration: none;
  padding: 6px 7px;
  border-radius: 7px;
  font-size: 12px
}

.procedure-toc a:hover {
  background: #1f2836;
  color: white
}

.procedure-toc a.h2 {
  padding-left: 18px
}

.procedure-toc a.h3 {
  padding-left: 30px;
  font-size: 11px
}

.procedure-body-wrap {
  overflow: auto;
  background: #202631;
  padding: 18px
}

.procedure-document {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  color: #111827;
  padding: 40px 48px;
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  min-height: calc(100% - 2px)
}

.procedure-document pre,
.procedure-document code {
  background: #f1f4f8;
  color: #162033
}

.procedure-document img {
  max-width: 100%;
  height: auto
}

.procedure-document table {
  border-collapse: collapse;
  width: 100%
}

.procedure-document td,
.procedure-document th {
  border: 1px solid #c7ced8;
  padding: 7px
}

.attachments {
  border: 1px solid var(--line);
  background: #10161f;
  border-radius: 11px;
  padding: 12px;
  margin-top: 12px
}

.attachments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px
}

.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px
}

.attachment-card {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #303b4d;
  background: #151c27;
  border-radius: 9px;
  padding: 9px;
  min-width: 0
}

.attachment-icon {
  font-size: 22px;
  flex: 0 0 auto
}

.attachment-info {
  flex: 1;
  min-width: 0
}

.attachment-name {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.attachment-meta {
  font-size: 10px;
  color: #748299;
  margin-top: 3px
}

.attachment-actions {
  display: flex;
  gap: 4px
}

.attachment-actions button {
  padding: 5px 7px;
  font-size: 11px
}

.dashboard-recent {
  display: grid;
  gap: 7px
}

.dashboard-recent-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #111720;
  border: 1px solid #283245
}

.dashboard-recent-row .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.dashboard-recent-row .meta {
  font-size: 10px;
  color: #718097;
  white-space: nowrap
}

.rank-list {
  display: grid;
  gap: 8px
}

.rank-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center
}

.rank-num {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #202a39;
  color: #8eabff;
  font-size: 11px;
  font-weight: 800
}

.rank-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.rank-value {
  color: #8b99ad;
  font-size: 11px
}

.activity-30 {
  height: 190px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding-top: 12px
}

.activity-30 .day {
  flex: 1;
  min-width: 2px;
  height: 100%;
  display: flex;
  align-items: flex-end
}

.activity-30 .day>span {
  width: 100%;
  height: var(--h);
  min-height: 2px;
  background: linear-gradient(180deg, #7a9cff, #466bd0);
  border-radius: 2px 2px 0 0
}

@media(max-width:850px) {
  .procedure-reader {
    grid-template-columns: 1fr
  }

  .procedure-toc {
    display: none
  }
}

/* V3.3 - UX / stabilité */
.topbar {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
}

.brand {
  min-width: max-content;
}

.global-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
}

.top-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.data-status {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 7px 9px;
}

.data-status span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard {
  padding: clamp(16px, 2vw, 28px);
}

.dashboard-head {
  align-items: center;
  margin-bottom: 16px;
}

.dashboard-grid {
  gap: 12px;
}

.metric-card {
  min-height: 105px;
  padding: 15px;
}

.metric-value {
  margin-top: 8px;
}

.dash-card {
  padding: 15px;
}

.donut-wrap {
  min-height: 190px;
  gap: 18px;
}

.donut {
  width: 140px;
  height: 140px;
}

.donut:after {
  inset: 21px;
}

.activity-30 {
  height: 160px;
}

.empty-chart {
  height: 150px;
  display: grid;
  place-items: center;
  color: #6f7c91;
  border: 1px dashed #2d3748;
  border-radius: 10px;
  background: #111720;
}

.storage-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.storage-actions {
  align-items: center;
}

.storage-actions .primary {
  background: #253248;
  border-color: #3a4b67;
}

.storage-actions .primary:hover {
  background: #30405c;
}

.folder-access-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.folder-access-state {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}

.folder-access-state .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d8a351;
}

.folder-access-state.connected .dot {
  background: #59c98c;
}

.folder-menu {
  position: fixed;
  right: 16px;
  top: 58px;
  width: min(360px, calc(100vw - 32px));
  background: #151c27;
  border: 1px solid #344155;
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .38);
  padding: 12px;
  z-index: 9999;
}

.folder-menu h4 {
  margin: 0 0 8px
}

.folder-menu .actions {
  margin-top: 12px;
}

.folder-menu-note {
  color: #8896aa;
  font-size: 11px;
  line-height: 1.5;
}

@media(max-width:900px) {
  .topbar {
    grid-template-columns: auto 1fr;
  }

  .global-tabs {
    grid-column: 1/-1;
    justify-content: center;
  }

  .data-status span:last-child {
    display: none
  }
}

@media(max-width:650px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .brand {
    font-size: 14px
  }

  .topbar .search-wrap {
    grid-column: 1/-1;
    order: 3;
  }

  .global-tabs {
    grid-column: 1/-1;
    overflow: auto;
    justify-content: flex-start;
  }

  .metric-card {
    grid-column: span 12
  }

  .storage-card {
    grid-template-columns: 1fr
  }
}

/* V3.3.1 - Correctif barre supérieure + corbeille */
.topbar {
  box-sizing: border-box;
  min-height: 64px;
  height: auto;
  display: grid !important;
  grid-template-columns: max-content minmax(260px, 1fr) max-content max-content !important;
  grid-template-areas: "brand search tabs actions";
  align-items: center;
  gap: 10px !important;
  padding: 8px 14px !important;
}

.topbar .brand {
  grid-area: brand
}

.topbar .search {
  grid-area: search;
  min-width: 0
}

.topbar .global-tabs {
  grid-area: tabs !important;
  grid-column: auto !important;
  order: initial !important;
  padding-bottom: 0 !important;
  flex-wrap: nowrap;
}

.topbar .top-actions {
  grid-area: actions;
  min-width: max-content;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar .icon-btn,
.topbar .data-status,

@media(max-width:1180px) {
  .topbar {
    grid-template-columns: max-content minmax(220px, 1fr) max-content !important;
    grid-template-areas:
      "brand search actions"
      "tabs tabs tabs";
  }

  .topbar .global-tabs {
    justify-content: center !important;
    padding: 0 !important;
  }
}

@media(max-width:760px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) max-content !important;
    grid-template-areas:
      "brand actions"
      "search search"
      "tabs tabs";
  }

  .topbar .search {
    width: 100%
  }

  .topbar .global-tabs {
    justify-content: flex-start !important;
    overflow-x: auto;
  }

  .trash-clean-btn>span:nth-child(2) {
    display: none
  }

  .data-status span:last-child {
    display: none
  }
}

@media(max-width:480px) {
  .topbar {
    padding: 7px 9px !important;
    gap: 7px !important;
  }

  .topbar .brand {
    font-size: 14px
  }

  .global-tabs button {
    padding: 8px 10px
  }

}

/* V3.3.2 - Navigation arborescence */
.tree-row {
  position: relative;
  z-index: 1;
}

.tree-row * {
  pointer-events: none;
}

.tree-row .tree-actions,
.tree-row .tree-actions * {
  pointer-events: auto;
}

/* V3.4 - Commandes séparées */
:root {
  --command: #ff8f5c
}

.global-tabs button[data-section="command"].active {
  background: var(--command);
  border-color: var(--command);
  color: #1b0d06
}

.section-accent-command .explorer-head {
  border-top: 3px solid var(--command)
}

.section-accent-command .primary {
  background: var(--command);
  border-color: var(--command);
  color: #1b0d06
}

.command-detail {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden
}

.command-detail-body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: start
}

.command-hero {
  background: #0a0f16;
  border: 1px solid #344155;
  border-radius: 14px;
  padding: 17px;
  position: relative
}

.command-hero pre {
  margin: 0;
  padding-right: 110px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #f3f7ff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.55
}

.command-copy {
  position: absolute;
  right: 12px;
  top: 12px
}

.command-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px
}

.command-meta-card {
  background: #111720;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 12px;
  min-width: 0
}

.command-meta-card .label {
  color: #7f8ca2;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 5px
}

.command-meta-card .value {
  color: #e4ebf5;
  white-space: pre-wrap;
  word-break: break-word
}

.command-description-box {
  background: #111720;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 14px;
  line-height: 1.6;
  white-space: pre-wrap
}

.command-edit-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden
}

.command-edit-body {
  min-height: 0;
  overflow: auto;
  padding: 16px 18px;
  display: grid;
  gap: 11px
}

.command-edit-body .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr))
}

.command-editor-area {
  min-height: 150px;
  font-family: Consolas, "Courier New", monospace !important;
  line-height: 1.55
}

.command-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 7px
}

.command-var {
  display: inline-flex;
  padding: 3px 7px;
  border: 1px solid #3b4960;
  border-radius: 7px;
  background: #1a2330;
  color: #9fb7dd;
  font-family: Consolas, monospace;
  font-size: 11px
}

@media(max-width:760px) {
  .command-hero pre {
    padding-right: 0;
    padding-top: 44px
  }

  .command-copy {
    top: 8px;
    right: 8px
  }
}

/* V3.5 - Memo document + Command cheat sheets */
.memo-document {
  height: 100%;
  min-height: 0;
  overflow: auto;
  background: #202631;
  padding: 18px;
}

.memo-paper {
  max-width: 980px;
  margin: 0 auto;
  background: #fff;
  color: #111827;
  min-height: calc(100% - 2px);
  padding: 38px 46px;
  border-radius: 5px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}

.memo-paper h1,
.memo-paper h2,
.memo-paper h3 {
  color: #111827
}

.memo-paper p,
.memo-paper li {
  line-height: 1.65
}

.memo-paper img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px auto;
  border-radius: 7px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .14);
}

.memo-paper table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}

.memo-paper td,
.memo-paper th {
  border: 1px solid #c5ccd7;
  padding: 8px 10px;
  text-align: left;
}

.memo-paper pre {
  overflow: auto;
  background: #f2f5f8;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 12px;
}

.memo-paper code {
  font-family: Consolas, "Courier New", monospace
}

.editor.document-editor img {
  max-width: 100%;
  height: auto;
  margin: 12px auto;
  display: block;
  border-radius: 6px;
}

.memo-editor-help {
  color: #7f8ca2;
  font-size: 11px;
  margin-top: 6px;
}

.command-tech-page {
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.command-tech-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.command-tech-head h2 {
  margin: 0 0 4px
}

.command-sheet {
  display: grid;
  gap: 7px;
}

.command-sheet-row {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(260px, 1.1fr) auto;
  gap: 10px;
  align-items: stretch;
  border: 1px solid var(--line);
  background: #111720;
  border-radius: 10px;
  overflow: hidden;
}

.command-sheet-command {
  padding: 11px 12px;
  background: #0b1017;
  display: flex;
  align-items: center;
}

.command-sheet-command code {
  color: #f0f4fb;
  font-family: Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  font-size: 12px;
}

.command-sheet-desc {
  padding: 11px 12px;
  color: #c3cedd;
  line-height: 1.5;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.command-sheet-desc .ctx {
  margin-top: 5px;
  color: #738198;
  font-size: 10px;
}

.command-sheet-action {
  padding: 9px;
  display: flex;
  align-items: center;
}

.command-sheet-action button {
  min-width: 72px;
}

.command-tech-empty {
  padding: 30px;
  text-align: center;
  color: #758298;
  border: 1px dashed #344155;
  border-radius: 11px;
}

.command-search-local {
  min-width: 220px;
  max-width: 320px;
  width: 32vw;
  background: #0c1016;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
}

.command-sheet-row.hidden {
  display: none !important
}

.search-result .search-snippet {
  color: #7f8da2;
  font-size: 11px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media(max-width:900px) {
  .command-sheet-row {
    grid-template-columns: 1fr auto;
  }

  .command-sheet-desc {
    grid-column: 1/-1;
    border-top: 1px solid var(--line);
  }
}

/* V3.6 - Editeur type Word + suppression tags UI */
.word-editor-shell {
  background: #202631;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.word-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  padding: 8px;
  background: #111720;
  border-bottom: 1px solid #303b4d;
}

.word-toolbar .group {
  display: flex;
  gap: 4px;
  align-items: center;
  padding-right: 7px;
  margin-right: 2px;
  border-right: 1px solid #303b4d;
}

.word-toolbar .group:last-child {
  border-right: 0
}

.word-toolbar button,
.word-toolbar select {
  height: 33px;
  border: 1px solid #344155;
  background: #18202b;
  color: #e5edf8;
  border-radius: 7px;
  padding: 0 9px;
  font-size: 12px;
}

.word-toolbar button:hover,
.word-toolbar select:hover {
  background: #222d3c
}

.word-toolbar input[type=color] {
  width: 32px;
  height: 31px;
  padding: 2px;
  border: 1px solid #344155;
  border-radius: 7px;
  background: #18202b
}

.word-page-wrap {
  overflow: auto;
  min-height: 520px;
  padding: 24px;
  background: #252c37;
}

.word-page {
  width: min(794px, 100%);
  min-height: 1123px;
  margin: 0 auto;
  background: #fff !important;
  color: #111827 !important;
  border: 1px solid #d3d8e0 !important;
  border-radius: 2px !important;
  padding: 54px 60px !important;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .22);
  outline: none !important;
  line-height: 1.5;
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
}

.word-page:focus {
  box-shadow: 0 0 0 2px rgba(110, 148, 255, .20), 0 14px 38px rgba(0, 0, 0, .22);
}

.word-page h1 {
  font-size: 28px;
  margin: 0 0 18px;
  color: #111827
}

.word-page h2 {
  font-size: 22px;
  margin: 24px 0 12px;
  color: #111827
}

.word-page h3 {
  font-size: 18px;
  margin: 20px 0 10px;
  color: #111827
}

.word-page p {
  margin: 0 0 10px
}

.word-page ul,
.word-page ol {
  margin: 8px 0 12px 24px
}

.word-page blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 4px solid #7a9cff;
  background: #f3f6fb;
  color: #344054
}

.word-page pre {
  padding: 12px 14px;
  background: #f2f4f7;
  border: 1px solid #d7dce5;
  border-radius: 7px;
  overflow: auto;
  font-family: Consolas, monospace;
  color: #172033
}

.word-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0
}

.word-page th,
.word-page td {
  border: 1px solid #aeb7c4;
  padding: 7px 9px;
  vertical-align: top
}

.word-page th {
  background: #edf1f6
}

.word-page img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 14px auto;
  border-radius: 4px
}

.word-page img.editor-image-selected {
  outline: 3px solid #6e94ff;
  outline-offset: 2px
}

.word-statusbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: #111720;
  border-top: 1px solid #303b4d;
  color: #7f8da2;
  font-size: 10px
}

.word-editor-shell.fullscreen-editor {
  position: fixed;
  inset: 8px;
  z-index: 100000;
  border-radius: 12px;
  background: #202631;
  display: flex;
  flex-direction: column
}

.word-editor-shell.fullscreen-editor .word-page-wrap {
  flex: 1;
  min-height: 0
}

.word-editor-shell.fullscreen-editor .word-toolbar {
  position: sticky;
  top: 0
}

.word-editor-shell.fullscreen-editor .word-page {
  min-height: calc(100vh - 150px)
}

@media(max-width:850px) {
  .word-page-wrap {
    padding: 10px
  }

  .word-page {
    padding: 30px 24px !important;
    min-height: 900px
  }

  .word-toolbar .group {
    border-right: 0;
    padding-right: 0
  }
}

/* V3.7 - Tree folders + cleaner command UI */
.explorer-pane {
  background: #0f141d;
  border-color: #283243;
}

.explorer-head {
  background: #121923;
  border-bottom-color: #293344;
}

.explorer-tree {
  padding: 8px 6px 12px;
}

.tree-row {
  min-height: 34px;
  border-radius: 8px;
  margin: 1px 0;
  padding-top: 5px;
  padding-bottom: 5px;
  transition: background .12s, border-color .12s;
}

.tree-row:hover {
  background: #171f2b;
}

.tree-row.active {
  background: #202b3a;
  border-color: #34455e;
}

.tree-row.folder-row-active {
  background: #1a2431;
}

.tree-caret {
  width: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  color: #7d8ca3;
  font-size: 10px;
  cursor: pointer;
  transition: transform .12s, color .12s;
  pointer-events: auto !important;
}

.tree-caret:hover {
  color: #d7e2f1;
  background: #253044;
  border-radius: 5px;
}

.tree-caret.empty {
  cursor: default;
  opacity: 0;
}

.tree-icon {
  width: 19px;
  flex: 0 0 19px;
  font-size: 14px;
}

.tree-label {
  font-size: 12.5px;
}

.tree-actions {
  opacity: .25;
}

.tree-row:hover .tree-actions {
  opacity: 1;
}

.tree-children {
  overflow: hidden;
}

.tree-children.collapsed {
  display: none;
}

.command-tech-page {
  padding: 18px 20px;
}

.command-tech-head {
  padding-bottom: 13px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.command-tech-head h2 {
  font-size: 21px;
  margin-bottom: 3px;
}

.command-sheet {
  gap: 5px;
}

.command-sheet-row {
  grid-template-columns: minmax(320px, .95fr) minmax(300px, 1.05fr) 78px;
  min-height: 58px;
  border-radius: 8px;
  background: #121923;
  border-color: #283345;
  transition: border-color .12s, transform .12s, background .12s;
}

.command-sheet-row:hover {
  background: #151e2a;
  border-color: #3d4e68;
  transform: translateY(-1px);
}

.command-sheet-command {
  background: #0b1017;
  padding: 10px 12px;
}

.command-sheet-command code {
  font-size: 12.5px;
  color: #eff4fb;
}

.command-sheet-desc {
  padding: 10px 12px;
}

.command-sheet-desc b {
  font-size: 12px;
  margin-bottom: 3px;
  color: #f0f4fa;
}

.command-sheet-desc span:not(.ctx) {
  color: #aebacd;
}

.command-sheet-desc .ctx {
  color: #708099;
}

.command-sheet-action {
  padding: 7px;
  justify-content: center;
  border-left: 1px solid #283345;
}

.command-sheet-action button {
  min-width: 62px;
  padding: 7px 9px;
  font-size: 11px;
}

.command-search-local {
  width: min(330px, 38vw);
  background: #0b1017;
}

.command-detail-body {
  padding: 16px 18px;
}

.command-meta-grid {
  grid-template-columns: 1fr;
}

.command-meta-card {
  border-radius: 9px;
}

.command-source-list {
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.6;
}

.command-source-list a {
  color: inherit;
  overflow-wrap: anywhere;
}

@media(max-width:900px) {
  .command-sheet-row {
    grid-template-columns: minmax(0, 1fr) 70px;
  }

  .command-sheet-desc {
    grid-column: 1/-1;
  }
}

/* V3.7.1 - Scroll procédures */
.procedure-reader {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.procedure-toc {
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.procedure-body-wrap {
  height: 100%;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.procedure-document {
  min-height: max-content;
}

.detail-pane,
#detailHost {
  min-height: 0;
  overflow: hidden;
}

/* V3.7.2 - Arborescence compacte */
.explorer-tree {
  padding: 4px 5px 8px !important;
}

.tree-row {
  min-height: 28px !important;
  height: auto !important;
  padding-top: 3px !important;
  padding-bottom: 3px !important;
  margin: 0 !important;
  border-radius: 6px !important;
  line-height: 1.15 !important;
}

.tree-label {
  font-size: 12px !important;
  line-height: 1.2 !important;
}

.tree-icon {
  width: 17px !important;
  flex: 0 0 17px !important;
  font-size: 13px !important;
}

.tree-caret {
  width: 15px !important;
  flex: 0 0 15px !important;
  font-size: 9px !important;
}

.tree-actions {
  margin-left: 2px !important;
}

.tree-actions button {
  padding: 0 3px !important;
  min-height: 20px !important;
}

.tree-children {
  margin: 0 !important;
  padding: 0 !important;
}

.tree-row.active {
  min-height: 30px !important;
}

/* V3.7.3 - Commandes : Copier | Commande | Description */
.command-sheet-row {
  display: grid !important;
  grid-template-columns: 82px minmax(320px, .95fr) minmax(280px, 1.05fr) !important;
  align-items: stretch !important;
}

.command-sheet-action {
  grid-column: 1 !important;
  grid-row: 1 !important;
  border-left: 0 !important;
  border-right: 1px solid #283345;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 7px !important;
}

.command-sheet-command {
  grid-column: 2 !important;
  grid-row: 1 !important;
  border-right: 1px solid #283345;
  background: #0b1017 !important;
  padding: 10px 12px !important;
  display: flex !important;
  align-items: center !important;
}

.command-sheet-desc {
  grid-column: 3 !important;
  grid-row: 1 !important;
  padding: 10px 12px !important;
  display: flex !important;
  align-items: center !important;
  color: #c3cedd !important;
  line-height: 1.45 !important;
}

.command-sheet-desc b,
.command-sheet-desc .ctx {
  display: none !important;
}

.command-sheet-action button {
  min-width: 64px !important;
  width: 64px !important;
  padding: 7px 6px !important;
}

@media(max-width:900px) {
  .command-sheet-row {
    grid-template-columns: 72px minmax(0, 1fr) !important;
  }

  .command-sheet-action {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .command-sheet-command {
    grid-column: 2 !important;
    grid-row: 1 !important;
    border-right: 0 !important;
  }

  .command-sheet-desc {
    grid-column: 1/-1 !important;
    grid-row: 2 !important;
    border-top: 1px solid #283345;
  }
}

/* V3.7.5 - Arborescence réellement compacte */
#unifiedTree.explorer-tree {
  display: block !important;
  padding: 4px !important;
  margin: 0 !important;
}

#unifiedTree .tree-children {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: none !important;
}

#unifiedTree .tree-children.collapsed {
  display: none !important;
}

#unifiedTree .tree-row {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  flex: none !important;

  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;

  margin: 0 !important;
  padding-top: 2px !important;
  padding-bottom: 2px !important;

  line-height: 20px !important;
  overflow: hidden !important;
}

#unifiedTree .tree-row.active {
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
}

#unifiedTree .tree-label {
  display: block !important;
  height: 20px !important;
  line-height: 20px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#unifiedTree .tree-icon,
#unifiedTree .tree-caret {
  height: 20px !important;
  line-height: 20px !important;
}

#unifiedTree .tree-actions {
  height: 20px !important;
  display: flex !important;
  align-items: center !important;
}

#unifiedTree .tree-actions button {
  height: 20px !important;
  min-height: 20px !important;
  line-height: 18px !important;
}
