      @import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,900&family=Inter:wght@400;500;600;700;800;900&display=swap');

      :root {
        --wine-900: #3b0d16;
        --wine-800: #55101f;
        --wine-700: #74182a;
        --wine-600: #8c2438;
        --wine-100: #f3d8de;
        --paper: #f8f1e8;
        --paper-2: #fffaf4;
        --ink: #2b2020;
        --muted: #765f5f;
        --olive: #647447;
        --sea: #2f6f73;
        --gold: #c99a3d;
        --gold-soft: #ecd6a2;
        --gold-line: rgba(201, 154, 61, 0.45);
        --line: rgba(116, 24, 42, 0.14);
        --line-soft: rgba(59, 13, 22, 0.08);
        --shadow-soft: 0 1px 2px rgba(59, 13, 22, 0.06), 0 4px 12px rgba(59, 13, 22, 0.06);
        --shadow: 0 2px 4px rgba(59, 13, 22, 0.06), 0 12px 30px rgba(59, 13, 22, 0.1);
        --shadow-lift: 0 6px 12px rgba(59, 13, 22, 0.08), 0 26px 52px rgba(59, 13, 22, 0.18);
        --radius: 10px;
        --ease-premium: cubic-bezier(0.19, 1, 0.22, 1);
        --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
        --font-display: "Fraunces", Georgia, "Times New Roman", serif;
      }

      * { box-sizing: border-box; }
      html { scroll-behavior: smooth; }
      .button-help-tooltip {
        position: fixed;
        z-index: 100000;
        max-width: min(340px, calc(100vw - 24px));
        padding: 10px 13px;
        border: 1px solid rgba(255,255,255,.2);
        border-radius: 8px;
        background: #2b2020;
        color: #fff;
        box-shadow: 0 10px 30px rgba(0,0,0,.25);
        font-size: 14px;
        line-height: 1.35;
        pointer-events: none;
      }
      .button-help-tooltip[hidden] { display: none; }
      .search-hero #globalSearch { width:100%; margin-top:16px; padding:16px 18px; border:2px solid var(--line); border-radius:12px; font-size:18px; }
      .search-hero #globalSearch:focus { border-color:var(--wine-700); outline:3px solid rgba(116,24,42,.12); }
      .search-results { margin-top:18px; }
      .search-summary { display:flex; gap:8px; align-items:baseline; margin:0 0 12px; color:var(--muted); }
      .search-summary strong { color:var(--wine-900); font-size:18px; }
      .search-result-list { display:grid; gap:10px; }
      .search-result-card { overflow:hidden; border:1px solid var(--line); border-radius:12px; background:white; box-shadow:var(--shadow); }
      .search-result-card button { display:grid; grid-template-columns:auto minmax(0,1fr); gap:4px 12px; width:100%; border:0; padding:15px 17px; background:transparent; color:var(--ink); text-align:left; cursor:pointer; }
      .search-result-card button:hover { background:#fff8f2; }
      .search-result-type { grid-row:1 / span 3; align-self:start; min-width:76px; border-radius:999px; padding:5px 8px; background:var(--wine-100); color:var(--wine-800); font-size:11px; font-weight:900; text-align:center; text-transform:uppercase; }
      .search-result-card strong { color:var(--wine-900); font-size:18px; }
      .search-result-card small { overflow:hidden; color:var(--muted); text-overflow:ellipsis; white-space:nowrap; }
      .search-result-card p { margin:5px 0 0; color:var(--ink); }
      .search-empty { display:grid; place-items:center; gap:6px; min-height:180px; border:1px dashed var(--line); border-radius:12px; background:rgba(255,255,255,.55); color:var(--muted); text-align:center; }
      .search-empty strong { color:var(--wine-900); font-size:20px; }
      body {
        position: relative;
        margin: 0;
        min-height: 100vh;
        color: var(--ink);
        background:
          radial-gradient(1200px 600px at 100% -5%, rgba(201, 154, 61, 0.1), transparent 55%),
          radial-gradient(900px 500px at -5% 0%, rgba(116, 24, 42, 0.08), transparent 50%),
          linear-gradient(180deg, #fbf6ef, var(--paper));
        background-attachment: fixed;
        font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      }


      body.saving-workspace::after {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        z-index: 99999;
        background: linear-gradient(90deg, var(--gold), var(--wine-700), var(--gold-soft), var(--wine-700), var(--gold));
        background-size: 200% 100%;
        animation: loadingBar 1.1s linear infinite;
        pointer-events: none;
      }

      @keyframes loadingBar {
        from { background-position: 0% 0; }
        to { background-position: -200% 0; }
      }

      ::selection { background: var(--gold-soft); color: var(--wine-900); }

      ::-webkit-scrollbar { width: 11px; height: 11px; }
      ::-webkit-scrollbar-track { background: transparent; }
      ::-webkit-scrollbar-thumb {
        border: 3px solid transparent;
        border-radius: 999px;
        background-color: rgba(116, 24, 42, 0.28);
        background-clip: padding-box;
      }
      ::-webkit-scrollbar-thumb:hover { background-color: rgba(116, 24, 42, 0.48); }
      * { scrollbar-color: rgba(116, 24, 42, 0.28) transparent; scrollbar-width: thin; }

      button, input, textarea, select { font: inherit; }
      button { cursor: pointer; transition: transform 0.18s var(--ease-spring), box-shadow 0.22s var(--ease-premium), background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
      a { color: inherit; text-decoration: none; }
      [hidden] { display: none !important; }

      :focus-visible {
        outline: 2px solid var(--gold);
        outline-offset: 2px;
        border-radius: 4px;
      }

      @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
          animation-duration: 0.001ms !important;
          animation-iteration-count: 1 !important;
          transition-duration: 0.001ms !important;
          scroll-behavior: auto !important;
        }
      }

      h1, h2 {
        font-family: var(--font-display);
        font-weight: 600;
        letter-spacing: -0.01em;
      }

      .tour-panel h3, .board-resource h3 { font-family: var(--font-display); font-weight: 600; }

      .login {
        min-height: 100vh;
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
      }

      .login-hero {
        position: relative;
        display: flex;
        align-items: end;
        min-height: 100vh;
        padding: 56px;
        overflow: hidden;
        color: white;
        background:
          linear-gradient(180deg, rgba(59, 13, 22, 0.12), rgba(59, 13, 22, 0.86)),
          url("https://images.unsplash.com/photo-1523906834658-6e24ef2386f9?auto=format&fit=crop&w=1600&q=80") center/cover;
        animation: heroKenBurns 26s ease-in-out infinite alternate;
      }

      .login-hero::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
        pointer-events: none;
        background-image:
          radial-gradient(3px 3px at 12% 22%, rgba(236, 214, 162, 0.85), transparent 60%),
          radial-gradient(2px 2px at 28% 68%, rgba(236, 214, 162, 0.6), transparent 60%),
          radial-gradient(3px 3px at 46% 38%, rgba(255, 255, 255, 0.55), transparent 60%),
          radial-gradient(2px 2px at 63% 78%, rgba(236, 214, 162, 0.7), transparent 60%),
          radial-gradient(2.5px 2.5px at 78% 18%, rgba(255, 255, 255, 0.5), transparent 60%),
          radial-gradient(2px 2px at 91% 58%, rgba(236, 214, 162, 0.65), transparent 60%);
        background-repeat: no-repeat;
        animation: heroParticles 16s ease-in-out infinite;
      }

      .login-hero::after {
        content: "";
        position: absolute;
        left: 56px;
        right: 56px;
        bottom: 0;
        height: 1px;
        z-index: 1;
        background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
        opacity: 0.6;
      }

      @keyframes heroKenBurns {
        from { background-size: 100% auto, 108% auto; background-position: center, center; }
        to { background-size: 100% auto, 118% auto; background-position: center, 42% 38%; }
      }

      @keyframes heroParticles {
        0%, 100% { transform: translateY(0) translateZ(0); opacity: 0.9; }
        50% { transform: translateY(-22px) translateZ(0); opacity: 1; }
      }

      .login-hero > div { position: relative; z-index: 2; }

      .login-hero h1 {
        margin: 0;
        max-width: 780px;
        font-family: var(--font-display);
        font-weight: 600;
        font-size: clamp(48px, 7vw, 96px);
        line-height: 0.95;
        background: linear-gradient(100deg, #ffffff 30%, var(--gold-soft) 50%, #ffffff 70%);
        background-size: 240% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        animation: heroShimmer 9s ease-in-out infinite;
        text-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
      }

      @keyframes heroShimmer {
        0%, 100% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
      }

      .login-hero p {
        margin: 18px 0 0;
        max-width: 620px;
        color: rgba(255, 255, 255, 0.78);
        font-size: 22px;
      }

      .login-panel {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 14px;
        padding: 32px;
      }

      .login-card {
        width: min(100%, 440px);
        border: 1px solid var(--line);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.82);
        backdrop-filter: blur(18px) saturate(160%);
        padding: 28px;
        box-shadow: var(--shadow-lift);
        animation: cardRiseIn 0.7s var(--ease-premium) both;
        transition: transform 0.35s var(--ease-premium), box-shadow 0.35s var(--ease-premium);
      }

      .login-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 40px 80px rgba(59, 13, 22, 0.24);
      }

      @keyframes cardRiseIn {
        from { opacity: 0; transform: translateY(26px) scale(0.98); }
        to { opacity: 1; transform: translateY(0) scale(1); }
      }

      .contact-card {
        width: min(100%, 440px);
        display: grid;
        gap: 8px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: rgba(255, 255, 255, 0.62);
        backdrop-filter: blur(10px);
        padding: 10px 12px;
        color: var(--ink);
        animation: cardRiseIn 0.7s var(--ease-premium) 0.1s both;
      }

      .contact-card button {
        border: 0;
        border-radius: var(--radius);
        background: transparent;
        color: inherit;
        padding: 0;
        text-align: left;
      }

      .contact-card button:hover { background: rgba(116, 24, 42, 0.06); }

      .contact-card span {
        display: block;
        color: var(--muted);
        font-size: 11px;
        font-weight: 900;
        text-transform: uppercase;
      }

      .contact-card strong {
        display: block;
        margin-top: 4px;
        color: #031225;
        font-size: 14px;
        word-break: break-word;
      }

      .forgot-link {
        justify-self: end;
        margin-top: -4px;
        color: var(--wine-700);
        font-size: 13px;
        font-weight: 850;
      }

      .forgot-link:hover { text-decoration: underline; }
      .local-login-hint {
        margin: 0;
        border: 1px solid rgba(116, 24, 42, .18);
        border-radius: var(--radius);
        background: #f8f1e8;
        color: var(--wine-700);
        padding: 10px 12px;
        font-size: 13px;
      }

      .brand-row {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 24px;
      }

      .brand-mark {
        display: grid;
        place-items: center;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: linear-gradient(145deg, var(--wine-600), var(--wine-900));
        color: white;
        font-weight: 900;
        box-shadow: 0 10px 22px rgba(59, 13, 22, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
        transform-style: preserve-3d;
        perspective: 300px;
        transition: transform 0.5s var(--ease-spring), box-shadow 0.3s ease;
      }

      .brand-mark:hover {
        transform: rotateY(180deg);
        box-shadow: 0 14px 28px rgba(59, 13, 22, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
      }

      .label {
        display: grid;
        gap: 7px;
        color: rgba(43, 32, 32, 0.75);
        font-size: 13px;
        font-weight: 750;
      }

      input, textarea, select {
        width: 100%;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: white;
        color: var(--ink);
        padding: 11px 12px;
        outline: 2px solid transparent;
      }

      textarea { min-height: 98px; resize: vertical; }
      input:focus, textarea:focus, select:focus { outline-color: var(--wine-700); }

      .app {
        display: grid;
        min-height: 100vh;
        grid-template-columns: 280px minmax(0, 1fr);
      }

      .sidebar {
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: column;
        gap: 0;
        height: 100vh;
        padding: 16px;
        overflow: auto;
        background:
          radial-gradient(120% 60% at 0% 0%, rgba(201, 154, 61, 0.16), transparent 55%),
          linear-gradient(165deg, #4a111d 0%, var(--wine-900) 45%, #2a0a10 100%);
        color: white;
        box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05), 8px 0 32px -12px rgba(0, 0, 0, 0.4);
      }

      .sidebar-brand {
        border-radius: 12px;
        background: linear-gradient(155deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
        border: 1px solid rgba(255, 255, 255, 0.1);
        padding: 16px;
        margin-bottom: 18px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
      }

      .sidebar-brand strong {
        display: block;
        margin-top: 5px;
        font-family: var(--font-display);
        font-weight: 600;
        font-size: 24px;
        line-height: 1;
        background: linear-gradient(100deg, white, var(--gold-soft));
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
      }

      .nav-button {
        position: relative;
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        border: 0;
        border-radius: var(--radius);
        background: transparent;
        color: rgba(255, 255, 255, 0.76);
        padding: 11px 12px 11px 16px;
        font-weight: 650;
        text-align: left;
        transition: background 0.18s ease, color 0.18s ease;
      }

      .nav-button::before {
        content: "";
        position: absolute;
        left: 0;
        top: 50%;
        width: 3px;
        height: 0;
        border-radius: 999px;
        background: linear-gradient(180deg, var(--gold), var(--gold-soft));
        transform: translateY(-50%);
        transition: height 0.22s var(--ease-spring);
      }

      .nav-button:hover {
        background: rgba(255, 255, 255, 0.08);
        color: white;
      }

      .nav-button.active {
        background: white;
        color: var(--wine-900);
      }

      .nav-button.active::before { height: 60%; }
      .external-nav::after { content: "↗"; float: right; opacity: .65; }

      .sidebar-mail {
        display: grid;
        gap: 8px;
        margin-top: auto;
        width: 100%;
        border: 0;
        border-radius: var(--radius);
        background: transparent;
        color: rgba(255, 255, 255, 0.78);
        padding: 10px 12px;
        text-align: left;
      }

      .sidebar-mail:hover { background: rgba(255, 255, 255, 0.08); }

      .sidebar-mail button {
        border: 0;
        border-radius: var(--radius);
        background: transparent;
        color: inherit;
        padding: 0;
        text-align: left;
      }

      .sidebar-mail button:hover { background: rgba(255, 255, 255, 0.08); }

      .sidebar-site-link {
        display: block;
        margin-bottom: 8px;
        color: rgba(255, 255, 255, 0.82);
        font-size: 13px;
        font-weight: 900;
      }

      .sidebar-site-link:hover { color: white; }

      .sidebar-mail span {
        display: block;
        color: rgba(255, 255, 255, 0.5);
        font-size: 11px;
        font-weight: 900;
        text-transform: uppercase;
      }

      .sidebar-mail strong {
        display: block;
        margin-top: 6px;
        color: rgba(255, 255, 255, 0.86);
        font-size: 13px;
        word-break: break-word;
      }

      .example-ad {
        display: grid;
        gap: 8px;
        margin-top: auto;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: var(--radius);
        background: rgba(255, 255, 255, 0.08);
        padding: 10px;
        color: rgba(255, 255, 255, 0.82);
      }

      .example-ad-title {
        color: white;
        font-size: 13px;
        font-weight: 900;
      }

      .example-ad button {
        width: 100%;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: var(--radius);
        background: rgba(255, 255, 255, 0.06);
        color: inherit;
        padding: 9px;
        text-align: left;
      }

      .example-ad button:hover { background: rgba(255, 255, 255, 0.12); }

      .example-ad span {
        display: block;
        color: rgba(255, 255, 255, 0.5);
        font-size: 11px;
        font-weight: 900;
        text-transform: uppercase;
      }

      .example-ad strong {
        display: block;
        margin-top: 5px;
        color: rgba(255, 255, 255, 0.9);
        font-size: 13px;
        word-break: break-word;
      }

      .tour-highlight {
        position: fixed;
        z-index: 95;
        border: 3px solid #f7c948;
        border-radius: 12px;
        box-shadow: 0 0 0 9999px rgba(20, 8, 12, 0.58), 0 18px 50px rgba(0, 0, 0, 0.25);
        pointer-events: none;
        transition: all 0.2s ease;
      }

      .tour-panel {
        position: fixed;
        z-index: 96;
        width: min(360px, calc(100vw - 32px));
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--paper-2);
        color: var(--ink);
        padding: 16px;
        box-shadow: var(--shadow);
      }

      .tour-panel h3 {
        margin: 0 0 8px;
        color: var(--wine-900);
        font-size: 22px;
      }

      .tour-panel p { margin: 0; color: var(--muted); }

      .tour-step-count {
        display: inline-block;
        margin-bottom: 10px;
        color: var(--wine-700);
        font-size: 12px;
        font-weight: 900;
        text-transform: uppercase;
      }

      .content {
        min-width: 0;
      }

      .topbar {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        border-bottom: 1px solid var(--line);
        background: rgba(251, 246, 239, 0.82);
        backdrop-filter: blur(16px) saturate(150%);
        padding: 16px 22px;
        box-shadow: 0 10px 30px -22px rgba(59, 13, 22, 0.5);
      }

      .topbar h1 {
        margin: 0;
        color: var(--wine-900);
        font-size: 28px;
      }

      .topbar p { margin: 3px 0 0; color: var(--muted); }

      .main {
        padding: 22px;
      }

      .hero {
        position: relative;
        overflow: hidden;
        border-radius: 16px;
        background:
          radial-gradient(120% 140% at 100% 0%, rgba(201, 154, 61, 0.32), transparent 45%),
          linear-gradient(135deg, var(--wine-900), var(--wine-700));
        color: white;
        padding: 28px 30px;
        box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
      }

      .hero::after {
        content: "";
        position: absolute;
        top: -70%;
        right: -8%;
        width: 55%;
        height: 240%;
        background: linear-gradient(100deg, transparent 42%, rgba(255, 255, 255, 0.1) 50%, transparent 58%);
        transform: rotate(9deg);
        pointer-events: none;
      }

      .hero h2 {
        position: relative;
        margin: 4px 0 0;
        font-family: var(--font-display);
        font-weight: 600;
        font-size: clamp(36px, 5vw, 62px);
        line-height: 0.98;
      }

      .hero p { position: relative; max-width: 760px; color: rgba(255,255,255,.76); }

      .grid { display: grid; gap: 16px; }
      .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .grid.side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
      .tools-grid { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(280px, 360px) minmax(260px, 320px); gap: 16px; align-items: start; }
      .page-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
      .dashboard-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 18px; perspective: 1000px; }
      .shortcut-card {
        display: grid;
        gap: 4px;
        border: 1px solid var(--line);
        border-left: 4px solid var(--sea);
        border-radius: 12px;
        background: linear-gradient(180deg, #ffffff, #fdfaf6);
        padding: 15px 17px;
        box-shadow: var(--shadow-soft);
        transition: transform 0.24s var(--ease-premium), border-color 0.24s ease, box-shadow 0.24s var(--ease-premium);
      }
      .shortcut-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lift);
        border-left-color: var(--gold);
      }
      .shortcut-card span { color: var(--sea); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
      .shortcut-card strong { color: var(--wine-900); font-size: 19px; font-weight: 700; }
      .shortcut-card small { color: var(--muted); }
      .upcoming-courses-card { align-content:start; }
      .upcoming-course-list { display:grid; gap:6px; margin-top:5px; }
      .upcoming-course-list button { display:grid; grid-template-columns:48px minmax(0,1fr); gap:1px 8px; border:0; border-radius:8px; background:#f7eee8; padding:7px 9px; color:var(--wine-900); text-align:left; cursor:pointer; }
      .upcoming-course-list button:hover { background:#f1dfd4; box-shadow:inset 3px 0 var(--gold); }
      .upcoming-course-list button b { grid-row:1 / span 2; align-self:center; color:var(--wine-700); }
      .upcoming-course-list button span { overflow:hidden; color:var(--wine-900); font-size:12px; font-weight:850; letter-spacing:normal; text-overflow:ellipsis; text-transform:none; white-space:nowrap; }
      .upcoming-course-list button small { font-size:10px; }
      .page-grid, .grid.two, .grid.three { perspective: 1100px; }
      .entity-card {
        min-height: 190px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        border-top: 3px solid var(--wine-700);
        transition: transform .26s var(--ease-premium), border-color .26s ease, box-shadow .26s var(--ease-premium);
      }
      .card.entity-card:hover {
        transform: translateY(-5px) rotateX(2.5deg);
        border-color: var(--olive);
        box-shadow: var(--shadow-lift);
      }
      .page-head {
        margin-bottom: 16px;
        border-radius: 14px;
        background: linear-gradient(180deg, #ffffff, #fffcf8);
        border: 1px solid var(--line);
        border-left: 4px solid var(--gold);
        padding: 20px 22px;
        box-shadow: var(--shadow-soft);
      }
      .lesson-pptx-drop { transition:border-color .2s ease,background .2s ease,box-shadow .2s ease; }
      .lesson-pptx-drop.drop-target { border-color:#187b70; background:#eefbf8; box-shadow:0 0 0 6px rgba(24,123,112,.14),var(--shadow-soft); }
      .pptx-drop-hint { width:100%; margin-top:12px; border:2px dashed #b9d6d1; border-radius:10px; background:#f4fbfa; padding:10px 14px; color:#176d65; font-size:12px; font-weight:800; text-align:center; }
      .breadcrumb {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 10px;
        color: var(--muted);
        font-size: 13px;
        font-weight: 750;
      }
      .breadcrumb button {
        border: 0;
        background: transparent;
        color: var(--wine-700);
        padding: 0;
        font-weight: 850;
        cursor: pointer;
        text-decoration: underline;
        text-underline-offset: 3px;
      }
      .list-table {
        display: grid;
        gap: 10px;
      }
      .list-table { gap: 8px; }
      .list-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 14px;
        align-items: center;
        border: 1px solid var(--line-soft);
        border-radius: var(--radius);
        background: white;
        padding: 12px 14px;
        transition: border-color 0.18s ease, background 0.18s ease;
      }
      .list-row:hover { border-color: var(--line); background: var(--paper-2); }
      .activity-card {
        min-width: 0;
        box-shadow: none;
      }
      .activity-card-body {
        display: grid;
        gap: 18px;
      }
      .activity-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
        gap: 10px;
        align-items: stretch;
      }
      .activity-actions .btn {
        width: 100%;
        min-height: 48px;
        padding-inline: 10px;
        text-align: center;
        white-space: normal;
      }
      .activity-actions .btn.icon {
        min-width: 0;
      }

      .card {
        border: 1px solid var(--line);
        border-radius: 12px;
        background: linear-gradient(180deg, #ffffff, #fefbf7);
        padding: 16px;
        box-shadow: var(--shadow-soft);
        transition: box-shadow 0.24s var(--ease-premium), transform 0.24s var(--ease-premium);
      }

      .card:hover { box-shadow: var(--shadow); }
      .activity-card, .activity-card:hover { box-shadow: none; }

      .card h3, .card h2 { margin: 0; color: var(--wine-900); font-family: var(--font-display); font-weight: 600; }
      .muted { color: var(--muted); }
      .small { font-size: 13px; }
      .stack { display: grid; gap: 12px; }
      .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
      .wrap { flex-wrap: wrap; }
      .sequence-hook-control { display: inline-flex; align-items: stretch; gap: 5px; }
      .sequence-hook-document { border-color: rgba(116, 24, 42, .2); background: linear-gradient(180deg, #fffdf8, #f8eee4); }
      .sequence-hook-document.empty { border-style: dashed; color: var(--muted); cursor: pointer; }
      .sequence-hook-document[aria-disabled="true"] { cursor: default; opacity: .72; }
      .sequence-hook-replace {
        display: grid;
        place-items: center;
        width: 36px;
        min-height: 36px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: white;
        color: var(--wine-700);
        font-size: 18px;
        font-weight: 900;
        cursor: pointer;
      }
      .sequence-hook-replace:hover { border-color: var(--wine-700); background: var(--paper-2); }

      .btn {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: linear-gradient(180deg, #ffffff, #fbf5ef);
        color: var(--wine-700);
        padding: 10px 14px;
        font-weight: 750;
        line-height: 1.15;
        box-shadow: 0 1px 2px rgba(59, 13, 22, 0.06);
        transition: transform 0.18s var(--ease-premium), background 0.18s ease, border-color 0.18s ease, box-shadow 0.22s var(--ease-premium), color 0.18s ease;
      }

      .btn::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.5) 48%, transparent 66%);
        background-size: 220% 100%;
        background-position: 150% 0;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
      }

      .btn:hover {
        transform: translateY(-1px);
        border-color: var(--wine-700);
        box-shadow: var(--shadow-soft);
      }

      .btn:hover::after { opacity: 1; animation: btnShine 0.85s var(--ease-premium); }

      @keyframes btnShine {
        from { background-position: 150% 0; }
        to { background-position: -50% 0; }
      }

      .btn:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(59, 13, 22, 0.14) inset; }

      .btn.primary {
        border-color: var(--wine-800);
        background: linear-gradient(160deg, var(--wine-600), var(--wine-800));
        color: white;
        box-shadow: 0 2px 5px rgba(59, 13, 22, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
      }

      .btn.primary:hover {
        box-shadow: 0 8px 20px rgba(59, 13, 22, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.22);
      }

      .btn.danger {
        border-color: #c33;
        background: #fff5f5;
        color: #a11;
      }

      .btn.soft { background: var(--paper); }
      .btn.icon { width: 40px; height: 40px; padding: 0; }
      .btn[aria-busy="true"] { cursor: wait; opacity: .88; }
      .button-spinner,
      .save-spinner {
        display: inline-block;
        width: 1em;
        height: 1em;
        border: 2px solid currentColor;
        border-right-color: transparent;
        border-radius: 50%;
        animation: save-spin .7s linear infinite;
        vertical-align: -.14em;
      }
      .save-blocker {
        position: fixed;
        inset: 0;
        z-index: 10000;
        display: grid;
        place-items: center;
        cursor: wait;
        background: rgba(45, 10, 18, .34);
        backdrop-filter: blur(2px);
      }
      .save-blocker[hidden] { display: none; }
      .save-blocker-card {
        display: grid;
        justify-items: center;
        gap: 10px;
        min-width: min(340px, calc(100vw - 32px));
        padding: 26px;
        border: 1px solid var(--line);
        border-radius: 18px;
        color: var(--wine-900);
        background: var(--paper);
        box-shadow: 0 24px 70px rgba(35, 4, 12, .28);
        animation: cardRiseIn 0.3s var(--ease-spring) both;
      }
      .save-blocker-card .save-spinner { width: 28px; height: 28px; border-width: 3px; }
      .save-blocker-card span:last-child { color: var(--muted); font-size: 14px; }
      @keyframes save-spin { to { transform: rotate(360deg); } }
      .activity-actions .btn.icon {
        width: 100%;
        height: auto;
        min-height: 48px;
      }
      .pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        border-radius: 999px;
        background: var(--paper);
        color: var(--wine-700);
        padding: 7px 10px;
        font-size: 12px;
        font-weight: 800;
      }
      .wheel {
        display: grid;
        place-items: center;
        min-height: 280px;
        border-radius: 50%;
        aspect-ratio: 1;
        width: min(100%, 360px);
        margin: 0 auto;
        border: 10px solid var(--wine-700);
        background:
          conic-gradient(from 0deg, #fff7ec, #f3d8de, #ffffff, #e9f0df, #fff7ec);
        box-shadow: var(--shadow), 0 0 0 6px rgba(201, 154, 61, 0.18);
        transform: perspective(1000px) rotateX(14deg) rotateZ(0deg);
        transition: transform 1.4s cubic-bezier(.2,.8,.2,1), box-shadow 0.4s ease;
        transform-style: preserve-3d;
      }
      .wheel.spinning {
        transform: perspective(1000px) rotateX(14deg) rotateZ(1080deg);
        box-shadow: var(--shadow-lift), 0 0 0 10px rgba(201, 154, 61, 0.4), 0 0 60px rgba(201, 154, 61, 0.35);
      }
      .wheel-result {
        display: grid;
        gap: 9px;
        max-width: 82%;
        border-radius: var(--radius);
        background: rgba(255,255,255,.9);
        color: var(--wine-900);
        padding: 18px;
        text-align: center;
        font-size: clamp(28px, 4vw, 48px);
        font-weight: 900;
        box-shadow: 0 10px 25px rgba(59, 13, 22, 0.12);
      }
      .wheel-result strong { color: var(--wine-900); font-size: clamp(26px, 3vw, 43px); line-height: 1; }
      .wheel-help { color: var(--muted); font-size: 12px; font-weight: 750; line-height: 1.35; }
      .tool-directory { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.72); padding: 20px; box-shadow: 0 10px 28px rgba(59,13,22,.07); }
      .tool-directory-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
      .tool-directory-head p, .tool-directory-head h2 { margin: 0; }
      .tool-directory-head > div > p { color: var(--wine-700); font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
      .tool-directory-head h2 { margin-top: 4px; color: var(--wine-900); font-size: 30px; }
      .tool-link-group + .tool-link-group { margin-top: 20px; }
      .tool-link-group h3 { margin: 0 0 10px; color: var(--wine-800); font-size: 17px; }
      .tool-link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; perspective: 1200px; }
      .tool-link-card { display: grid; gap: 7px; min-height: 132px; border: 1px solid var(--line); border-radius: var(--radius); background: white; padding: 14px; transition: transform 0.28s var(--ease-premium), box-shadow 0.28s var(--ease-premium), border-color 0.28s ease; will-change: transform; }
      .tool-link-card:hover { border-color: var(--sea); transform: translateY(-3px) rotateX(3deg) rotateY(-2deg); box-shadow: 0 18px 34px rgba(47,111,115,.18); }
      .tool-link-card strong { color: var(--wine-900); font-size: 18px; }
      .tool-link-card span { color: var(--muted); font-size: 13px; line-height: 1.4; }
      .tool-link-card small { align-self: end; color: var(--sea); font-weight: 850; }
      .history-list {
        display: grid;
        gap: 8px;
        max-height: 340px;
        overflow: auto;
      }

      .tree-list { display: grid; gap: 12px; }
      .tree-item {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: rgba(248, 241, 232, 0.5);
        padding: 12px;
      }
      .tree-child {
        margin-top: 10px;
        margin-left: 14px;
        padding-left: 14px;
        border-left: 1px solid var(--line);
        display: grid;
        gap: 9px;
      }

      .resource-preview img,
      .board-resource img {
        max-width: 100%;
        border-radius: var(--radius);
        object-fit: contain;
      }

      .resource-preview iframe,
      .board-resource iframe {
        width: 100%;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: white;
      }

      .modal {
        position: fixed;
        inset: 0;
        z-index: 50;
        background: rgba(43, 32, 32, 0.4);
        backdrop-filter: blur(6px);
        animation: modalFadeIn 0.28s var(--ease-premium) both;
      }

      @keyframes modalFadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
      }

      .drawer {
        position: absolute;
        inset-block: 0;
        right: 0;
        width: min(720px, 100%);
        overflow: auto;
        background: var(--paper-2);
        box-shadow: -25px 0 50px rgba(0,0,0,.18);
        animation: drawerSlideIn 0.38s var(--ease-premium) both;
      }

      @keyframes drawerSlideIn {
        from { opacity: 0; transform: translateX(32px); }
        to { opacity: 1; transform: translateX(0); }
      }

      .drawer-head {
        position: sticky;
        top: 0;
        z-index: 2;
        display: flex;
        justify-content: space-between;
        gap: 16px;
        border-bottom: 1px solid var(--line);
        background: var(--paper);
        padding: 18px;
      }

      .drawer-body { padding: 18px; display: grid; gap: 14px; }
      .password-form { align-content: start; gap: 16px; }
      .security-callout { display: grid; gap: 5px; border: 1px solid #dfc8b5; border-radius: var(--radius); background: #fff8ed; padding: 15px 16px; }
      .security-callout strong { color: var(--wine-900); }
      .security-callout span, .password-guidance { color: var(--muted); font-size: 13px; line-height: 1.5; }
      .password-field { gap: 7px; }
      .password-input { position: relative; display: block; }
      .password-input input { width: 100%; padding-right: 86px; }
      .password-toggle { position: absolute; top: 50%; right: 9px; transform: translateY(-50%); border: 0; background: transparent; color: var(--wine-700); padding: 6px; font-size: 12px; font-weight: 850; cursor: pointer; }
      .password-strength { height: 6px; overflow: hidden; border-radius: 999px; background: #eadfd7; }
      .password-strength span { display: block; width: 0; height: 100%; border-radius: inherit; background: #b33a3a; transition: width .2s ease, background .2s ease; }
      .password-strength span[data-score="3"] { background: #c18118; }
      .password-strength span[data-score="4"], .password-strength span[data-score="5"] { background: #29845a; }
      .password-guidance { margin: -9px 0 0; }
      .form-error { margin: 0; border-left: 3px solid #a11; border-radius: 4px; background: #fff0f0; color: #8b1515; padding: 10px 12px; font-size: 13px; }
      .form-actions { justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 16px; }
      .form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .form-grid .wide { grid-column: 1 / -1; }

      .subtree-dialog {
        position: absolute;
        inset: 34px;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        overflow: hidden;
        border-radius: var(--radius);
        background: var(--paper-2);
        box-shadow: var(--shadow-lift);
        animation: cardRiseIn 0.32s var(--ease-premium) both;
      }
      .subtree-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        border-bottom: 1px solid var(--line);
        background: var(--paper);
        padding: 16px 20px;
      }
      .subtree-head p { margin: 0 0 4px; color: var(--wine-700); font-weight: 850; }
      .subtree-head h2 { margin: 0; color: var(--wine-900); }
      .subtree-body { min-height: 0; padding: 24px; }
      .subtree-course-tree { width: 100%; }

      .studio {
        position: fixed;
        inset: 0;
        z-index: 70;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        background: #efe7dd;
        color: var(--ink);
        animation: modalFadeIn 0.3s var(--ease-premium) both;
      }
      .studio-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: center;
        gap: 7px;
        border-bottom: 1px solid var(--line);
        background: white;
        padding: 12px 18px;
        box-shadow: 0 8px 24px rgba(59, 13, 22, 0.08);
      }
      .tutorial-guide-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin-bottom:20px; }
      .tutorial-guide-card { border:1px solid var(--line); border-radius:18px; background:#fff; box-shadow:var(--shadow); overflow:hidden; }
      .tutorial-guide-card[open] { border-color:rgba(123,24,48,.28); }
      .tutorial-guide-card summary { display:flex; align-items:center; gap:14px; padding:20px; cursor:pointer; list-style:none; color:var(--wine-900); }
      .tutorial-guide-card summary::-webkit-details-marker { display:none; }
      .tutorial-guide-card summary::after { content:"＋"; margin-left:auto; font-size:24px; font-weight:800; color:var(--wine-700); }
      .tutorial-guide-card[open] summary::after { content:"−"; }
      .tutorial-guide-card summary span:not(.tutorial-guide-icon) { display:grid; gap:4px; }
      .tutorial-guide-card summary strong { font-family:var(--font-display); font-size:22px; }
      .tutorial-guide-card summary small { color:var(--muted); font-size:14px; }
      .tutorial-guide-icon { display:grid; place-items:center; flex:0 0 42px; height:42px; border-radius:50%; background:var(--wine-700); color:#fff; font-size:18px; font-weight:900; }
      .tutorial-guide-card ol { margin:0; padding:0 28px 22px 58px; color:var(--text); }
      .tutorial-guide-card li { padding:5px 0 5px 4px; line-height:1.5; }
      .tutorial-guide-note { margin:0 20px 22px; padding:12px 14px; border-radius:12px; background:#fff4d8; color:var(--wine-900); line-height:1.45; }
      .tutorial-guide-description { margin:0; padding:0 22px 14px; color:var(--muted); line-height:1.5; }
      .tutorial-launch { margin:0 22px 22px; }
      .studio-history-actions { display:inline-flex; gap:8px; }
      @media (max-width: 900px) { .tutorial-guide-grid { grid-template-columns:1fr; } }
      .activity-location { display:flex; align-items:center; gap:8px; min-width:0; color:var(--wine-900); }
      .activity-location > span { display:flex; align-items:baseline; gap:5px; min-width:0; }
      .activity-location small { flex:0 0 auto; color:var(--muted); font-size:10px; font-weight:850; letter-spacing:.04em; text-transform:uppercase; }
      .activity-location strong { overflow:hidden; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
      .activity-location > b { flex:0 0 auto; color:var(--gold); font-size:17px; }
      .studio-location { margin-bottom:4px; }
      .studio-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        min-width: 0;
        width: 100%;
      }
      .studio-general-actions { display:flex; flex-wrap:wrap; align-items:center; gap:4px; width:100%; overflow:visible; padding:2px 0; }
      .studio-general-actions > * { flex:0 0 auto; }
      .studio-general-actions > .btn, .studio-tool-actions > .btn { min-height:30px; padding:5px 9px; border-radius:8px; font-size:12px; line-height:1.1; }
      .studio-general-actions[hidden] { display:none !important; }
      .studio-text-format {
        display: inline-flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 2px;
        width: 100%;
        max-width: none;
        overflow: hidden;
        border: 1px solid #242424;
        border-radius: 4px;
        background: #3b3b3b;
        padding: 4px;
      }
      .studio-text-format[hidden] { display:none !important; }
      .studio-text-format .format-button {
        min-width: 27px;
        min-height: 27px;
        padding: 4px 6px;
        border: 0;
        background: transparent;
        color: #fff;
        border-radius: 2px;
        font-size: 11px;
        line-height: 1;
      }
      .studio-text-format .format-button:hover { background: #5a5a5a; }
      .studio-format-select { height:27px; border:1px solid #777; border-radius:2px; background:#4a4a4a; color:#fff; padding:2px 20px 2px 6px; font-size:11px; }
      .studio-font-family { width:105px; }
      .studio-font-size { width:50px; }
      .studio-color-select { width:125px; max-height:220px; }
      .studio-highlight-button { color:#171717 !important; background:linear-gradient(transparent 58%,#fff176 58%) !important; }
      @media (max-width: 1000px) {
        .studio-text-format { flex-wrap:wrap; overflow:visible; }
      }
      .studio-tool-picker {
        display: grid;
        gap: 3px;
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
      }
      .studio-tool-picker select {
        min-width: 130px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: white;
        padding: 7px 9px;
      }
      .studio-tool-actions { display:flex; flex:0 0 auto; align-items:center; gap:4px; padding:2px 4px; border:1px solid var(--line); border-radius:9px; background:#fffaf5; }
      .studio-tool-actions .studio-tool-picker { display:flex; align-items:center; gap:4px; white-space:nowrap; font-size:9px; }
      .studio-tool-actions .studio-tool-picker select { width:105px; min-width:105px; padding:5px 7px; font-size:11px; }
      .studio-tool-button { min-height:30px; }
      .studio-wheel-button { color:#fff; background:#7b1830; }
      .studio-timer-button { color:#fff; background:#187b70; }
      @media (max-width: 1100px) {
        .studio-toolbar > div:first-child .studio-note { display:none; }
      }
      .slide-world {
        overflow: auto;
        padding: 36px;
      }
      .studio-workspace { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 0; }
      .studio-sidebar { min-height:0; display:grid; grid-template-rows:minmax(160px,1fr) auto; border-right:1px solid var(--line); background:#fff; }
      .studio-duration, .studio-activity-content { display:grid; gap:4px; padding:13px; background:#fffaf5; }
      .studio-duration { grid-template-columns:1fr auto; align-items:center; border-bottom:1px solid var(--line); }
      .studio-duration span, .studio-activity-content span { color:var(--muted); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
      .studio-duration strong { color:var(--wine-700); }
      .studio-activity-content { border-top:1px solid var(--line); line-height:1.35; }
      .studio-activity-content strong { white-space:pre-wrap; }
      .slide-thumbnails { overflow: auto; background: #fff; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
      .slide-thumbnail { display: grid; gap: 4px; text-align: left; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); padding: 10px; cursor: grab; }
      .slide-thumbnail { position:relative; }
      .slide-thumbnail-actions { position:absolute; top:5px; right:5px; z-index:2; display:flex; gap:4px; }
      .slide-thumbnail-actions button { width:23px; height:23px; padding:0; border:1px solid var(--line); border-radius:50%; color:var(--wine-700); background:#fff; font-size:14px; font-weight:900; line-height:1; cursor:pointer; }
      .slide-thumbnail-actions button:disabled { opacity:.3; cursor:not-allowed; }
      .slide-thumbnail-delete { position:static; border:0 !important; color:#fff !important; background:#a91d37 !important; font-size:16px !important; opacity:.72; }
      .slide-thumbnail-delete:hover { opacity:1; transform:scale(1.08); }
      .slide-thumbnail.current { border-color: var(--wine-700); box-shadow: 0 0 0 3px rgba(116,24,42,.12); }
      .slide-thumbnail.dragging { opacity:.45; }
      .slide-thumbnail.drop-target { border-color:#d09516; transform:translateY(3px); box-shadow:0 -4px 0 #d09516; }
      .slide-thumbnail span { font-weight: 900; color: var(--wine-700); }
      .slide-thumbnail small { color: var(--muted); }
      .slide-duration { display:grid; grid-template-columns:1fr 70px; align-items:center; gap:6px; margin-top:5px; color:var(--muted); font-size:10px; font-weight:850; text-transform:uppercase; }
      .slide-duration input { min-width:0; padding:5px 6px; border:1px solid var(--line); border-radius:6px; color:var(--wine-700); background:white; font-weight:900; }
      .seating-dialog { position: fixed; inset: 4vh 3vw; overflow: auto; background: #f8f3ec; border-radius: 20px; padding: 22px; box-shadow: 0 28px 80px rgba(28,5,11,.35); }
      .seating-controls { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin: 18px 0; }
      .seating-controls label { display: grid; gap: 5px; font-weight: 800; }
      .cinema-room { position:relative; overflow: hidden; padding: 28px clamp(18px,4vw,60px) 48px; border-radius: 22px; background: radial-gradient(circle at 50% 0,#55313a 0,#261017 42%,#11070a 100%); box-shadow: inset 0 0 55px rgba(0,0,0,.5); }
      .classroom-board { position:absolute; z-index:1; top:28px; left:50%; transform:translateX(-50%); width:min(680px,70%); padding:13px; text-align:center; color:#fff9e9; border:2px solid #d6b66f; border-radius:50% 50% 12px 12px / 18% 18% 12px 12px; background:linear-gradient(180deg,#fffdf4,#cbbf9f 8%,#604f33 9%,#1c1711 100%); box-shadow:0 12px 38px rgba(247,220,153,.28); font-weight:900; letter-spacing:.12em; pointer-events:none; }
      .classroom-board span, .classroom-board small { display: block; }
      .classroom-board small { margin-top: 3px; font-size: 10px; opacity: .75; }
      .seating-grid { position:absolute; inset:0; perspective:900px; pointer-events:none; }
      .desk { position:absolute; width:150px; min-height:84px; border:2px solid #9e6a74; border-radius:24px 24px 13px 13px; color:#fff9f3; background:linear-gradient(145deg,#8f263e,#4b0d1b 60%,#2b0710); padding:15px 22px 10px; display:grid; place-content:center; gap:4px; box-shadow:inset 0 4px 5px rgba(255,255,255,.14),0 10px 0 #260710,0 16px 20px rgba(0,0,0,.42); transform:translate(-50%,-50%) rotateX(-4deg); cursor:grab; touch-action:none; user-select:none; pointer-events:auto; text-align:center; }
      .desk::before, .desk::after { content:""; position:absolute; bottom:8px; width:12px; height:42px; border-radius:8px; background:#3c0a15; }
      .desk::before { left:-8px; } .desk::after { right:-8px; }
      .desk.assigned { border-color: #e6c56f; background: linear-gradient(145deg,#9f3049,#5a1021 60%,#350a15); }
      .desk.selected { outline:4px solid #ffd45c; outline-offset:5px; }
      .desk.moving { z-index:5; cursor:grabbing; filter:brightness(1.12); }
      .desk span { font-size: 10px; color: #ead7da; text-transform: uppercase; letter-spacing: .08em; }
      .desk strong { font-size: 14px; }
      .desk small { font-size: 9px; color: #e9cfd5; opacity: .78; }
      .desk-delete { position:absolute; z-index:2; top:-10px; right:-10px; width:27px; height:27px; padding:0; border:2px solid #fff4e7; border-radius:50%; color:white; background:#b31d35; font-size:18px; line-height:20px; cursor:pointer; box-shadow:0 4px 9px rgba(0,0,0,.35); }
      .desk-delete:hover { background:#e02d48; transform:scale(1.08); }
      .timetable-scroll { overflow-x: auto; margin-top: 20px; padding: 4px 4px 20px; }
      .timetable { display: grid; grid-template-columns: 82px repeat(5,minmax(155px,1fr)); grid-template-rows: 58px repeat(20,32px); min-width: 860px; border: 2px solid #4f1825; border-radius: 14px; overflow: hidden; background: white; box-shadow: 0 14px 35px rgba(59,13,22,.12); }
      .timetable-corner, .timetable-day { display:grid; place-items:center; padding:8px; color:white; background:#581323; border-right:1px solid rgba(255,255,255,.24); font-weight:900; text-transform:capitalize; }
      .timetable-hour { z-index:1; display:flex; justify-content:center; align-items:flex-start; padding-top:5px; color:#5b3039; background:#f4ece5; border-top:1px solid #cbbab2; border-right:1px solid #cbbab2; font-weight:850; }
      .timetable-cell { border-top:1px solid #d5c6bf; border-right:1px solid #d5c6bf; background:#fffdf9; }
      button.timetable-cell { min-width:0; padding:0; border-left:0; border-bottom:0; cursor:cell; }
      button.timetable-cell:hover, button.timetable-cell.drop-target { background:#fff0c9; box-shadow:inset 0 0 0 2px #d09516; }
      .timetable-cell.half-hour { border-top-style:dashed; border-top-color:#e8ddd7; }
      .timetable-course { z-index:3; position:relative; margin:3px 5px; overflow:hidden; display:flex; flex-direction:column; gap:2px; padding:7px 25px 7px 9px; color:#fff; border:1px solid #9e4054; border-left:5px solid #efc860; border-radius:9px; background:linear-gradient(135deg,#7b1b31,#4a0d1b); box-shadow:0 5px 10px rgba(59,13,22,.24); }
      .timetable-course[draggable="true"] { cursor:grab; }
      .timetable-course.selected { outline:4px solid #efc860; outline-offset:-1px; filter:brightness(1.12); }
      .calendar-only { padding:0 4px; }
      .schedule-editor { position:absolute; top:50%; left:50%; width:min(760px,calc(100vw - 32px)); max-height:calc(100vh - 32px); overflow:auto; border:1px solid var(--line); border-radius:18px; background:var(--paper-2); box-shadow:0 28px 80px rgba(43,10,18,.34); transform:translate(-50%,-50%); }
      .schedule-editor-form { padding:22px; }
      .schedule-editor-form label { display:grid; align-content:start; gap:6px; color:var(--wine-900); font-weight:800; }
      .schedule-editor-form .optional { color:var(--muted); font-size:11px; font-weight:650; }
      .schedule-group-list { min-height:116px; overflow-y:auto; padding:5px; }
      .schedule-group-list option { padding:8px 10px; border-radius:6px; }
      .schedule-group-list option:checked { color:white; background:var(--wine-700); }
      .editor-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; padding-top:8px; }
      .timetable-course strong { font-size:12px; }
      .timetable-course span { font-size:12px; font-weight:850; }
      .timetable-course small { opacity:.88; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
      .timetable-course button { position:absolute; top:4px; right:5px; border:0; color:white; background:transparent; font-size:18px; cursor:pointer; }
      .slide-strip {
        position: relative;
        width: 960px;
        min-height: 760px;
        margin-inline: auto;
      }
      .slide-frame {
        position: relative;
        width: 960px;
        height: 540px;
        overflow: visible;
        border: 3px dashed rgba(116, 24, 42, 0.38);
        border-radius: 6px;
        background: rgba(255, 253, 249, 0.86);
        box-shadow: 0 24px 60px rgba(59, 13, 22, 0.16);
        pointer-events: auto;
      }
      .slide-frame.current {
        border-color: var(--wine-700);
        box-shadow: 0 0 0 5px rgba(116, 24, 42, 0.08), 0 24px 60px rgba(59, 13, 22, 0.16);
      }
      .slide-frame.drop-target { border-color:#d09516; background:#fff9e8; box-shadow:0 0 0 7px rgba(208,149,22,.18),0 24px 60px rgba(59,13,22,.16); }
      .slide-frame.file-drop-target { border-color:#187b70; background:#eefbf8; box-shadow:0 0 0 8px rgba(24,123,112,.18); }
      .slide-frame::before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        top: 10px;
        z-index: 3;
        border-radius: 999px;
        background: rgba(116, 24, 42, 0.08);
        color: var(--wine-700);
        padding: 5px 9px;
        font-size: 12px;
        font-weight: 850;
        pointer-events: none;
      }
      .slide-frame.instruction-hidden::before { display: none; }
      .slide-el {
        position: absolute;
        z-index: 5;
        min-width: 60px;
        min-height: 40px;
        border: 1px solid rgba(116, 24, 42, 0.22);
        border-radius: 6px;
        background: white;
        overflow: visible;
        resize: none;
        box-shadow: 0 10px 20px rgba(59, 13, 22, 0.08);
        touch-action: none;
      }

      .slide-element-content {
        position: relative;
        width: 100%;
        height: 100%;
        overflow: hidden;
      }
      .slide-el:not(.selected)[data-kind="pdf"] .slide-element-content::after,
      .slide-el:not(.selected)[data-kind="embed"] .slide-element-content::after,
      .slide-el:not(.selected)[data-kind="document"] .slide-element-content::after { content:"Cliquer pour sélectionner"; position:absolute; z-index:15; inset:0; display:grid; place-items:end center; padding:12px; color:white; background:linear-gradient(transparent 72%,rgba(59,13,22,.78)); font-size:12px; font-weight:900; cursor:pointer; }
      .slide-element-content > * {
        max-width: 100%;
        max-height: 100%;
      }
      .slide-move-handle {
        position: absolute;
        z-index: 50;
        left: 50%;
        top: -18px;
        display: grid;
        place-items: center;
        width: 42px;
        height: 30px;
        padding: 0;
        transform: translateX(-50%);
        border: 2px solid white;
        border-radius: 9px;
        background: var(--wine-700);
        color: white;
        box-shadow: 0 3px 10px rgba(59, 13, 22, .25);
        cursor: grab;
        font-size: 19px;
        line-height: 1;
        opacity: 0;
        pointer-events: none;
        touch-action: none;
      }
      .slide-move-handle:active { cursor: grabbing; }
      .slide-delete-handle {
        position: absolute;
        z-index: 52;
        right: -16px;
        top: -18px;
        display: grid;
        place-items: center;
        width: 32px;
        height: 30px;
        padding: 0;
        border: 2px solid white;
        border-radius: 9px;
        background: #b4233f;
        color: white;
        box-shadow: 0 3px 10px rgba(59, 13, 22, .25);
        cursor: pointer;
        font-size: 22px;
        font-weight: 800;
        line-height: 1;
        opacity: 0;
        pointer-events: none;
      }
      .slide-delete-handle:hover { background: #8e142d; }
      .slide-resize-handle {
        position: absolute;
        z-index: 51;
        display: none;
        width: 14px;
        height: 14px;
        border: 2px solid white;
        border-radius: 50%;
        background: var(--wine-700);
        box-shadow: 0 1px 5px rgba(59, 13, 22, .3);
        touch-action: none;
      }
      .slide-resize-handle.nw { left: -8px; top: -8px; cursor: nwse-resize; }
      .slide-resize-handle.n { left: calc(50% - 7px); top: -8px; cursor: ns-resize; }
      .slide-resize-handle.ne { right: -8px; top: -8px; cursor: nesw-resize; }
      .slide-resize-handle.e { right: -8px; top: calc(50% - 7px); cursor: ew-resize; }
      .slide-resize-handle.se { right: -8px; bottom: -8px; cursor: nwse-resize; }
      .slide-resize-handle.s { left: calc(50% - 7px); bottom: -8px; cursor: ns-resize; }
      .slide-resize-handle.sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
      .slide-resize-handle.w { left: -8px; top: calc(50% - 7px); cursor: ew-resize; }
      .slide-size-indicator {
        position: absolute;
        z-index: 22;
        right: 4px;
        bottom: 4px;
        display: none;
        border-radius: 5px;
        background: rgba(59, 13, 22, .82);
        color: white;
        padding: 3px 6px;
        font-size: 11px;
        font-weight: 800;
        pointer-events: none;
      }

      .board-slide-inner .slide-el {
        overflow: hidden;
        resize: none;
        box-shadow: none;
      }

      .board-slide-inner .slide-text {
        overflow: hidden;
        padding: 10px;
      }
      .slide-el.selected {
        outline: 3px solid var(--wine-700);
        outline-offset: 2px;
      }
      .slide-el.selected .slide-move-handle { opacity: 1; pointer-events: auto; }
      .slide-el[data-kind="pdf"] .slide-move-handle,
      .slide-el[data-kind="embed"] .slide-move-handle { opacity:1; pointer-events:auto; }
      .slide-el.selected .slide-delete-handle { opacity: 1; pointer-events: auto; }
      .slide-el.selected .slide-resize-handle { display: block; }
      .slide-el.resizing .slide-size-indicator { display: block; }
      .slide-el.dragging {
        opacity: 0.78;
      }
      .slide-text {
        width: 100%;
        height: 100%;
        padding: 14px;
        font-size: 34px;
        line-height: 1.18;
        outline: 0;
        overflow: hidden;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
      }
      .slide-text:empty::before {
        content: attr(data-placeholder);
        color: var(--muted);
        font-style: italic;
        opacity: .65;
        pointer-events: none;
      }
      .slide-el img,
      .slide-el video,
      .slide-el iframe {
        width: 100%;
        height: 100%;
        border: 0;
        object-fit: contain;
        background: white;
      }
      .slide-el audio {
        width: calc(100% - 20px);
        margin: 18px 10px;
      }
      .slide-image-error {
        width: 100%;
        height: 100%;
        display: grid;
        place-content: center;
        gap: 8px;
        padding: 24px;
        box-sizing: border-box;
        background: #f8f1e8;
        color: var(--wine-900);
        text-align: center;
      }
      .slide-image-error span { color: var(--muted); font-size: 13px; }
      .slide-document-card {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 14px;
        padding: 24px;
        text-align: center;
        background: #fffaf5;
        border: 2px dashed #d7b9bf;
        border-radius: 16px;
        overflow: auto;
      }
      .slide-document-card strong { color: #7f243d; font-size: 1.2rem; }
      .slide-document-card span { color: #665a5d; font-size: .9rem; }
      .slide-document-card.loaded {
        display: block;
        padding: 22px 28px;
        text-align: left;
        background: white;
        border-style: solid;
      }
      .document-preview-content { width: 100%; color: #252022; line-height: 1.5; }
      .document-preview-content p { margin: 0 0 .8em; white-space: pre-wrap; }
      .plain-document-preview { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; font:14px/1.45 ui-monospace,Consolas,monospace; }
      .sheet-preview { margin-bottom:18px; overflow:auto; }
      .sheet-preview > strong { display:block; margin-bottom:8px; }
      .sheet-preview table { border-collapse:collapse; min-width:100%; }
      .sheet-preview td { padding:6px 8px; border:1px solid #dec9ce; white-space:nowrap; }
      .pptx-preview { display: block; }
      .pptx-preview-slide {
        min-height: 180px;
        padding: 20px;
        border: 1px solid #dec9ce;
        border-radius: 12px;
        background: #fffdf9;
        box-shadow: 0 4px 12px rgba(90, 34, 48, .08);
      }
      .pptx-preview-slide[hidden] { display: none; }
      .pptx-preview-slide > strong { display: block; margin-bottom: 14px; }
      .pptx-preview-image {
        display: block;
        max-width: 100%;
        max-height: 320px;
        margin: 0 auto 14px;
        object-fit: contain;
      }
      .pptx-preview-controls {
        position: sticky;
        bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 12px;
        background: rgba(255, 255, 255, .94);
        border-top: 1px solid #dec9ce;
      }
      .document-preview-fallback {
        display: flex;
        min-height: 100%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 14px;
      }
      .document-preview-fallback[hidden] { display: none; }
      .slide-tool {
        display: grid;
        align-content: start;
        gap: 9px;
        width: 100%;
        height: 100%;
        overflow: hidden;
        border: 2px solid rgba(116, 24, 42, 0.18);
        border-radius: 6px;
        background: linear-gradient(145deg, #fffdf9, #f7ece4);
        padding: 14px;
        text-align: center;
      }
      .slide-el[data-kind="tool"] { container-type:size; }
      .slide-tool strong { color: var(--wine-900); font-size: 24px; }
      .slide-tool p { margin: 0; color: var(--muted); font-size: 15px; }
      .slide-tool-kicker { color: var(--wine-700); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
      .slide-tool-head { display: grid; gap: 7px; }
      .slide-tool-settings { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 8px; }
      .slide-tool-settings label, .slide-timer-setting { display: grid; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 850; text-align: left; }
      .slide-tool-settings select, .slide-tool-settings input, .slide-timer-setting input {
        width: 100%;
        min-width: 0;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: white;
        padding: 6px 8px;
        color: var(--ink);
        font: inherit;
      }
      .slide-tool-class-name { font-size: 17px !important; }
      .slide-wheel-visual {
        display: grid;
        place-items: center;
        width: min(116px, 42cqw, 42cqh);
        min-width: 54px;
        height: auto;
        aspect-ratio: 1;
        margin: 0 auto;
        border: clamp(4px, 2cqw, 8px) solid var(--wine-700);
        border-radius: 50%;
        background: conic-gradient(#8b142c 0 20%, #f0d7b5 20% 40%, #d98c73 40% 60%, #647447 60% 80%, #f7ece4 80%);
        box-shadow: inset 0 0 0 8px white, 0 8px 20px rgba(59, 13, 22, .15);
      }
      .slide-wheel-visual .slide-tool-result {
        display: grid;
        place-items: center;
        width: 72%;
        height: auto;
        aspect-ratio: 1;
        overflow: hidden;
        border-radius: 50%;
        background: rgba(255,255,255,.94);
        padding: 7px;
        font-size: clamp(10px, 4cqw, 16px);
        line-height: 1.05;
      }
      .slide-tool-summary { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px 12px; color: var(--muted); font-size: 11px; font-weight: 800; }
      .slide-student-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; max-height: 78px; overflow: auto; }
      .slide-student {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        min-width: 0;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: white;
        padding: 5px 7px;
        color: var(--ink);
        font-size: 11px;
        text-align: left;
      }
      .slide-student span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
      .slide-student small { flex: 0 0 auto; color: var(--muted); }
      .slide-student.absent { opacity: .5; text-decoration: line-through; background: #f9dfe4; }
      .slide-tool-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
      .slide-tool-buttons .btn { min-height: 34px; padding: 7px 10px; font-size: 11px; }
      .slide-timer { place-items: center; align-content: center; gap: 16px; }
      .slide-timer-face {
        display: grid;
        place-items: center;
        min-width: 300px;
        border: 3px solid var(--wine-700);
        border-radius: 18px;
        background: white;
        padding: 24px 30px;
        box-shadow: 0 12px 25px rgba(59, 13, 22, .12);
      }
      .slide-timer .timer-face-small { width: min(210px, 55cqw, 55cqh); min-width:60px; margin:0 auto; }
      .slide-timer .timer-face-small .timer-face-inner { width: 72%; }
      .slide-timer .embedded-timer-display { color: var(--wine-900); font-size: clamp(13px, 11cqw, 54px); line-height: 1; font-variant-numeric: tabular-nums; }
      .slide-timer-setting { width: 130px; text-align: center; }
      .slide-el.tool-compact .slide-tool { gap:5px; padding:7px; }
      .slide-el.tool-compact .slide-student-list { display:none; }
      .slide-el.tool-compact .slide-tool-kicker { font-size:9px; }
      .slide-el.tool-compact .slide-tool-buttons .btn { min-height:27px; padding:4px 7px; font-size:9px; }
      .slide-el.tool-tiny .slide-tool-head, .slide-el.tool-tiny .slide-tool-summary, .slide-el.tool-tiny .slide-tool-settings, .slide-el.tool-tiny .slide-timer-setting { display:none; }
      .slide-el.tool-tiny .slide-tool { place-content:center; }
      .slide-el.tool-tiny .slide-timer .timer-face-small { width:min(100px,46cqw,46cqh); min-width:54px; }
      .slide-el.tool-tiny .slide-timer .embedded-timer-display { max-width:100%; overflow:hidden; font-size:clamp(11px,7cqw,24px); white-space:nowrap; }
      .slide-el.tool-tiny .slide-tool-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; }
      .slide-el.tool-tiny .slide-tool-buttons .btn { min-width:0; width:100%; padding:4px 3px; overflow:hidden; text-overflow:ellipsis; }
      .slide-wheel.spinning .slide-tool-result { animation: toolPulse .18s ease-in-out infinite alternate; }
      @keyframes toolPulse { to { transform: scale(1.08); opacity: .55; } }

      .print-preview-shell {
        position: fixed;
        inset: 20px;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        overflow: hidden;
        border-radius: var(--radius);
        background: #ebe5df;
        box-shadow: var(--shadow);
      }
      .print-preview-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        border-bottom: 1px solid var(--line);
        background: white;
        padding: 14px 18px;
      }
      .print-preview-toolbar p { margin: 4px 0 0; }
      .print-orientation-control {
        display: grid;
        gap: 4px;
        color: var(--wine-900);
        font-size: 12px;
        font-weight: 800;
      }
      .print-orientation-control select {
        min-width: 120px;
        padding: 9px 34px 9px 11px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: white;
        color: var(--ink);
        font: inherit;
      }
      .print-preview-scroll { overflow: auto; padding: 28px; }
      .printable-activity {
        width: min(100%, 1040px);
        margin: 0 auto;
        background: white;
        padding: 42px;
        box-shadow: 0 16px 45px rgba(43, 32, 32, .14);
      }
      .printable-lesson { width:100%; margin:0 auto; background:transparent; padding:0; box-shadow:none; }
      .printable-lesson > .print-lesson-head,
      .printable-lesson .print-activity-head,
      .printable-lesson .print-slide-page { box-sizing:border-box; width:min(100%,1120px); min-height:auto; aspect-ratio:297 / 210; margin:0 auto 32px; padding:46px; overflow:hidden; background:white; box-shadow:0 16px 45px rgba(43,32,32,.2); }
      .print-lesson-head { display:grid; align-content:center; border-bottom:5px solid var(--wine-700); }
      .print-lesson-head h1 { margin: 5px 0 12px; color: var(--wine-900); font-size: 46px; }
      .print-lesson-activity { margin:0; }
      .print-activity-head { display:grid; align-content:center; }
      .print-activity-head h1 { margin: 4px 0 12px; color: var(--wine-900); font-size: 36px; }
      .print-breadcrumb { margin: 0; color: var(--wine-700); font-size: 13px; font-weight: 850; }
      .print-activity-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0 0; }
      .print-activity-meta div { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
      .print-activity-meta dt { color: var(--wine-700); font-size: 12px; font-weight: 900; text-transform: uppercase; }
      .print-activity-meta dd { margin: 4px 0 0; white-space: pre-line; }
      .print-slide-page { break-inside:avoid; }
      .printable-lesson .print-slide-page { position:relative; transition:width .2s ease; }
      .printable-lesson .print-slide-page[data-word-layout="half"] { width:min(100%,1120px); }
      .word-slide-layout-control { position:absolute; z-index:5; top:10px; right:12px; display:grid; gap:6px; min-width:220px; border:1px solid var(--line); border-radius:13px; background:rgba(255,255,255,.97); padding:11px 13px; color:var(--wine-900); font-size:14px; font-weight:850; box-shadow:var(--shadow-soft); }
      .word-slide-layout-control select { width:100%; max-width:230px; min-height:32px; border:0; background:transparent; color:var(--wine-900); font:inherit; font-weight:850; cursor:pointer; }
      .word-slide-export-toggle { min-height:34px; border:0; border-top:1px solid var(--line); background:transparent; padding:8px 3px 2px; color:var(--wine-700); font:inherit; font-weight:950; cursor:pointer; }
      .print-slide-page[data-word-export="false"] { opacity:.48; filter:grayscale(.65); }
      .print-slide-page[data-word-export="false"]::after { content:"Retirée de l'export"; position:absolute; z-index:4; inset:0; display:grid; place-items:center; background:rgba(255,255,255,.3); color:var(--wine-900); font-size:28px; font-weight:950; pointer-events:none; }
      .word-multi-preview { display:grid; grid-template-columns:repeat(auto-fit,minmax(720px,1fr)); gap:22px; align-items:start; }
      .word-multi-preview .print-lesson-activity { display:contents; }
      .word-multi-preview .print-slide-page { width:1120px; margin:0; zoom:.64; justify-self:center; }
      .print-slide-path { min-height:26px; margin:0 0 5px; padding-right:215px; color:var(--muted); font-size:10px; font-weight:750; line-height:1.25; }
      .print-slide-page h2 { margin:3px 0 12px; font-size:20px; }
      .print-slide-page h2, .print-resources h2 { color: var(--wine-900); }
      .print-slide-canvas { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); background: #fffdf9; }
      .print-slide-element { position: absolute; overflow: hidden; }
      .print-slide-element img { width: 100%; height: 100%; object-fit: contain; }
      .print-slide-element video { width:100%; height:100%; object-fit:contain; background:#111; }
      .print-slide-text { padding: 6px; white-space: pre-line; line-height: 1.18; }
      .print-slide-placeholder { display: grid; place-items: center; align-content: center; gap: 6px; border: 1px dashed var(--line); background: #f8f1e8; padding: 10px; text-align: center; }
      .print-slide-placeholder span { max-width: 100%; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
      .print-resources { margin-top: 30px; }
      .youtube-card {
        position: relative;
        display: grid;
        place-items: center;
        width: 100%;
        height: 100%;
        overflow: hidden;
        background: #111;
        color: white;
        text-align: center;
      }
      .youtube-card img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0.72;
      }
      .youtube-card a {
        position: relative;
        z-index: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        border-radius: 999px;
        background: rgba(116, 24, 42, 0.94);
        color: white;
        padding: 14px 20px;
        font-weight: 900;
        box-shadow: 0 12px 35px rgba(0,0,0,.28);
      }
      .youtube-card span {
        position: relative;
        z-index: 1;
        display: block;
        margin-top: 12px;
        max-width: 70%;
        color: rgba(255,255,255,.85);
        font-weight: 750;
      }
      .studio-note {
        color: var(--muted);
        font-size: 13px;
        font-weight: 700;
      }
      .studio-save-status {
        width: fit-content;
        margin-top: 7px;
        border-radius: 999px;
        padding: 5px 10px;
        font-size: 12px;
        font-weight: 850;
      }
      .studio-save-status.pending { background: #fff3cd; color: #765b00; }
      .studio-save-status.success { background: #e2f4e6; color: #245c31; }
      .studio-save-status.error { background: #f9dfe4; color: #8b142c; }

      .notice {
        position: fixed;
        right: 18px;
        bottom: 18px;
        z-index: 80;
        border: 1px solid var(--line);
        border-left: 3px solid var(--gold);
        border-radius: var(--radius);
        background: white;
        color: var(--wine-700);
        padding: 13px 16px;
        box-shadow: var(--shadow-lift);
        font-weight: 800;
        animation: noticeSlideIn 0.4s var(--ease-spring) both;
      }

      @keyframes noticeSlideIn {
        from { opacity: 0; transform: translateY(14px) scale(0.96); }
        to { opacity: 1; transform: translateY(0) scale(1); }
      }

      .board {
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        background: #111;
        color: var(--ink);
        padding: 0;
      }

      .board-wrap {
        width: 100vw;
        height: 100vh;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        place-items: stretch;
      }
      .board-location { z-index:20; justify-content:center; min-height:42px; padding:6px 16px; border-bottom:1px solid var(--line); background:#fff; box-shadow:0 5px 18px rgba(59,13,22,.1); }
      .board-location small { font-size:11px; }
      .board-location strong { max-width:28vw; font-size:14px; }
      .board-head {
        display: none;
        border-radius: var(--radius);
        background: var(--wine-900);
        color: white;
        padding: 32px;
        box-shadow: var(--shadow);
      }
      .board-head h1 {
        margin: 10px 0 0;
        font-size: clamp(46px, 7vw, 90px);
        line-height: 1;
      }
      .board-section {
        margin-top: 20px;
        border: 2px solid var(--wine-700);
        border-radius: 14px;
        background: white;
        padding: 28px;
        box-shadow: var(--shadow-lift), 0 0 0 8px rgba(201, 154, 61, 0.08);
        animation: boardEnter 0.55s var(--ease-premium) both;
      }
      @keyframes boardEnter {
        from { opacity: 0; transform: translateY(24px) scale(0.985); }
        to { opacity: 1; transform: translateY(0) scale(1); }
      }
      .board-section h2 { margin: 0; color: var(--wine-900); font-family: var(--font-display); font-weight: 600; font-size: 38px; }
      .board-section p { font-size: clamp(30px, 4vw, 52px); line-height: 1.35; white-space: pre-line; }
      .board-resource { display: grid; gap: 16px; }
      .board-resource h3 { font-size: 32px; margin: 0; color: var(--wine-900); }
      .board-resource audio, .board-resource video { width: 100%; }
      .board-resource video, .board-resource iframe { min-height: 58vh; }
      .board-resource img { max-height: 62vh; width: 100%; }
      .board-slide-stage {
        width: 100%;
        height: 100%;
        position: relative;
        overflow: hidden;
        border-radius: 0;
        background: #fffdf9;
        box-shadow: none;
      }
      @media (max-width: 700px) {
        .activity-location { gap:4px; }
        .activity-location > span { display:grid; gap:0; }
        .activity-location strong { max-width:26vw; }
        .activity-location > b { font-size:13px; }
      }
      .board-slide-inner {
        position: absolute;
        left: 0;
        top: 0;
        width: 960px;
        height: 540px;
        transform-origin: top left;
      }
      .board-slide-inner .slide-el {
        resize: none;
        box-shadow: none;
        border-color: transparent;
      }
      .youtube-card.youtube-player { display:block; background:#000; }
      .youtube-card.youtube-player iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
      .board-slide-instruction {
        position: absolute;
        z-index: 4;
        top: 12px;
        left: 14px;
        max-width: 70%;
        padding: 7px 12px;
        border: 0;
        border-radius: 999px;
        background: #f5e9e5;
        color: var(--wine-900);
        box-shadow: none;
        font-size: 14px;
        font-weight: 900;
        line-height: 1.2;
        text-align: left;
        white-space: pre-wrap;
        pointer-events: none;
      }
      .board-controls {
        position: fixed;
        left: 50%;
        bottom: 18px;
        transform: translateX(-50%);
        display: flex;
        gap: 8px;
        border-radius: var(--radius);
        background: rgba(255,255,255,.9);
        padding: 8px;
        box-shadow: 0 12px 35px rgba(0,0,0,.2);
        opacity: 0.2;
        transition: opacity .15s ease;
      }
      .board-controls:hover {
        opacity: 1;
      }

      .empty {
        border: 1px dashed var(--line);
        border-radius: var(--radius);
        padding: 18px;
        color: var(--muted);
        background: rgba(255,255,255,.52);
      }

      /* Arbre généalogique : le parent est centré au-dessus de ses branches. */
      .course-tree-scroll {
        overflow: auto;
        max-height: min(70vh, 860px);
        border: 1px solid var(--line);
        border-radius: 14px;
        background: linear-gradient(180deg, #fffdfa, #fdf8f2);
        padding: 20px 22px 26px;
        box-shadow: var(--shadow);
      }

      .course-tree {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: max-content;
        min-width: 100%;
      }

      .course-tree ul {
        position: relative;
        list-style: none;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        margin: 0;
        padding: 24px 0 0;
      }

      .course-tree > ul { margin-top: 0; }

      .course-tree ul ul {
        margin: 0;
      }

      .course-tree li {
        position: relative;
        list-style: none;
        padding: 22px 6px 0;
        text-align: center;
      }

      .course-tree li::before,
      .course-tree li::after {
        content: "";
        position: absolute;
        top: 0;
        right: 50%;
        width: 50%;
        height: 24px;
        border-top: 2px solid rgba(116, 24, 42, 0.28);
      }
      .course-tree li::after {
        right: auto;
        left: 50%;
        border-left: 2px solid rgba(116, 24, 42, 0.28);
      }
      .course-tree li:only-child::before,
      .course-tree li:only-child::after { display: none; }
      .course-tree li:only-child { padding-top: 0; }
      .course-tree li:first-child::before,
      .course-tree li:last-child::after { border: 0; }
      .course-tree li:last-child::before {
        border-right: 2px solid rgba(116, 24, 42, 0.28);
        border-radius: 0 8px 0 0;
      }
      .course-tree li:first-child::after { border-radius: 8px 0 0 0; }
      .course-tree ul ul::before,
      .course-tree > ul::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        width: 0;
        height: 24px;
        border-left: 2px solid rgba(116, 24, 42, 0.28);
      }
      .course-tree > ul > li,
      .course-tree > ul > li:only-child { padding-top: 24px; }

      .tree-node {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: center;
        gap: 10px;
        width: 220px;
        margin-inline: auto;
        min-height: 42px;
        border: 1px solid var(--line-soft);
        border-left: 4px solid var(--line);
        border-radius: 9px;
        background: white;
        color: var(--wine-900);
        padding: 9px 14px;
        text-align: center;
        white-space: normal;
        box-shadow: 0 1px 2px rgba(59, 13, 22, 0.05);
        transition: transform 0.18s var(--ease-premium), border-color 0.18s ease, box-shadow 0.2s var(--ease-premium);
      }

      .tree-node:hover {
        transform: translateY(-2px);
        border-left-color: var(--wine-700);
        box-shadow: var(--shadow-soft);
      }

      .tree-node span {
        flex: 0 0 auto;
        min-width: 62px;
        color: var(--muted);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
      }

      .tree-node strong {
        flex: 1 1 auto;
        overflow-wrap: anywhere;
        font-size: 14px;
        font-weight: 650;
        line-height: 1.25;
      }

      .tree-node em {
        flex: 0 0 auto;
        border-radius: 999px;
        background: rgba(179, 47, 60, 0.12);
        color: #b32f3c;
        padding: 2px 9px;
        font-size: 10px;
        font-style: normal;
        font-weight: 800;
      }

      .tree-node-stack {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        width: 220px;
        margin-inline: auto;
      }
      .tree-node-stack .tree-node { width: 100%; }
      .tree-node-action {
        width: 100%;
        border: 1px solid var(--line-soft);
        border-radius: 999px;
        background: transparent;
        color: var(--sea);
        padding: 6px 12px;
        font-size: 10px;
        font-weight: 700;
        white-space: nowrap;
        transition: border-color 0.18s ease, background 0.18s ease;
      }
      .tree-node-action:hover { border-color: var(--sea); background: #eef7f7; }

      .copy-course-dialog { width:min(620px,calc(100vw - 32px)); margin:8vh auto 0; overflow:hidden; }
      .copy-course-form { display:grid; gap:16px; padding:22px; }

      .tree-heading {
        border-left-color: var(--gold);
        background: linear-gradient(120deg, var(--wine-900), #521021);
        color: white;
        box-shadow: 0 6px 18px -6px rgba(59, 13, 22, 0.5);
      }

      .tree-heading span { color: rgba(255, 255, 255, 0.68); }
      .tree-heading strong { color: white; }
      .tree-class { border-left-color: var(--wine-700); background: linear-gradient(90deg, rgba(116,24,42,0.05), #ffffff 60%); }
      .tree-sequence { border-left-color: var(--sea); background: linear-gradient(90deg, rgba(47,111,115,0.05), #ffffff 60%); }
      .lesson-suitcase { display:flex; align-items:center; gap:12px; margin:8px 0 10px 20px; max-width:720px; border:2px solid #b47a37; border-radius:14px; padding:8px 12px; background:linear-gradient(135deg,#fff8df,#f2d49a); color:#5c3518; box-shadow:inset 0 0 0 3px rgba(255,255,255,.45); }
      .lesson-suitcase-image { flex:0 0 auto; width:48px; height:66px; border-radius:8px; object-fit:contain; background:white; }
      .lesson-suitcase > section { min-width:0; }
      .lesson-suitcase > section > strong { display:block; margin-bottom:7px; font-size:14px; }
      .lesson-suitcase > section > div { display:flex; flex-wrap:wrap; gap:6px; }
      .lesson-suitcase span { display:inline-flex; gap:5px; border-radius:999px; padding:5px 9px; background:rgba(255,255,255,.72); font-size:12px; }
      .lesson-suitcase span b::after { content:" :"; }
      .lesson-suitcase em { font-size:12px; opacity:.72; }
      .lesson-suitcase-fields { grid-column:1/-1; border:2px solid #d4a55f; border-radius:14px; padding:14px; background:#fffaf0; }
      .lesson-suitcase-fields legend { padding:0 8px; color:var(--wine-900); font-weight:900; }
      .lesson-suitcase-legend-image { width:30px; height:40px; margin-right:5px; border-radius:5px; object-fit:contain; vertical-align:middle; background:white; }
      .tree-lesson { border-left-color: var(--olive); background: linear-gradient(90deg, rgba(100,116,71,0.05), #ffffff 60%); }
      .tree-activity { border-left-color: var(--gold); background: linear-gradient(90deg, rgba(201,154,61,0.06), #ffffff 60%); }
      .tree-resource { border-left-color: #8a7fae; background: linear-gradient(90deg, rgba(138,127,174,0.06), #ffffff 60%); }

      .category-group .page-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 16px;
      }
      .category-group { margin-bottom: 28px; }
      .category-group .class-grid-card { min-height: 190px; padding: 16px; }
      .class-grid-card-body { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
      .class-grid-card-body h3 { font-size: 24px; line-height: 1.25; }
      .class-grid-card-body p { margin: 12px 0 0; }
      .class-grid-card-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; }
      .class-grid-card-actions .btn.danger { padding-inline: 10px; }
      .category-drawer { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; width: min(1180px, calc(100% - 48px)); }
      .category-drawer-head { position: static; }
      .category-drawer-head h2 { margin: 2px 0 6px; color: var(--wine-900); }
      .category-eyebrow { margin: 0; color: var(--wine-700); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
      .category-manager { overflow: auto; align-content: start; padding: 20px; }
      .category-step { display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.65); padding: 16px; }
      .category-step-title { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 12px; }
      .category-step-title > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--wine-700); color: white; font-size: 20px; font-weight: 900; }
      .category-step-title h3 { margin: 0; color: var(--wine-900); font-size: 20px; }
      .category-step-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
      .category-editor-list, .category-class-list, .category-class-groups { display: grid; gap: 9px; }
      .category-editor-item {
        display: grid;
        grid-template-columns: auto minmax(190px, 1fr) auto auto;
        align-items: end;
        gap: 10px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: white;
        padding: 10px;
      }
      .category-order-buttons { display: grid; gap: 5px; padding-bottom: 1px; }
      .category-order-buttons .btn { min-height: 32px; padding: 6px 9px; font-size: 11px; }
      .category-name-field { min-width: 0; }
      .category-name-field .input { width: 100%; min-width: 0; }
      .category-count { align-self: center; white-space: nowrap; }
      .category-add-box { display: grid; grid-template-columns: minmax(180px, 1fr) auto; align-items: end; gap: 10px; border: 2px dashed rgba(116,24,42,.22); border-radius: 12px; background: #fffdf9; padding: 12px; }
      .category-class-group { display: grid; gap: 9px; border: 1px solid rgba(116,24,42,.18); border-radius: 14px; background: #fffaf5; padding: 12px; }
      .category-class-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
      .category-class-group-head h4 { margin: 0; color: var(--wine-900); font-size: 17px; }
      .category-class-group-head span { border-radius: 999px; background: var(--paper); padding: 5px 9px; color: var(--wine-700); font-size: 12px; font-weight: 850; }
      .category-class-empty { margin: 0; border: 1px dashed var(--line); border-radius: 10px; padding: 12px; color: var(--muted); font-size: 13px; text-align: center; }
      .category-class-row {
        display: grid;
        grid-template-columns: 38px minmax(110px, .8fr) minmax(190px, 1fr) auto;
        align-items: end;
        gap: 12px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: white;
        padding: 11px 12px;
      }
      .category-class-number { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--paper); color: var(--wine-700); font-weight: 900; }
      .category-class-name { display: grid; gap: 2px; min-width: 0; }
      .category-class-name strong { overflow: hidden; color: var(--wine-900); text-overflow: ellipsis; white-space: nowrap; }
      .category-class-name small { color: var(--muted); }
      .category-class-row .label { min-width: 0; }
      .category-class-order { display: grid; gap: 5px; }
      .category-class-order > span { color: var(--ink); font-size: 12px; font-weight: 800; }
      .category-class-order > div { display: flex; gap: 5px; }
      .category-class-order .btn { min-height: 38px; padding: 7px 9px; font-size: 11px; }
      .category-manager-footer { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); background: var(--paper); padding: 14px 18px; }
      .category-manager-footer .primary { min-width: 230px; }
      .item-move-buttons { display: inline-grid; grid-template-rows: repeat(2, 34px); gap: 7px; align-self: center; }
      .item-move-buttons .btn.icon { width: 38px; min-height: 34px; padding: 3px; font-size: 17px; line-height: 1; }
      .context-order-list { display: grid; gap: 10px; }
      .context-order-row {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) auto;
        align-items: center;
        gap: 14px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: white;
        padding: 12px 14px;
      }

      .numbered-list {
        display: grid;
        gap: 12px;
        counter-reset: item;
      }

      .numbered-list > article {
        counter-increment: item;
        position: relative;
        padding-left: 58px;
      }

      .numbered-list > article::before {
        content: counter(item);
        position: absolute;
        left: 14px;
        top: 14px;
        display: grid;
        place-items: center;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: var(--wine-700);
        color: white;
        font-weight: 900;
      }

      .timer-face {
        --timer-angle: 0deg;
        --timer-green-angle: 0deg;
        position: relative;
        display: grid;
        place-items: center;
        width: min(100%, 310px);
        aspect-ratio: 1;
        margin: 18px auto 10px;
        border-radius: 50%;
        border: 1px solid var(--line);
        background:
          repeating-conic-gradient(rgba(59,13,22,.12) 0 1deg, transparent 1deg 15deg),
          conic-gradient(#41945f 0 var(--timer-green-angle), #ca4545 var(--timer-green-angle) var(--timer-angle), #fff var(--timer-angle) 360deg);
        box-shadow: 0 14px 30px rgba(59,13,22,.14);
      }
      .timer-face-inner {
        position: relative;
        z-index: 2;
        display: grid;
        place-items: center;
        gap: 4px;
        width: 76%;
        aspect-ratio: 1;
        border: 1px solid var(--line);
        border-radius: 50%;
        background: #fffdf9;
        box-shadow: inset 0 0 24px rgba(59,13,22,.08);
        animation: timerBreathe 3.6s ease-in-out infinite;
      }

      @keyframes timerBreathe {
        0%, 100% { box-shadow: inset 0 0 24px rgba(59, 13, 22, 0.08), 0 0 0 rgba(201, 154, 61, 0); }
        50% { box-shadow: inset 0 0 24px rgba(59, 13, 22, 0.08), 0 0 20px rgba(201, 154, 61, 0.22); }
      }
      .timer-face-inner > span { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; }
      .timer-hand {
        position: absolute;
        z-index: 3;
        left: calc(50% - 2px);
        bottom: 50%;
        width: 4px;
        height: 43%;
        border-radius: 999px;
        background: var(--wine-900);
        box-shadow: 0 0 0 1px rgba(255,255,255,.5);
        transform: rotate(var(--timer-angle));
        transform-origin: 50% 100%;
        transition: transform .35s linear, background .2s ease;
      }
      .timer-display {
        color: var(--wine-900);
        font-size: clamp(42px, 6vw, 68px);
        font-weight: 900;
        text-align: center;
        font-variant-numeric: tabular-nums;
      }
      .timer-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; color: var(--muted); font-size: 12px; text-align: center; }
      .timer-legend strong:first-of-type { color: #2d7f4a; }
      .timer-legend strong:last-of-type { color: #b32f3c; }

      @media (max-width: 960px) {
        .login, .app { grid-template-columns: 1fr; }
        .login-hero { min-height: 42vh; padding: 32px; }
        .sidebar { position: static; height: auto; }
        .grid.two, .grid.three, .grid.side { grid-template-columns: 1fr; }
        .tools-grid { grid-template-columns: 1fr; }
        .form-grid { grid-template-columns: 1fr; }
        .topbar { align-items: flex-start; flex-direction: column; }
        .subtree-dialog { inset: 10px; }
        .category-drawer { width: 100%; }
        .category-editor-item { grid-template-columns: 1fr auto; align-items: end; }
        .category-order-buttons { grid-column: 1; }
        .category-name-field { grid-column: 1 / -1; grid-row: 1; }
        .category-count { justify-self: start; }
        .category-add-box, .category-class-row { grid-template-columns: 1fr; }
        .category-class-number { display: none; }
        .category-class-order > div { display: grid; grid-template-columns: 1fr 1fr; }
        .category-manager-footer { flex-direction: column-reverse; }
        .category-manager-footer .btn { width: 100%; }
      }

      @media print {
        @page { size: A4 landscape; margin: 10mm; }
        body::before, body::after { display: none !important; }
        body > :not(#editorModal) { display: none !important; }
        #editorModal { position: static; display: block !important; background: white; }
        .print-preview-shell { position: static; display: block; overflow: visible; box-shadow: none; }
        .print-preview-toolbar { display: none; }
        .print-preview-scroll { overflow: visible; padding: 0; }
        .printable-activity { width: 100%; padding: 0; box-shadow: none; }
        .printable-lesson { width: 100%; padding: 0; box-shadow: none; }
        .printable-lesson > .print-lesson-head, .printable-lesson .print-activity-head, .printable-lesson .print-slide-page { width:100%; min-height:0; aspect-ratio:auto; margin:0; padding:0; overflow:visible; box-shadow:none; }
        .print-lesson-head { min-height: 0; break-after: page; }
        .print-lesson-activity { margin: 0; }
        .print-activity-head { break-after: page; }
        .print-slide-page { margin: 0; break-after: page; }
        .print-slide-page:last-of-type { break-after: auto; }
        .print-slide-page h2 { margin-top: 0; }
        .print-slide-canvas { width: 100%; }
        .board-controls { display: none; }
      }
