/* Contract terms library pages (/admin/event-terms and the clause page). */
    .tl-page { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 48px; }
    .tl-panel {
        background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(255,255,255,0.85));
        backdrop-filter: blur(20px);
        border: 1px solid rgba(0,0,0,0.06); border-radius: 16px; padding: 16px;
    }
    [data-theme="dark"] .tl-panel { background: linear-gradient(145deg, rgba(45,45,50,0.95), rgba(35,35,40,0.9)); border-color: rgba(255,255,255,0.08); }
    .tl-empty { padding: 18px 10px; color: var(--text-secondary, #6b7280); font-size: .85rem; }

    .tl-toolbar, .tl-tabs, .tl-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
    .tl-toolbar { gap: 10px; }
    .tl-push { margin-left: auto; }
    .tl-filter-label, .tl-vmeta { font-size: .76rem; color: var(--text-secondary, #6b7280); }
    .tl-pill {
        border: 1px solid rgba(0,0,0,0.1); background: rgba(0,0,0,0.03); border-radius: 999px;
        min-height: 38px; padding: 0 14px; font-size: .8rem; font-weight: 600; cursor: pointer;
        color: var(--text-secondary, #4b5563); display: inline-flex; align-items: center; gap: 6px;
    }
    .tl-pill.sm { min-height: 32px; padding: 0 12px; font-size: .76rem; }
    .tl-pill:hover { background: rgba(0,0,0,0.06); }
    .tl-pill.on { background: #111827; border-color: #111827; color: #fff; }
    .tl-pill.on.purple { background: #5a3aa8; border-color: #5a3aa8; }
    .tl-pill.dashed { border-style: dashed; }
    [data-theme="dark"] .tl-pill { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); color: #cbd5e1; }
    [data-theme="dark"] .tl-pill.on { background: #e5e7eb; border-color: #e5e7eb; color: #111827; }
    [data-theme="dark"] .tl-pill.on.purple { background: #8b6fd8; border-color: #8b6fd8; color: #fff; }
    .tl-count { font-size: .7rem; opacity: .7; font-variant-numeric: tabular-nums; }

    .tl-btn {
        min-height: 40px; padding: 0 16px; border-radius: 999px; font-size: .8rem; font-weight: 600; cursor: pointer;
        border: 1px solid rgba(0,0,0,0.12); background: transparent; color: inherit; display: inline-flex; align-items: center; gap: 6px;
    }
    .tl-btn:hover:not(:disabled) { background: rgba(0,0,0,0.05); }
    .tl-btn:disabled { opacity: .55; cursor: default; }
    .tl-btn.primary { background: var(--primary-color, #0366d6); border-color: var(--primary-color, #0366d6); color: #fff; }
    .tl-btn.success { background: #198754; border-color: #198754; color: #fff; }
    .tl-btn.danger { background: #dc3545; border-color: #dc3545; color: #fff; }
    .tl-btn.danger-outline { border-color: rgba(220,53,69,.5); color: #dc3545; }
    .tl-btn.primary:hover:not(:disabled), .tl-btn.success:hover:not(:disabled), .tl-btn.danger:hover:not(:disabled) { filter: brightness(1.08); }
    [data-theme="dark"] .tl-btn { border-color: rgba(255,255,255,0.18); }
    .tl-link { background: none; border: none; padding: 4px 6px; font-size: .8rem; font-weight: 600; color: var(--primary-color, #0366d6); cursor: pointer; border-radius: 6px; }
    .tl-link:hover { background: rgba(3,102,214,.08); }
    .tl-icon { width: 32px; height: 32px; border-radius: 999px; border: 1px solid rgba(0,0,0,0.1); background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
    .tl-icon:hover:not(:disabled) { background: rgba(0,0,0,0.05); }
    .tl-icon:disabled { opacity: .35; cursor: default; }
    [data-theme="dark"] .tl-icon { border-color: rgba(255,255,255,0.15); }

    .tl-tag { display: inline-flex; align-items: center; font-size: .7rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: rgba(108,117,125,.14); color: inherit; white-space: nowrap; }
    .tl-tag.purple { background: rgba(111,66,193,.14); color: #5a3aa8; }
    .tl-tag.blue { background: rgba(3,102,214,.1); color: #0550ae; }
    .tl-tag.green { background: rgba(25,135,84,.14); color: #146c43; }
    .tl-tag.amber { background: rgba(255,193,7,.22); color: #8a5a00; }
    .tl-tag.red { background: rgba(220,53,69,.14); color: #b02a37; }
    .tl-tag.dashed { background: transparent; border: 1px dashed rgba(108,117,125,.5); color: var(--text-secondary, #9aa4b1); }
    [data-theme="dark"] .tl-tag.purple { color: #c0a6f0; }
    [data-theme="dark"] .tl-tag.blue { color: #8cc1ff; }
    [data-theme="dark"] .tl-tag.green { color: #75d39b; }
    [data-theme="dark"] .tl-tag.amber { color: #ffd166; }
    [data-theme="dark"] .tl-tag.red { color: #ff8a95; }

    .tl-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; font-size: .82rem; background: rgba(255,193,7,.12); border: 1px solid rgba(255,193,7,.45); }
    .tl-banner .tl-link { color: #8a5a00; }
    [data-theme="dark"] .tl-banner .tl-link { color: #ffd166; }

    .tl-import h2, .tl-vhead h2, .tl-dhead h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
    .tl-import p, .tl-import ul { font-size: .85rem; max-width: 760px; margin: 10px 0; }

    /* Record list: one grid, subgrid rows, hairline dividers (Employees pattern). */
    .tl-list { display: grid; grid-template-columns: 44px minmax(0, 2.4fr) minmax(0, 1.2fr) minmax(0, 1.4fr) auto auto; column-gap: 18px; padding: 10px 6px; }
    .tl-cats { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; }
    .tl-list > .tl-row, .tl-list-head, .tl-list > .tl-foot, .tl-list > .tl-empty, .tl-list > .tl-preview-row { grid-column: 1 / -1; }
    .tl-list > .tl-row, .tl-list-head { display: grid; grid-template-columns: subgrid; align-items: center; }
    .tl-list-head { padding: 4px 10px 8px; border-bottom: 1px solid rgba(0,0,0,0.08); }
    .tl-list-head span { font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary, #9ca3af); white-space: nowrap; }
    .tl-row { padding: 10px; border-bottom: 1px solid rgba(0,0,0,0.06); font-size: .82rem; }
    .tl-row:hover { background: rgba(29,78,216,0.04); }
    [data-theme="dark"] .tl-list-head, [data-theme="dark"] .tl-row { border-color: rgba(255,255,255,0.08); }
    .tl-num { font-weight: 700; color: var(--text-secondary, #6b7280); font-variant-numeric: tabular-nums; }
    .tl-clause { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
    .tl-clause-title { font-weight: 600; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
    .tl-clause-preview { color: var(--text-secondary, #6b7280); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tl-scope { font-size: .76rem; color: var(--text-secondary, #4b5563); }
    .tl-langs, .tl-actions, .tl-row-actions { display: inline-flex; align-items: center; gap: 4px; }
    .tl-actions { justify-self: end; }
    .tl-row-actions { justify-content: flex-end; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
    .tl-foot { padding: 10px 10px 2px; font-size: .74rem; color: var(--text-secondary, #6b7280); }
    .tl-preview-row { padding: 6px 10px 14px; border-bottom: 1px solid rgba(0,0,0,0.06); }

    .tl-doc { white-space: pre-wrap; font-size: .82rem; line-height: 1.6; padding: 12px 14px; border-radius: 10px; background: rgba(0,0,0,0.025); border: 1px solid rgba(0,0,0,0.06); max-height: 520px; overflow-y: auto; }
    .tl-doc.before { background: rgba(220,53,69,.05); border-color: rgba(220,53,69,.25); text-decoration: line-through; text-decoration-color: rgba(220,53,69,.45); }
    .tl-doc.after { background: rgba(25,135,84,.06); border-color: rgba(25,135,84,.3); }
    [data-theme="dark"] .tl-doc { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.1); }

    .tl-versions { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
    .tl-vlist { flex: 1 1 300px; max-width: 400px; padding: 6px; display: flex; flex-direction: column; }
    .tl-vdetail { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
    .tl-vrow { text-align: left; background: none; border: none; border-bottom: 1px solid rgba(0,0,0,0.06); padding: 12px 12px; border-radius: 10px; display: flex; flex-direction: column; gap: 3px; color: inherit; cursor: pointer; }
    .tl-vrow:hover { background: rgba(0,0,0,0.04); }
    .tl-vrow.on { background: rgba(3,102,214,.08); }
    .tl-vtitle { font-weight: 700; display: inline-flex; gap: 8px; align-items: center; }
    .tl-vnote { font-size: .8rem; }
    .tl-vhead { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
    .tl-change { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid rgba(0,0,0,0.06); }
    .tl-change-head { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
    .tl-change-note { font-size: .78rem; color: var(--text-secondary, #4b5563); }
    .tl-publish { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: rgba(0,0,0,0.03); font-size: .82rem; }
    .tl-publish ul { margin: 0; padding-left: 18px; }
    .tl-stale { display: flex; flex-direction: column; margin-top: 6px; }
    .tl-stale-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 110px auto; gap: 12px; align-items: center; padding: 8px 6px; border-bottom: 1px solid rgba(0,0,0,0.06); color: inherit; text-decoration: none; border-radius: 8px; }
    .tl-stale-row:hover { background: rgba(29,78,216,0.05); color: inherit; }

    .tl-label { display: block; font-size: .74rem; font-weight: 600; color: var(--text-secondary, #4b5563); margin: 4px 0 6px; }
    .tl-label.m0 { margin: 0 6px 0 0; display: inline; }
    .tl-input { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.15); background: rgba(255,255,255,.9); color: inherit; font-size: .88rem; font-family: inherit; }
    .tl-input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
    [data-theme="dark"] .tl-input { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); }
    .tl-textarea { line-height: 1.55; resize: vertical; }
    .tl-select { width: auto; min-width: 200px; }
    .tl-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
    .tl-field { min-height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(3,102,214,.25); background: rgba(3,102,214,.05); color: #0550ae; font-size: .74rem; font-weight: 500; cursor: pointer; }
    .tl-field:hover { background: rgba(3,102,214,.12); }
    [data-theme="dark"] .tl-field { color: #8cc1ff; }
    .tl-warn { margin-top: 8px; font-size: .78rem; padding: 8px 10px; border-radius: 8px; background: rgba(255,193,7,.12); }
    .tl-check { display: flex; align-items: flex-start; gap: 8px; font-size: .82rem; min-height: 32px; cursor: pointer; }
    .tl-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: #5a3aa8; flex-shrink: 0; }
    .tl-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; padding: 12px; margin-top: 8px; border-radius: 12px; background: rgba(111,66,193,.06); }
    .tl-fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }

    @media (max-width: 899.98px) { /* breakpoint exception: list stacks where its columns stop fitting (Employees pattern) */
        .tl-list { display: block; }
        .tl-list-head { display: none; }
        .tl-list > .tl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
        .tl-clause { flex: 1 1 100%; order: -1; }
        .tl-num { order: -2; }
        .tl-actions { margin-left: auto; }
        .tl-stale-row { grid-template-columns: 80px minmax(0, 1fr); }
    }
    @media (max-width: 767.98px) {
        .tl-checks { grid-template-columns: minmax(0, 1fr); }
        .tl-vlist { max-width: none; }
    }

/* Clause page (/admin/event-terms/clauses/{id}): one column, readable width. */
.tl-editor { width: 100%; max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.tl-section { display: flex; flex-direction: column; gap: 8px; }
.tl-section > h2 { font-size: .95rem; font-weight: 700; margin: 0; }
.tl-section-sub { font-size: .76rem; color: var(--text-secondary, #6b7280); margin-top: -4px; }
.tl-savebar {
    position: sticky; bottom: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.96); backdrop-filter: blur(12px); box-shadow: 0 -4px 18px rgba(0,0,0,0.06);
}
[data-theme="dark"] .tl-savebar { background: rgba(38,38,43,0.96); border-color: rgba(255,255,255,0.1); }
.tl-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8rem; }
.tl-crumb a { color: var(--primary-color, #0366d6); font-weight: 600; text-decoration: none; }
.tl-crumb a:hover { text-decoration: underline; }
.tl-ehead { display: flex; flex-direction: column; gap: 6px; padding: 4px 2px 2px; }
.tl-ehead h1 { font-size: 1.45rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.tl-ehead-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-secondary, #6b7280); }
.tl-section { padding: 20px 22px; gap: 10px; }
.tl-section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tl-section-head h2 { font-size: .95rem; font-weight: 700; margin: 0; }
.tl-section-head .tl-seg { margin-left: auto; }
.tl-body { min-height: 220px; }

/* Segmented control (language). */
.tl-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(0,0,0,0.05); gap: 2px; }
.tl-seg button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; font-size: .78rem; font-weight: 600; color: var(--text-secondary, #4b5563); cursor: pointer; }
.tl-seg button.on { background: #fff; color: var(--text-primary, #111827); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
[data-theme="dark"] .tl-seg { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .tl-seg button { color: #cbd5e1; }
[data-theme="dark"] .tl-seg button.on { background: rgba(255,255,255,0.16); color: #fff; }

/* Choice cards (radio-like). */
.tl-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tl-choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tl-choice {
    text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; min-height: 64px;
    border-radius: 12px; border: 1.5px solid rgba(0,0,0,0.1); background: transparent; color: inherit; cursor: pointer;
}
.tl-choice strong { font-size: .85rem; }
.tl-choice small { font-size: .74rem; color: var(--text-secondary, #6b7280); line-height: 1.35; }
.tl-choice:hover:not(:disabled) { border-color: rgba(3,102,214,.45); }
.tl-choice.on { border-color: var(--primary-color, #0366d6); background: rgba(3,102,214,.06); box-shadow: 0 0 0 1px var(--primary-color, #0366d6) inset; }
.tl-choice:disabled { cursor: default; }
[data-theme="dark"] .tl-choice { border-color: rgba(255,255,255,0.14); }
[data-theme="dark"] .tl-choice.on { background: rgba(74,158,255,.12); }

/* Switch row. */
.tl-switch { display: flex; align-items: flex-start; gap: 12px; padding-top: 10px; margin-top: 4px; border-top: 1px solid rgba(0,0,0,0.06); cursor: pointer; }
.tl-switch input { appearance: none; flex-shrink: 0; width: 38px; height: 22px; border-radius: 999px; background: rgba(0,0,0,0.2); position: relative; cursor: pointer; transition: background .15s ease; margin-top: 1px; }
.tl-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s ease; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.tl-switch input:checked { background: var(--primary-color, #0366d6); }
.tl-switch input:checked::after { transform: translateX(16px); }
.tl-switch span { display: flex; flex-direction: column; gap: 1px; font-size: .84rem; }
.tl-switch small { font-size: .74rem; color: var(--text-secondary, #6b7280); }
[data-theme="dark"] .tl-switch { border-color: rgba(255,255,255,0.08); }

/* Preview as it prints. */
.tl-paper { background: #fff; color: #1f2733; border: 1px solid rgba(0,0,0,0.1); border-radius: 6px; padding: 22px 26px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); font-size: .86rem; line-height: 1.55; }
.tl-paper-title { font-weight: 700; }
.tl-paper-body { white-space: pre-wrap; }

@media (max-width: 767.98px) {
    .tl-choices, .tl-choices.three { grid-template-columns: minmax(0, 1fr); }
    .tl-section { padding: 16px; }
    .tl-section-head .tl-seg { margin-left: 0; }
}
