    /* ===========================================================
       Reading admin — Table completion editor
       =========================================================== */
    .rd-tc-scroll{
      overflow-x:auto;
      border:1px solid var(--rd-line);
      border-radius:8px;
      background:var(--rd-card);
    }
    .rd-tc-table{
      width:100%;
      border-collapse:separate;
      border-spacing:0;
      min-width:100%;
    }
    .rd-tc-table thead th.rd-tc-colctl{
      width:36px;
      padding:6px;
      background:var(--rd-card-tint);
      border-bottom:1px solid var(--rd-line);
      text-align:center;
    }
    .rd-tc-table thead th:last-child{
      width:36px;
      background:var(--rd-card-tint);
      border-bottom:1px solid var(--rd-line);
    }
    .rd-tc-table td{ padding:0; border-top:1px solid var(--rd-line); }
    .rd-tc-table tbody tr:first-child td{ border-top:none; }
    .rd-tc-cell{
      position:relative;
      vertical-align:middle;
      border-right:1px solid var(--rd-line);
      min-width:140px;
    }
    .rd-tc-cell:last-of-type{ border-right:none; }
    .rd-tc-input{
      width:100%;
      padding:10px 50px 10px 12px;
      background:transparent;
      color:var(--rd-text);
      border:none;
      outline:none;
      font-size:16px;
      font-family:inherit;
    }
    .rd-tc-input:focus{ background:var(--rd-card-tint); }
    .rd-tc-table tbody tr:first-child .rd-tc-input{ font-weight:700; }
    .rd-tc-gap-btn{
      position:absolute;
      right:4px; top:50%; transform:translateY(-50%);
      padding:2px 6px;
      background:var(--rd-card-tint);
      color:var(--rd-primary);
      border:1px solid var(--rd-line);
      border-radius:4px;
      font-size:13px;
      font-family:ui-monospace, SFMono-Regular, Menlo, 'Native Emoji', monospace;
      cursor:pointer;
      opacity:0;
      transition:opacity .15s;
    }
    .rd-tc-cell:hover .rd-tc-gap-btn,
    .rd-tc-input:focus + .rd-tc-gap-btn{ opacity:1; }
    .rd-tc-gap-btn:hover{ border-color:var(--rd-primary); background:var(--rd-card); }
    .rd-tc-rowctl{
      width:36px;
      padding:6px;
      background:var(--rd-card-tint);
      border-left:1px solid var(--rd-line);
      text-align:center;
    }

    /* Student-side table preview (used in admin preview pane) */
    .rd-pv-table{
      width:100%;
      border-collapse:collapse;
      margin-top:8px;
      font-size:16px;
    }
    .rd-pv-table th,
    .rd-pv-table td{
      padding:8px 10px;
      border:1px solid var(--rd-line);
      color:var(--rd-text);
      vertical-align:top;
      text-align:left;
    }
    .rd-pv-table th{ background:var(--rd-card-tint); font-weight:700; }

    /* Inline hint for the correct-answer rows */
    .rd-ca-hint{
      font-size:14px;
      color:var(--rd-muted);
      margin-left:8px;
      white-space:nowrap;
    }

    /* ===========================================================
       Dark-mode contrast fix for the rich-text editor.
       Word / Google Docs paste hard-codes color:rgb(0,0,0) (and
       sometimes a white background) on every span and paragraph,
       so on a dark canvas the typed text becomes invisible. Force
       readable foreground/background inside the contenteditable
       so the admin can actually see what they're writing.
       =========================================================== */
    [data-theme="dark"] .rd-rte,
    [data-theme="dark"] .rd-rte *{
      color: var(--rd-text) !important;
      background-color: transparent !important;
      caret-color: var(--rd-primary);
    }
    [data-theme="dark"] .rd-rte a{
      color: var(--rd-primary) !important;
      text-decoration: underline;
    }
    /* Bold/heading inline pastes often arrive with explicit colors too. */
    [data-theme="dark"] .rd-rte b,
    [data-theme="dark"] .rd-rte strong,
    [data-theme="dark"] .rd-rte h1,
    [data-theme="dark"] .rd-rte h2,
    [data-theme="dark"] .rd-rte h3{
      color: var(--rd-text) !important;
    }
    /* Tables pasted from Word carry their own borders/backgrounds. */
    [data-theme="dark"] .rd-rte table,
    [data-theme="dark"] .rd-rte th,
    [data-theme="dark"] .rd-rte td{
      border-color: var(--rd-line) !important;
      background-color: transparent !important;
    }
    /* Match the toolbar + scroll container to the dark canvas. */
    [data-theme="dark"] .rd-rte-wrap{ background: var(--rd-card); }
    [data-theme="dark"] .rd-rte{ background: var(--rd-card); }

    /* Same fix for the read-only preview pane on the right of question
       editors — the saved passage HTML re-renders there. */
    [data-theme="dark"] .rd-q-preview,
    [data-theme="dark"] .rd-q-preview *,
    [data-theme="dark"] .rd-pv-prompt,
    [data-theme="dark"] .rd-pv-prompt *{
      color: var(--rd-text) !important;
      background-color: transparent !important;
    }

