/* TC Workbench, habillage « aujourd'hui ». Police du système du visiteur, icônes à la charte. */

.tcwt {
  --tcwt-ink: #1A1035;
  --tcwt-sub: #5A5470;
  --tcwt-win: #FFFFFF;
  --tcwt-bar: rgba(255, 255, 255, .45);
  --tcwt-glass: rgba(255, 255, 255, .78);
  --tcwt-tile: rgba(255, 255, 255, .78);
  --tcwt-line: #E2E0F0;
  --tcwt-field: #EDEAF8;
  --tcwt-dock: rgba(255, 255, 255, .32);
  --tcwt-accent: #FF5C00;
  --tcwt-accent-t: #CC3D00;
  --tcwt-text: 1;
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--tcwt-ink);
  text-align: left;
  background: linear-gradient(160deg, #1A1035 0%, #4A2DC7 38%, #9070FF 58%, #FF7A2E 86%, #FFD4BB 100%);
}
.tcwt.is-dark {
  --tcwt-ink: #F5F4FB;
  --tcwt-sub: #B8B4CC;
  --tcwt-win: #1E1636;
  --tcwt-bar: rgba(18, 11, 38, .55);
  --tcwt-glass: rgba(30, 22, 58, .78);
  --tcwt-tile: rgba(255, 255, 255, .10);
  --tcwt-line: rgba(255, 255, 255, .12);
  --tcwt-field: rgba(255, 255, 255, .10);
  --tcwt-dock: rgba(30, 22, 58, .55);
  --tcwt-accent-t: #FF8A4D;
  background: linear-gradient(160deg, #0B0618 0%, #1A1035 45%, #3B2470 75%, #7A3A2A 100%);
}
.tcwt *, .tcwt *::before, .tcwt *::after { box-sizing: border-box; }
:where(.tcwt) button { font: inherit; color: inherit; letter-spacing: normal; text-transform: none; }
.tcwt :focus-visible { outline: 3px solid #9070FF; outline-offset: 2px; }
.tcwt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tcwt-crane { position: absolute; right: -6%; bottom: -4%; width: 62%; fill: #FFFFFF; opacity: .14; pointer-events: none; }

/* ---------- Barre de menus ---------- */
.tcwt-menubar { position: absolute; left: 0; right: 0; top: 0; height: 30px; display: flex; align-items: center; gap: 18px; padding: 0 12px; background: var(--tcwt-bar); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); z-index: 5; font-size: 13px; }
.tcwt-logo { display: inline-flex; }
.tcwt-apptitle { font-weight: 700; white-space: nowrap; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; }
.tcwt-menu { white-space: nowrap; }
.tcwt-menuright { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tcwt-mb { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 24px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.tcwt-mb:hover, .tcwt-mb[aria-expanded="true"] { background: rgba(26, 16, 53, .14); }
.tcwt.is-dark .tcwt-mb:hover, .tcwt.is-dark .tcwt-mb[aria-expanded="true"] { background: rgba(255, 255, 255, .18); }
.tcwt-time { padding-left: 6px; font-weight: 500; white-space: nowrap; }

/* ---------- Bureau, widgets ---------- */
.tcwt-desk { position: absolute; inset: 30px 0 0 0; }
.tcwt-widgets { position: absolute; left: 20px; top: 18px; width: 336px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tcwt-w { min-height: 150px; padding: 14px 16px; border-radius: 22px; background: var(--tcwt-glass); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.tcwt-w-wide { grid-column: span 2; }
.tcwt-w-head { display: flex; justify-content: space-between; align-items: center; }
.tcwt-w-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--tcwt-sub); }
.tcwt-w-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #007A5A; }
.tcwt.is-dark .tcwt-w-ok { color: #00E0A8; }
.tcwt-w-ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #00C896; }
.tcwt-w-big { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.15; }
.tcwt-w-btn { align-self: flex-start; display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: 9999px; background: var(--tcwt-accent); color: #FFFFFF !important; text-decoration: none; font-weight: 600; font-size: 13px; }
.tcwt-w-clock { align-items: center; justify-content: center; }
.tcwt-clock { width: 100px; height: 100px; }
.tcwt-clock .f { fill: var(--tcwt-win); }
.tcwt-clock .m path { stroke: var(--tcwt-sub); stroke-width: 2; stroke-linecap: round; }
.tcwt-clock .hh { stroke: var(--tcwt-ink); stroke-width: 4; stroke-linecap: round; }
.tcwt-clock .mm { stroke: var(--tcwt-ink); stroke-width: 3; stroke-linecap: round; }
.tcwt-w-academy { background: linear-gradient(160deg, #22DDB0, #00A87E); color: #0B2E24; }
.tcwt-w-academy .tcwt-w-label { color: #0B2E24; }
.tcwt-w-num { font-size: 52px; font-weight: 900; line-height: .9; }
.tcwt-w-cap { font-weight: 600; font-size: 13px; }
.tcwt-w-title { font-size: 17px; font-weight: 700; line-height: 1.25; color: var(--tcwt-ink) !important; text-decoration: none; }
.tcwt-w-title:hover { text-decoration: underline; }

/* ---------- Fenêtres ---------- */
.tcwt-win { position: absolute; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: var(--tcwt-win); box-shadow: 0 12px 40px rgba(10, 6, 24, .30), 0 0 0 .5px rgba(10, 6, 24, .35); }
.tcwt-win.is-active { box-shadow: 0 22px 70px rgba(10, 6, 24, .45), 0 0 0 .5px rgba(10, 6, 24, .35); }
.tcwt-win.is-zoomed { left: 8px !important; top: 8px !important; width: calc(100% - 16px) !important; height: calc(100% - 100px) !important; }
.tcwt-bar { position: relative; flex: 0 0 44px; display: flex; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--tcwt-line); cursor: default; touch-action: none; user-select: none; }
.tcwt-lights { display: flex; gap: 8px; position: relative; z-index: 1; }
.tcwt-light { width: 13px; height: 13px; padding: 0; border: 0; border-radius: 50%; background: #D4D0ED; cursor: pointer; }
.tcwt-win.is-active .tcwt-l-close { background: #FF5F57; }
.tcwt-win.is-active .tcwt-l-min { background: #FEBC2E; }
.tcwt-win.is-active .tcwt-l-zoom { background: #28C840; }
.tcwt-title { position: absolute; left: 90px; right: 90px; margin: 0; text-align: center; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tcwt-ink); }
.tcwt-back { display: none; }
.tcwt-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 22px 24px; font-size: calc(15px * var(--tcwt-text)); overscroll-behavior: contain; }
.tcwt-body:focus { outline: none; }
.tcwt-foot { flex: 0 0 auto; padding: 10px 20px; border-top: 1px solid var(--tcwt-line); font-size: 13px; }
.tcwt-foot a { color: var(--tcwt-accent-t); font-weight: 600; }
.tcwt-loading { color: var(--tcwt-sub); }
.tcwt-term { background: #120B26; color: #E2E0F0; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: calc(14px * var(--tcwt-text)); line-height: 1.6; }
.tcwt-caret { display: inline-block; width: 8px; height: 16px; vertical-align: middle; background: #FF7A2E; animation: tcwtblink 1s steps(1) infinite; }
@keyframes tcwtblink { 50% { opacity: 0; } }

/* Contenus (pages, listes) */
.tcwt-content { color: var(--tcwt-ink); line-height: 1.6; }
.tcwt-content :where(p, li, td, th, figcaption, blockquote, span, strong, em) { color: inherit; }
.tcwt-content > :first-child { margin-top: 0; }
.tcwt-content :where(h1, h2, h3, h4) { margin: 1.2em 0 .5em; line-height: 1.15; color: var(--tcwt-ink); font-family: inherit; letter-spacing: -.01em; }
.tcwt-content h2 { font-size: 1.6em; } .tcwt-content h3 { font-size: 1.25em; }
.tcwt-content a { color: var(--tcwt-accent-t); }
.tcwt-content img, .tcwt-content video, .tcwt-content iframe { max-width: 100%; height: auto; border-radius: 8px; }
.tcwt-content .tcwb-cover { margin: -22px -24px 18px; }
.tcwt-content .tcwb-cover img { width: 100%; border-radius: 0; }
.tcwt-content .tcwb-meta { color: var(--tcwt-sub); font-size: .9em; }
.tcwt-content .tcwb-sub { color: var(--tcwt-accent-t); font-weight: 600; }
.tcwt-content .tcwb-big { font-size: 1.25em; font-weight: 700; }
.tcwt-content .tcwb-btn, .tcwt-content .wp-block-button__link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 9999px; background: var(--tcwt-accent); color: #FFFFFF; text-decoration: none; font-weight: 600; }
.tcwt-content .tcwb-list { list-style: none; margin: 0; padding: 0; }
.tcwt-content .tcwb-list a { display: flex; flex-direction: column; gap: 2px; padding: 10px 6px; border-bottom: 1px solid var(--tcwt-line); color: var(--tcwt-ink); text-decoration: none; }
.tcwt-content .tcwb-list a:hover { background: var(--tcwt-field); border-radius: 8px; }
.tcwt-content .tcwb-item-title { font-weight: 600; }
.tcwt-content .tcwb-item-text { font-size: .88em; color: var(--tcwt-sub); }
.tcwt-content .tcwb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.tcwt-content .tcwb-grid a { border: 0; padding: 0; gap: 6px; text-align: center; }
.tcwt-content .tcwb-grid a:hover { background: transparent; }
.tcwt-content .tcwb-thumb { display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--tcwt-field); box-shadow: 0 1px 3px rgba(10, 6, 24, .2); }
.tcwt-content .tcwb-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.tcwt-content .tcwb-more { margin-top: 14px; }

/* Recherche */
.tcwt-search input { width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--tcwt-line); background: var(--tcwt-field); color: var(--tcwt-ink); font: inherit; font-size: 17px; }
.tcwt-results { list-style: none; margin: 14px 0 0; padding: 0; }
.tcwt-results a { display: block; padding: 10px 8px; border-radius: 8px; color: var(--tcwt-ink); text-decoration: none; }
.tcwt-results a:hover, .tcwt-results a:focus-visible { background: var(--tcwt-field); }
.tcwt-empty { padding: 10px 8px; color: var(--tcwt-sub); }

/* ---------- Dock ---------- */
.tcwt-grid { display: none; }
.tcwt-dock { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 6px; padding: 6px 8px; border-radius: 22px; background: var(--tcwt-dock); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .35), 0 10px 30px rgba(10, 6, 24, .3); z-index: 4; max-width: calc(100vw - 24px); }
.tcwt-app { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0; border: 0; background: transparent; cursor: pointer; }
.tcwt-tile { width: 52px; height: 52px; border-radius: 23%; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .35), 0 2px 6px rgba(10, 6, 24, .25); transition: transform .18s ease; transform-origin: bottom center; }
.tcwt-dock .tcwt-app-name { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 4px 10px; border-radius: 7px; background: var(--tcwt-glass); color: var(--tcwt-ink); font-size: 13px; box-shadow: 0 4px 14px rgba(10, 6, 24, .25); opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.tcwt-dock .tcwt-app:hover .tcwt-tile, .tcwt-dock .tcwt-app:focus-visible .tcwt-tile { transform: scale(1.3) translateY(-6px); }
.tcwt-dock .tcwt-app:hover .tcwt-app-name, .tcwt-dock .tcwt-app:focus-visible .tcwt-app-name { opacity: 1; }
.tcwt-dock .tcwt-app::after { content: ""; width: 4px; height: 4px; margin-top: 3px; border-radius: 50%; background: transparent; }
.tcwt-dock .tcwt-app.is-running::after { background: var(--tcwt-ink); }
.tcwt-sep { align-self: stretch; width: 1px; margin: 4px; background: rgba(255, 255, 255, .45); }
.tcwt.is-still .tcwt-tile, .tcwt.is-still .tcwt-app-name { transition: none; }
.tcwt.is-still .tcwt-dock .tcwt-app:hover .tcwt-tile { transform: none; }
.tcwt.is-still .tcwt-caret { animation: none; }

/* ---------- Centre de contrôle ---------- */
.tcwt-cc-phone { display: none; }
.tcwt-cc { position: absolute; right: 10px; top: 36px; width: 340px; max-height: calc(100% - 120px); overflow: auto; padding: 12px; border-radius: 20px; background: var(--tcwt-glass); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px); box-shadow: 0 16px 50px rgba(10, 6, 24, .35), 0 0 0 .5px rgba(255, 255, 255, .25); z-index: 6; display: flex; flex-direction: column; gap: 10px; }
.tcwt-cc[hidden] { display: none; }
.tcwt-cc-block { padding: 12px; border-radius: 16px; background: var(--tcwt-tile); border: 0; text-align: left; width: 100%; }
.tcwt-cc-toggles { display: flex; flex-direction: column; gap: 4px; }
.tcwt-toggle { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 4px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; }
.tcwt-toggle:hover { background: var(--tcwt-field); }
.tcwt-round { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tcwt-field); color: var(--tcwt-ink); }
.tcwt-toggle.is-on .tcwt-round { background: var(--tcwt-accent); color: #FFFFFF; }
.tcwt-round.is-green { background: #00C896; color: #FFFFFF; }
.tcwt-tt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tcwt-tt strong { font-size: 13px; }
.tcwt-tt span { font-size: 12px; color: var(--tcwt-sub); }
.tcwt-cc-focus { display: flex; align-items: center; gap: 12px; }
.tcwt-cc-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.tcwt-cc input[type="range"] { width: 100%; accent-color: #FF5C00; }
.tcwt-cc-quick { display: flex; justify-content: space-around; gap: 6px; }
.tcwt-q { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 64px; padding: 4px; border: 0; background: transparent; color: var(--tcwt-ink); font-size: 12px; text-decoration: none; cursor: pointer; }
.tcwt-cc-read { display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.tcwt-cc-read span { font-size: 12px; color: var(--tcwt-sub); }
.tcwt-progress { display: block; height: 4px; border-radius: 9999px; background: var(--tcwt-field); overflow: hidden; }
.tcwt-progress i { display: block; height: 4px; background: var(--tcwt-accent); }
.tcwt-cc-classic { font-weight: 700; text-align: center; cursor: pointer; }

/* ---------- Téléphone : écran d'accueil ---------- */
@media (max-width: 700px) {
  .tcwt-menubar { display: none; }
  .tcwt-desk { inset: 0; overflow-y: auto; padding: calc(max(14px, env(safe-area-inset-top)) + 56px) 20px 140px; }
  .tcwt-crane { width: 140%; right: -40%; bottom: 10%; }
  .tcwt-widgets { position: static; width: auto; gap: 14px; margin-bottom: 26px; }
  .tcwt-w { border-radius: 24px; }
  .tcwt-w-clock { display: none; }
  .tcwt-w-academy { grid-column: span 2; flex-direction: row; align-items: center; min-height: 90px; }
  .tcwt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 8px; }
  .tcwt-grid .tcwt-app { gap: 6px; }
  .tcwt-grid .tcwt-tile { width: 60px; height: 60px; border-radius: 14px; }
  .tcwt-grid .tcwt-app-name { font-size: 12px; color: #FFFFFF; text-shadow: 0 1px 3px rgba(10, 6, 24, .55); max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tcwt-dock { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); transform: none; justify-content: space-around; padding: 12px 10px; border-radius: 30px; }
  .tcwt-dock .tcwt-app:nth-child(n+5) { display: none; }
  .tcwt-dock .tcwt-app-name { display: none; }
  .tcwt-dock .tcwt-sep { display: none; }
  .tcwt-dock .tcwt-tile { width: 60px; height: 60px; border-radius: 14px; }
  .tcwt-dock .tcwt-app:hover .tcwt-tile { transform: none; }
  .tcwt-dock .tcwt-app::after { display: none; }
  .tcwt-cc-phone { display: inline-flex; position: absolute; right: 14px; top: max(14px, env(safe-area-inset-top)); width: 44px; height: 44px; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .28); color: #FFFFFF; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); z-index: 7; }
  .tcwt-cc { left: 12px; right: 12px; top: max(70px, calc(env(safe-area-inset-top) + 56px)); width: auto; max-height: calc(100% - 90px); border-radius: 28px; }
  /* Une appli ouverte occupe tout l'écran, avec grand titre et retour. */
  .tcwt-win { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; box-shadow: none; z-index: 8 !important; }
  .tcwt-bar { flex: 0 0 auto; flex-direction: column; align-items: flex-start; gap: 2px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; border-bottom: 0; }
  .tcwt-lights { display: none; }
  .tcwt-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--tcwt-accent-t); font-size: 17px; cursor: pointer; }
  .tcwt-title { position: static; text-align: left; font-size: 30px; font-weight: 800; letter-spacing: -.02em; white-space: normal; }
  .tcwt-body { padding: 8px 18px max(24px, env(safe-area-inset-bottom)); font-size: calc(16px * var(--tcwt-text)); }
  .tcwt-content .tcwb-cover { margin: -8px -18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .tcwt-tile, .tcwt-app-name { transition: none; }
  .tcwt-caret { animation: none; }
}
