/* Tessaro - the portal's own look.
   Every colour comes from the theme (Settings > Theme), which _Layout writes out as --colour-*;
   the --t-* tokens below give each one its job, so a theme change reaches every screen. */

:root {
    --t-sidebar: var(--colour-Main);
    --t-sidebar-text: var(--colour-font-Main);
    --t-sidebar-muted: color-mix(in srgb, var(--t-sidebar-text) 58%, var(--t-sidebar));
    --t-sidebar-hover: color-mix(in srgb, var(--t-sidebar-text) 7%, var(--t-sidebar));
    --t-sidebar-active: color-mix(in srgb, var(--t-sidebar-text) 12%, var(--t-sidebar));
    --t-sidebar-rule: color-mix(in srgb, var(--t-sidebar-text) 12%, var(--t-sidebar));

    --t-topbar: var(--colour-MainAlt);
    --t-topbar-text: var(--colour-font-MainAlt);
    --t-topbar-rule: color-mix(in srgb, var(--t-topbar-text) 12%, var(--t-topbar));

    --t-accent: var(--colour-Sec);
    --t-accent-text: var(--colour-font-Sec, #fff);
    --t-accent-hover: color-mix(in srgb, var(--t-accent) 85%, #000);
    --t-accent-soft: color-mix(in srgb, var(--t-accent) 9%, var(--t-surface));
    --t-accent-ring: color-mix(in srgb, var(--t-accent) 28%, transparent);

    --t-bg: var(--colour-Back);
    --t-text: var(--colour-font-Back);
    --t-surface: var(--colour-Page);
    --t-surface-text: var(--colour-font-Page);
    --t-subtle: color-mix(in srgb, var(--t-surface-text) 3.5%, var(--t-surface));
    --t-border: color-mix(in srgb, var(--t-surface-text) 14%, var(--t-surface));
    --t-border-strong: color-mix(in srgb, var(--t-surface-text) 26%, var(--t-surface));
    --t-muted: color-mix(in srgb, var(--t-surface-text) 62%, var(--t-surface));
    --t-bg-muted: color-mix(in srgb, var(--t-text) 62%, var(--t-bg));

    --t-danger: #b42318;
    --t-danger-soft: #fef3f2;
    --t-success: #067647;
    --t-success-soft: #ecfdf3;
    --t-warning: #b54708;
    --t-warning-soft: #fffaeb;
    --t-info-soft: #eff8ff;
    --t-info: #175cd3;

    --t-radius: 6px;
    --t-radius-sm: 4px;
    --t-shadow-1: 0 1px 2px rgba(16, 24, 40, .06);
    --t-shadow-2: 0 1px 3px rgba(16, 24, 40, .08), 0 6px 16px rgba(16, 24, 40, .08);
    --t-shadow-3: 0 12px 32px rgba(16, 24, 40, .16);

    --t-topbar-h: 52px;
    --t-sidebar-w: 252px;
    --t-font: var(--portal-font-stack);
    --t-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;

    --portal-font-stack: var(--portal-font), "Segoe UI", system-ui, -apple-system, sans-serif;

    /* Bootstrap 5 reads these: its components follow the theme too */
    --bs-font-sans-serif: var(--portal-font-stack);
    --bs-body-font-family: var(--portal-font-stack);
    --bs-body-font-size: 14px;
    --bs-body-line-height: 1.5;
    --bs-body-color: var(--t-text);
    --bs-body-bg: var(--t-bg);
    --bs-border-color: var(--t-border);
    --bs-border-radius: var(--t-radius);
    --bs-border-radius-sm: var(--t-radius-sm);
    --bs-border-radius-lg: 8px;
    --bs-primary: var(--t-accent);
    --bs-primary-rgb: var(--colour-Sec-rgb);
    --bs-link-color: var(--t-accent);
    --bs-link-color-rgb: var(--colour-Sec-rgb);
    --bs-link-hover-color: var(--t-accent-hover);
    --bs-focus-ring-color: var(--t-accent-ring);
}

/* ---------------------------------------------------------------------------------------------- base */

html, body {
    font-family: var(--t-font);
}

body {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--t-text);
    background: var(--t-bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.005em;
    color: inherit;
}

a {
    color: var(--t-accent);
}

a:hover {
    color: var(--t-accent-hover);
}

:focus-visible {
    outline: 2px solid var(--t-accent);
    outline-offset: 2px;
}

code, pre, kbd {
    font-family: var(--t-mono);
}

::selection {
    background: color-mix(in srgb, var(--t-accent) 22%, transparent);
}

* {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, currentColor 22%, transparent) transparent;
}

/* Form fields on every page: background and text always set as a pair, so typed text stays
   legible under any theme. :where() keeps the long input selector as weak as a plain "input",
   so a form's own look (filled, underlined) can change it. */
:where(input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]):not([type=file]):not([type=submit]):not([type=button])),
textarea,
select,
.form-control,
.form-select {
    background-color: var(--t-surface);
    color: var(--t-surface-text);
}

input::placeholder,
textarea::placeholder,
.form-control::placeholder {
    color: var(--t-muted);
    opacity: 1;
}

select option {
    background-color: var(--t-surface);
    color: var(--t-surface-text);
}

.form-control,
.form-select {
    border: 1px solid var(--t-border-strong);
    border-radius: var(--t-radius);
    font-size: 14px;
    padding: .45rem .7rem;
    min-height: 36px;
    box-shadow: none;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--t-accent);
    box-shadow: 0 0 0 3px var(--t-accent-ring);
    background-color: var(--t-surface);
    color: var(--t-surface-text);
}

.form-control:disabled, .form-control[readonly],
.form-select:disabled {
    background-color: var(--t-subtle);
    color: var(--t-muted);
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: .3rem;
    color: inherit;
}

.form-text {
    color: var(--t-muted);
    font-size: 12.5px;
}

.form-check-input:checked {
    background-color: var(--t-accent);
    border-color: var(--t-accent);
}

.form-check-input:focus {
    border-color: var(--t-accent);
    box-shadow: 0 0 0 3px var(--t-accent-ring);
}

.btn {
    --bs-btn-font-size: 14px;
    --bs-btn-font-weight: 500;
    --bs-btn-padding-y: .42rem;
    --bs-btn-padding-x: .9rem;
    --bs-btn-border-radius: var(--t-radius);
    --bs-btn-focus-box-shadow: 0 0 0 3px var(--t-accent-ring);
}

.btn-primary {
    --bs-btn-color: var(--t-accent-text);
    --bs-btn-bg: var(--t-accent);
    --bs-btn-border-color: var(--t-accent);
    --bs-btn-hover-color: var(--t-accent-text);
    --bs-btn-hover-bg: var(--t-accent-hover);
    --bs-btn-hover-border-color: var(--t-accent-hover);
    --bs-btn-active-color: var(--t-accent-text);
    --bs-btn-active-bg: var(--t-accent-hover);
    --bs-btn-active-border-color: var(--t-accent-hover);
    --bs-btn-disabled-bg: var(--t-accent);
    --bs-btn-disabled-border-color: var(--t-accent);
    --bs-btn-disabled-color: var(--t-accent-text);
}

.btn-outline-primary {
    --bs-btn-color: var(--t-accent);
    --bs-btn-border-color: var(--t-accent);
    --bs-btn-hover-color: var(--t-accent-text);
    --bs-btn-hover-bg: var(--t-accent);
    --bs-btn-hover-border-color: var(--t-accent);
    --bs-btn-active-bg: var(--t-accent-hover);
    --bs-btn-active-border-color: var(--t-accent-hover);
}

.dropdown-menu {
    --bs-dropdown-bg: var(--t-surface);
    --bs-dropdown-color: var(--t-surface-text);
    --bs-dropdown-border-color: var(--t-border);
    --bs-dropdown-border-radius: var(--t-radius);
    --bs-dropdown-link-color: var(--t-surface-text);
    --bs-dropdown-link-hover-color: var(--t-surface-text);
    --bs-dropdown-link-hover-bg: var(--t-subtle);
    --bs-dropdown-link-active-color: var(--t-accent-text);
    --bs-dropdown-link-active-bg: var(--t-accent);
    --bs-dropdown-font-size: 14px;
    --bs-dropdown-item-padding-y: .4rem;
    --bs-dropdown-padding-y: .35rem;
    --bs-dropdown-divider-bg: var(--t-border);
    box-shadow: var(--t-shadow-2);
}

.dropdown-header {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--t-muted);
}

.modal-content {
    background: var(--t-surface);
    color: var(--t-surface-text);
    border: 1px solid var(--t-border);
    border-radius: 8px;
    box-shadow: var(--t-shadow-3);
}

.modal-header, .modal-footer {
    border-color: var(--t-border);
}

/* Tessaro.confirm (tessaro-ui.js) */
.t-confirm .modal-dialog {
    max-width: 420px;
}

.t-confirm .modal-body {
    padding: 1.25rem 1.25rem .5rem;
}

.t-confirm-title {
    margin: 0 0 .4rem;
    font-size: 16px;
    font-weight: 600;
}

.t-confirm-text {
    margin: 0;
    color: var(--t-muted);
    font-size: 14px;
}

.t-confirm .modal-footer {
    border-top: 0;
    padding: .75rem 1.25rem 1.1rem;
    gap: .5rem;
}

.offcanvas {
    --bs-offcanvas-bg: var(--t-surface);
    --bs-offcanvas-color: var(--t-surface-text);
    --bs-offcanvas-border-color: var(--t-border);
    box-shadow: var(--t-shadow-3);
}

.offcanvas-header {
    border-bottom: 1px solid var(--t-border);
}

.offcanvas-title {
    font-size: 16px;
    font-weight: 600;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: inherit;
    --bs-table-border-color: var(--t-border);
    --bs-table-striped-bg: var(--t-subtle);
    --bs-table-hover-bg: color-mix(in srgb, var(--t-accent) 6%, var(--t-surface));
    font-size: 13.5px;
}

.table > thead th {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--t-muted);
    background: var(--t-subtle);
    border-bottom-width: 1px;
    white-space: nowrap;
}

.alert {
    border-radius: var(--t-radius);
    border: 1px solid transparent;
    font-size: 14px;
    padding: .7rem .9rem;
}

.alert-danger {
    background: var(--t-danger-soft);
    border-color: color-mix(in srgb, var(--t-danger) 25%, #fff);
    color: var(--t-danger);
}

.alert-success {
    background: var(--t-success-soft);
    border-color: color-mix(in srgb, var(--t-success) 25%, #fff);
    color: var(--t-success);
}

.alert-warning {
    background: var(--t-warning-soft);
    border-color: color-mix(in srgb, var(--t-warning) 25%, #fff);
    color: var(--t-warning);
}

.alert-info {
    background: var(--t-info-soft);
    border-color: color-mix(in srgb, var(--t-info) 22%, #fff);
    color: var(--t-info);
}

.badge {
    font-weight: 600;
    border-radius: var(--t-radius-sm);
}

.nav-tabs {
    --bs-nav-tabs-border-color: var(--t-border);
    --bs-nav-tabs-link-active-color: var(--t-surface-text);
    --bs-nav-tabs-link-active-bg: var(--t-surface);
    --bs-nav-tabs-link-active-border-color: var(--t-border) var(--t-border) var(--t-surface);
    --bs-nav-link-color: var(--t-muted);
    --bs-nav-link-hover-color: var(--t-surface-text);
}

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--t-accent);
    --bs-nav-pills-link-active-color: var(--t-accent-text);
    --bs-nav-link-color: var(--t-surface-text);
}

/* ---------------------------------------------------------------------------------------------- buttons */

.t-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 36px;
    padding: 0 .95rem;
    border: 1px solid var(--t-border-strong);
    border-radius: var(--t-radius);
    background: var(--t-surface);
    color: var(--t-surface-text);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

.t-btn:hover {
    background: var(--t-subtle);
    color: var(--t-surface-text);
}

.t-btn:disabled, .t-btn.disabled {
    opacity: .55;
    cursor: not-allowed;
}

.t-btn-primary {
    background: var(--t-accent);
    border-color: var(--t-accent);
    color: var(--t-accent-text);
}

.t-btn-primary:hover {
    background: var(--t-accent-hover);
    border-color: var(--t-accent-hover);
    color: var(--t-accent-text);
}

.t-btn-ghost {
    background: transparent;
    border-color: transparent;
}

.t-btn-ghost:hover {
    background: color-mix(in srgb, currentColor 8%, transparent);
}

.t-btn-danger {
    color: var(--t-danger);
}

.t-btn-danger:hover {
    background: var(--t-danger-soft);
    border-color: color-mix(in srgb, var(--t-danger) 35%, #fff);
    color: var(--t-danger);
}

.t-btn-sm {
    min-height: 30px;
    padding: 0 .65rem;
    font-size: 13px;
}

.t-btn-block {
    width: 100%;
}

.t-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: var(--t-radius);
    background: transparent;
    color: inherit;
    font-size: 17px;
    cursor: pointer;
    transition: background-color .12s ease;
}

.t-icon-btn:hover {
    background: color-mix(in srgb, currentColor 9%, transparent);
}

.t-icon-btn:disabled {
    opacity: .5;
}

/* ---------------------------------------------------------------------------------------------- shell */

.t-shell {
    display: flex;
    min-height: 100vh;
}

.t-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
    width: var(--t-sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--t-sidebar);
    color: var(--t-sidebar-text);
    transition: transform .2s ease;
}

.t-sidebar.hiddenThis {
    transform: translateX(-100%);
}

.t-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    height: var(--t-topbar-h);
    padding: 0 1.1rem;
    flex: none;
    color: var(--t-sidebar-text);
    text-decoration: none;
    border-bottom: 1px solid var(--t-sidebar-rule);
}

.t-brand:hover {
    color: var(--t-sidebar-text);
}

.t-brand-mark {
    width: 26px;
    height: 26px;
    flex: none;
}

.t-brand-name {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .01em;
}

.t-brand-logo {
    display: block;
    max-width: 100%;
    max-height: 36px;
    object-fit: contain;
}

.t-brand.has-logo {
    height: auto;
    min-height: var(--t-topbar-h);
    padding: .7rem 1.1rem;
}

.t-brand.has-logo .t-brand-logo {
    max-height: 56px;
}

.t-nav {
    flex: 1;
    overflow-y: auto;
    padding: .6rem .6rem 1.5rem;
}

/* white label: under the menu, the platform it runs on */
.t-powered {
    flex: none;
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .7rem 1.1rem;
    border-top: 1px solid color-mix(in srgb, var(--t-sidebar-text) 12%, transparent);
    color: var(--t-sidebar-muted);
    font-size: 12px;
}

.t-powered .t-brand-mark {
    width: 14px;
    height: 14px;
}

.t-powered strong {
    font-weight: 600;
}

.t-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.t-nav-section {
    margin: 1.1rem .55rem .35rem;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--t-sidebar-muted);
}

.t-nav-section:first-child {
    margin-top: .45rem;
}

.t-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    min-height: 34px;
    padding: .38rem .55rem;
    border: 0;
    border-radius: var(--t-radius);
    background: transparent;
    color: var(--t-sidebar-text);
    font: inherit;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.t-nav-link:hover {
    background: var(--t-sidebar-hover);
    color: var(--t-sidebar-text);
}

.t-nav-link.active {
    background: var(--t-sidebar-active);
    font-weight: 500;
}

.t-nav-link.active::before {
    content: "";
    position: absolute;
    left: -.6rem;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--t-accent);
}

.t-nav-link > i:first-child, .t-nav-link > .t-icon-img:first-child {
    width: 18px;
    flex: none;
    text-align: center;
    font-size: 15px;
    opacity: .82;
}

.t-icon-img {
    display: inline-block;
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: -3px;
}

.t-nav-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.t-nav-caret {
    flex: none;
    font-size: 11px;
    opacity: .6;
    transition: transform .15s ease;
}

.t-nav-link[aria-expanded="true"] .t-nav-caret {
    transform: rotate(90deg);
}

.t-nav-children {
    margin-left: 1.05rem !important;
    padding-left: .55rem !important;
    border-left: 1px solid var(--t-sidebar-rule);
}

.t-nav-fav > i:first-child {
    color: #e3b341;
    opacity: 1;
}

.t-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--t-sidebar-w);
    display: flex;
    flex-direction: column;
    height: 100vh;
    transition: margin-left .2s ease;
}

.t-sidebar.hiddenThis ~ .t-main {
    margin-left: 0;
}

/* inside the portal's own frame: the page without a second menu and top bar */
.t-framed .t-sidebar,
.t-framed .t-topbar {
    display: none !important;
}

.t-framed .t-main {
    margin-left: 0;
}

.t-topbar {
    position: relative;
    z-index: 1020;
    flex: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    height: var(--t-topbar-h);
    padding: 0 .9rem 0 .6rem;
    background: var(--t-topbar);
    color: var(--t-topbar-text);
    border-bottom: 1px solid var(--t-topbar-rule);
}

.t-topbar-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 600;
}

.t-topbar-actions {
    display: flex;
    align-items: center;
    gap: .15rem;
}

.t-topbar-sep {
    width: 1px;
    height: 22px;
    margin: 0 .45rem;
    background: var(--t-topbar-rule);
}

.t-user {
    display: flex;
    align-items: center;
    gap: .55rem;
    height: 38px;
    padding: 0 .45rem 0 .3rem;
    border: 0;
    border-radius: var(--t-radius);
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.t-user:hover, .t-user[aria-expanded="true"] {
    background: color-mix(in srgb, currentColor 8%, transparent);
}

.t-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--t-accent);
    color: var(--t-accent-text);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}

.t-user-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
}

.t-user-menu {
    min-width: 230px;
}

.t-user-menu .dropdown-item i {
    width: 20px;
    margin-right: .45rem;
    color: var(--t-muted);
}

.t-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: var(--t-bg);
    color: var(--t-text);
}

.t-backdrop {
    display: none;
}

.t-plain {
    min-height: 100vh;
}

@media (max-width: 991.98px) {
    .t-main {
        margin-left: 0;
    }

    .t-sidebar {
        box-shadow: var(--t-shadow-3);
    }

    .t-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1025;
        background: rgba(15, 23, 32, .45);
    }

    .t-user-name {
        display: none;
    }
}

body.pdf-mode .t-content,
body.pdf-mode .tessaro_content {
    height: auto !important;
    overflow: visible !important;
}

/* The loading screen shown while a page reloads with new filters */
.t-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--t-bg) 70%, transparent);
}

.t-loading.show {
    display: flex;
}

.t-loading-box {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1.2rem;
    background: var(--t-surface);
    color: var(--t-surface-text);
    border: 1px solid var(--t-border);
    border-radius: 8px;
    box-shadow: var(--t-shadow-2);
    font-weight: 500;
}

.t-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--t-border-strong);
    border-top-color: var(--t-accent);
    border-radius: 50%;
    animation: t-spin .7s linear infinite;
}

@keyframes t-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------------------------------------------------------------------------------------------- building blocks */

.t-page {
    padding: 1.5rem 1.75rem 2.5rem;
}

.t-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.t-page-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.t-page-subtitle {
    margin: .2rem 0 0;
    color: var(--t-bg-muted);
    font-size: 14px;
}

.t-card {
    background: var(--t-surface);
    color: var(--t-surface-text);
    border: 1px solid var(--t-border);
    border-radius: 8px;
    box-shadow: var(--t-shadow-1);
}

.t-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--t-border);
}

.t-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.t-card-body {
    padding: 1.1rem;
}

.t-muted {
    color: var(--t-muted);
}

.t-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--t-muted);
}

.t-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--t-muted);
}

.t-empty i {
    display: block;
    margin-bottom: .5rem;
    font-size: 26px;
    opacity: .6;
}

.t-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .1rem .5rem;
    border: 1px solid var(--t-border);
    border-radius: 999px;
    background: var(--t-subtle);
    color: var(--t-muted);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.t-chip-accent {
    border-color: color-mix(in srgb, var(--t-accent) 30%, var(--t-surface));
    background: var(--t-accent-soft);
    color: var(--t-accent);
}

.t-kbd {
    padding: .05rem .35rem;
    border: 1px solid var(--t-border-strong);
    border-bottom-width: 2px;
    border-radius: var(--t-radius-sm);
    font-family: var(--t-mono);
    font-size: 11.5px;
}

/* ---------------------------------------------------------------------------------------------- sign-in, password and Setup pages */

.t-auth {
    display: grid;
    grid-template-columns: minmax(320px, 5fr) 7fr;
    min-height: 100vh;
}

.t-auth-side {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.25rem 2.5rem;
    background: var(--t-sidebar);
    color: var(--t-sidebar-text);
}

/* a quiet field of tiles, the mark's own shape */
.t-auth-side::after {
    content: "";
    position: absolute;
    right: -24px;
    bottom: -24px;
    width: 260px;
    height: 260px;
    background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--t-sidebar-text) 5%, transparent) 0 40px, transparent 40px 52px);
    -webkit-mask: repeating-linear-gradient(0deg, #000 0 40px, transparent 40px 52px);
    mask: repeating-linear-gradient(0deg, #000 0 40px, transparent 40px 52px);
    pointer-events: none;
}

.t-auth-side .t-brand {
    height: auto;
    padding: 0;
    border: 0;
}

.t-auth-side .t-brand-mark {
    width: 32px;
    height: 32px;
}

.t-auth-side .t-brand-name {
    font-size: 19px;
}

.t-auth-company {
    position: relative;
    z-index: 1;
    max-width: 26rem;
}

.t-auth-company h1 {
    margin: 0 0 .5rem;
    font-size: 26px;
    line-height: 1.25;
}

.t-auth-company p {
    margin: 0;
    color: var(--t-sidebar-muted);
    font-size: 15px;
}

.t-auth-foot {
    position: relative;
    z-index: 1;
    color: var(--t-sidebar-muted);
    font-size: 12.5px;
}

.t-auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: var(--t-surface);
    color: var(--t-surface-text);
}

.t-auth-form {
    width: 100%;
    max-width: 380px;
}

.t-auth-form h2 {
    margin: 0 0 .35rem;
    font-size: 22px;
}

.t-auth-form .t-lead {
    margin: 0 0 1.6rem;
    color: var(--t-muted);
}

.t-auth-form .form-control {
    min-height: 40px;
}

.t-auth-form .t-btn {
    min-height: 40px;
}

.t-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .3rem;
}

.t-auth-row .form-label {
    margin: 0;
}

.t-auth-link {
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.t-auth-note {
    margin-top: 1.5rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--t-border);
    color: var(--t-muted);
    font-size: 13px;
}

.t-auth-logo {
    max-width: 180px;
    max-height: 64px;
    object-fit: contain;
}

.t-auth-compact-brand {
    display: none;
    margin-bottom: 1.75rem;
}

@media (max-width: 860px) {
    .t-auth {
        grid-template-columns: 1fr;
    }

    .t-auth-side {
        display: none;
    }

    .t-auth-main {
        align-items: flex-start;
        padding-top: 3.5rem;
    }

    .t-auth-compact-brand {
        display: flex;
        align-items: center;
        gap: .6rem;
        color: var(--t-surface-text);
    }
}

/* a page shown inside the portal without the menu (errors, redirects) */
.t-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 2rem 1rem;
}

.t-message {
    max-width: 480px;
    text-align: center;
}

.t-message-code {
    font-family: var(--t-mono);
    font-size: 13px;
    color: var(--t-bg-muted);
    letter-spacing: .06em;
}

.t-message h1 {
    margin: .4rem 0 .6rem;
    font-size: 24px;
}

.t-message p {
    color: var(--t-bg-muted);
}

.t-form-title {
    margin: 0 0 .35rem;
    font-size: 22px;
}

.t-narrow-card {
    max-width: 440px;
    margin: 1rem auto 0;
    padding: 1.6rem;
}

.t-auth-logo-chip {
    align-self: flex-start;
    padding: .6rem .8rem;
    border-radius: 8px;
    background: #fff;
}

.t-lead {
    margin: 0 0 1.4rem;
    color: var(--t-muted);
}

/* Setup */
.t-setup .t-auth-main {
    align-items: flex-start;
    overflow-y: auto;
    max-height: 100vh;
}

.t-setup-form {
    width: 100%;
    max-width: 560px;
    padding: 1rem 0 3rem;
}

.t-fieldset {
    margin: 0 0 1.25rem;
    padding: 1.1rem 1.2rem 1.2rem;
    border: 1px solid var(--t-border);
    border-radius: 8px;
}

.t-fieldset legend {
    float: none;
    width: auto;
    margin: 0 0 .2rem -.35rem;
    padding: 0 .35rem;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
}

.t-fieldset legend i {
    margin-right: .4rem;
    color: var(--t-accent);
}

.t-test-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: 1rem;
}

.t-test-result {
    font-size: 13px;
    color: var(--t-muted);
}

.t-test-result.ok {
    color: var(--t-success);
}

.t-test-result.err {
    color: var(--t-danger);
}

.t-steps {
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.t-steps li {
    position: relative;
    padding: 0 0 1.1rem 2.6rem;
    counter-increment: step;
}

.t-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 26px;
    height: 26px;
    border: 1px solid var(--t-sidebar-rule);
    border-radius: 6px;
    display: grid;
    place-items: center;
    font-size: 12.5px;
    font-weight: 600;
}

.t-steps strong {
    display: block;
    font-weight: 600;
}

.t-steps span {
    color: var(--t-sidebar-muted);
    font-size: 13.5px;
}

/* a menu item that opens another site inside the portal */
.t-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* the welcome card, in the middle of the page */
.t-home {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

.t-home-card {
    width: 100%;
    max-width: 640px;
    padding: 2rem 2.2rem;
    margin-bottom: 6vh;
    text-align: center;
}

.t-home-logo {
    display: block;
    max-width: 200px;
    max-height: 64px;
    margin: 0 auto 1.4rem;
    object-fit: contain;
}

.t-home-title {
    margin: .3rem 0 .5rem;
    font-size: 26px;
}

/* Settings > Home page: the message and its buttons */
.t-home-message {
    overflow-wrap: anywhere;
}

.t-home-message > :last-child {
    margin-bottom: 0;
}

/* a list or table in the message stays readable: the block is centred, its lines start on the left */
.t-home-message ul,
.t-home-message ol {
    display: inline-block;
    text-align: left;
}

.t-home-message table {
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.t-home-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin-top: 1.2rem;
}

/* ---------------------------------------------------------------------------------------------- forms (Form elements) */

.element-form {
    overflow: auto !important;
    background: var(--t-surface);
    color: var(--t-surface-text);
    border: 1px solid var(--t-border);
    border-radius: 8px;
}

.tf-form {
    margin: 0;
}

.tf {
    /* a form can have its own accent (Style > Accent) */
    --t-accent: var(--tf-accent, var(--colour-Sec));
    --t-accent-hover: color-mix(in srgb, var(--t-accent) 85%, #000);
    --t-accent-soft: color-mix(in srgb, var(--t-accent) 9%, var(--t-surface));
    --t-accent-ring: color-mix(in srgb, var(--t-accent) 28%, transparent);
    --tf-radius: var(--t-radius);
    container-type: inline-size;
    padding: 1.4rem 1.5rem 1.5rem;
}

.tf .form-control, .tf .form-select {
    border-radius: var(--tf-radius);
}

.tf .form-control:focus, .tf .form-select:focus {
    border-color: var(--t-accent);
    box-shadow: 0 0 0 3px var(--t-accent-ring);
}

.tf-width-narrow {
    max-width: 640px;
}

.tf-width-medium {
    max-width: 860px;
}

.tf-square {
    --tf-radius: 0;
}

.tf-compact .tf-grid {
    gap: .6rem .8rem;
}

.tf-compact .form-control, .tf-compact .form-select {
    min-height: 32px;
    padding-top: .3rem;
    padding-bottom: .3rem;
}

.tf-look-filled .form-control, .tf-look-filled .form-select {
    border-color: transparent;
    border-bottom-color: var(--t-border-strong);
    background-color: color-mix(in srgb, var(--t-surface-text) 6%, var(--t-surface));
}

.tf-look-filled .form-control:hover, .tf-look-filled .form-select:hover {
    background-color: color-mix(in srgb, var(--t-surface-text) 9%, var(--t-surface));
}

.tf-look-filled .form-control:focus, .tf-look-filled .form-select:focus {
    background-color: var(--t-surface);
    border-color: var(--t-accent);
}

.tf-look-underlined .form-control, .tf-look-underlined .form-select {
    border-width: 0 0 1px;
    border-radius: 0;
    background-color: transparent;
    padding-left: .1rem;
}

.tf-labels-beside .tf-field:not(.tf-type-heading):not(.tf-type-note):not(.tf-type-divider):not(.tf-type-space) {
    display: grid;
    grid-template-columns: minmax(110px, 32%) minmax(0, 1fr);
    column-gap: 1rem;
    align-items: start;
}

.tf-labels-beside .tf-field > .tf-label {
    padding-top: .45rem;
}

.tf-labels-beside .tf-choices legend {
    float: left;
    width: 32%;
    padding-right: 1rem;
}

.tf-labels-beside .tf-choices .tf-control {
    margin-left: calc(32% + 0px);
}

.tf-messages:empty {
    display: none;
}

.tf-messages {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1.1rem;
}

.tf-message {
    padding: .6rem .8rem;
    border: 1px solid color-mix(in srgb, var(--t-info) 22%, #fff);
    border-radius: var(--t-radius);
    background: var(--t-info-soft);
    color: var(--t-info);
    font-size: 13.5px;
}

.tf-message-error {
    border-color: color-mix(in srgb, var(--t-danger) 25%, #fff);
    background: var(--t-danger-soft);
    color: var(--t-danger);
}

.tf-blocked {
    margin-right: auto;
    color: var(--t-danger);
    font-size: 13.5px;
}

.tf-blocked:empty {
    display: none;
}

.tf-field.is-locked .form-control, .tf-field.is-locked .form-select, .tf-field.is-locked .tf-choice, .tf-field.is-locked .tf-switch {
    background-color: var(--t-subtle);
    pointer-events: none;
}

.tf-head {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--t-border);
}

.tf-title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
}

.tf-intro {
    margin: .35rem 0 0;
    color: var(--t-muted);
    white-space: pre-line;
}

.tf-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.05rem 1rem;
}

.tf-field {
    grid-column: span var(--tf-span, 12);
    min-width: 0;
}

/* side by side only where there is room for it */
@container (max-width: 540px) {
    .tf-field {
        grid-column: span 12;
    }

    /* a space beside a field has nothing to keep free once fields stack */
    .tf-type-space:not([style*="--tf-span: 12"]) {
        display: none;
    }
}

.tf-field[hidden] {
    display: none;
}

.tf-label {
    display: block;
    margin-bottom: .32rem;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--t-surface-text);
}

.tf-required {
    margin-left: .2rem;
    color: var(--t-danger);
}

.tf-help {
    margin-top: .3rem;
    color: var(--t-muted);
    font-size: 12.5px;
}

.tf-error {
    margin-top: .3rem;
    color: var(--t-danger);
    font-size: 12.5px;
}

.tf-field.has-error .form-control,
.tf-field.has-error .form-select,
.tf-field.has-error .tf-signature {
    border-color: var(--t-danger);
}

.tf-section {
    margin: .4rem 0 0;
    padding-top: .2rem;
    font-size: 16px;
    font-weight: 600;
}

.tf-section-text, .tf-note {
    margin: .25rem 0 0;
    color: var(--t-muted);
    white-space: pre-line;
}

/* a space: the gaps around it count too */
.tf-space-small {
    height: 0;
}

.tf-space-medium {
    height: .75rem;
}

.tf-space-large {
    height: 2.25rem;
}

.tf-divider {
    margin: .2rem 0;
    border: 0;
    border-top: 1px solid var(--t-border);
    opacity: 1;
}

.tf-choices {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.tf-choices legend {
    float: none;
    width: auto;
    padding: 0;
}

.tf-choice {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin: 0;
    padding: .38rem .55rem;
    border-radius: var(--t-radius);
    cursor: pointer;
}

.tf-choice:hover {
    background: var(--t-subtle);
}

.tf-choice input {
    width: 16px;
    height: 16px;
    margin-top: .17rem;
    flex: none;
    accent-color: var(--t-accent);
}

/* the box is kept inside the switch: positioned against the page instead, it sat far below the
   portal's scrolling content on a long form, and clicking it scrolled the whole page away */
.tf-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
}

.tf-switch input {
    position: absolute;
    top: 0;
    left: 0;
    width: 38px;
    height: 22px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.tf-switch-track {
    position: relative;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: var(--t-border-strong);
    transition: background-color .15s ease;
}

.tf-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    transition: transform .15s ease;
}

.tf-switch input:checked + .tf-switch-track {
    background: var(--t-accent);
}

.tf-switch input:checked + .tf-switch-track::after {
    transform: translateX(16px);
}

.tf-switch input:focus-visible + .tf-switch-track {
    outline: 2px solid var(--t-accent);
    outline-offset: 2px;
}

.tf-signature {
    overflow: hidden;
    border: 1px solid var(--t-border-strong);
    border-radius: var(--t-radius);
    background: var(--t-surface);
}

.tf-signature-pad {
    display: block;
    width: 100%;
    height: 150px;
    touch-action: none;
    cursor: crosshair;
    background:
        linear-gradient(var(--t-border), var(--t-border)) 1.25rem calc(100% - 34px) / calc(100% - 2.5rem) 1px no-repeat;
}

.tf-signature-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .3rem .4rem .3rem .75rem;
    border-top: 1px solid var(--t-border);
    background: var(--t-subtle);
    color: var(--t-muted);
    font-size: 12.5px;
}

.tf-file-hint {
    margin-top: .3rem;
    color: var(--t-muted);
    font-size: 12.5px;
}

.tf-file-list {
    margin: .4rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.tf-file-list li {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .25rem 0;
    border-bottom: 1px dashed var(--t-border);
}

/* amounts: R 2 400 000.00 */
.tf-amount {
    display: flex;
    align-items: stretch;
}

.tf-prefix {
    display: flex;
    align-items: center;
    padding: 0 .65rem;
    border: 1px solid var(--t-border-strong);
    border-right: 0;
    border-radius: var(--tf-radius) 0 0 var(--tf-radius);
    background: var(--t-subtle);
    color: var(--t-muted);
    font-size: 13.5px;
}

.tf-prefix + .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.tf-amount .form-control,
.tf-gridtable .tf-num .form-control {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* calculated fields: worked out, not typed */
.tf-field[data-formula] .form-control,
.tf-gridtable .is-calculated .form-control {
    background: var(--t-subtle);
    color: var(--t-text);
}

.tf-kept {
    color: var(--t-text);
}

/* grids: rows people add */
.tf-gridscroll {
    overflow-x: auto;
    border: 1px solid var(--t-border-strong);
    border-radius: var(--tf-radius);
}

.tf-gridtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.tf-gridtable th {
    padding: .4rem .5rem;
    border-bottom: 1px solid var(--t-border);
    background: var(--t-subtle);
    color: var(--t-muted);
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.tf-gridtable th.tf-num {
    text-align: right;
}

.tf-gridtable td {
    padding: .25rem .3rem;
    border-bottom: 1px solid var(--t-border);
    vertical-align: middle;
    min-width: 7rem;
}

.tf-gridtable tbody tr:last-child td {
    border-bottom: 0;
}

.tf-gridtable td.tf-grid-check {
    min-width: 0;
    text-align: center;
}

.tf-gridtable .tf-grid-tools {
    width: 1%;
    min-width: 0;
    text-align: right;
}

.tf-gridbox.is-empty .tf-gridscroll {
    display: none;
}

.tf-grid-add {
    margin-top: .4rem;
}

.tf-gridbox.is-locked .tf-grid-add,
.tf-gridbox.is-locked .tf-grid-remove,
.tf-gridbox[data-fixed-rows] .tf-grid-add,
.tf-gridbox[data-fixed-rows] .tf-grid-remove {
    display: none;
}

/* a column a step shows but does not let people change */
.tf-gridtable .is-readonly .form-control,
.tf-gridtable .is-readonly .form-select {
    background-color: var(--t-subtle);
    pointer-events: none;
}

/* a read-only file or signature field at a step: its files, to open */
.tf-files {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    padding: .35rem 0;
}

.tf-file-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.tf-none {
    color: var(--t-muted);
}

.tf-save-draft {
    margin-right: auto;
}

.tf-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--t-border);
}

.tf-submit[disabled] {
    opacity: .7;
}

.tf-missing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    height: 100%;
    padding: 1rem;
    color: var(--t-muted);
    font-size: 13.5px;
    text-align: center;
}

code {
    color: inherit;
    font-size: .9em;
}

/* a form on a page of its own (a menu item of kind Form) */
.tf-page {
    max-width: 920px;
    margin: 0 auto;
}

.tf-page-card {
    overflow: hidden;
}

.tf-page-note {
    margin-bottom: 1rem;
}

.tf-sent {
    padding: 3rem 2rem;
    text-align: center;
}

.tf-sent h1 {
    margin: 1rem 0 .3rem;
    font-size: 20px;
}

.tf-sent-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--t-success-soft);
    color: var(--t-success);
    font-size: 28px;
}

/* ---------------------------------------------------------------------------------------------- Tasks */

.t-tasks-btn {
    position: relative;
    text-decoration: none;
}

.t-count {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid var(--t-topbar, var(--t-surface));
    border-radius: 999px;
    background: var(--t-accent);
    color: var(--t-accent-text);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
}

/* Designer > Monitor in the user menu: runs that need attention */
.t-user-menu .dropdown-item .t-count {
    position: static;
    display: inline-block;
    margin-left: .4rem;
    border: 0;
    background: var(--colour-Danger, #b42318);
    color: #fff;
    line-height: 17px;
}

.t-user {
    position: relative;
}

.t-user-dot {
    position: absolute;
    top: 3px;
    left: 26px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--t-topbar, var(--t-surface));
    border-radius: 50%;
    background: var(--colour-Danger, #b42318);
}

.tk-page {
    max-width: 1180px;
}

.tk-tabs {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--t-border);
}

.tk-tabs a {
    margin-bottom: -1px;
    padding: .5rem 0;
    border-bottom: 2px solid transparent;
    color: var(--t-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.tk-tabs a:hover {
    color: var(--t-text);
}

.tk-tabs a.active {
    border-bottom-color: var(--t-accent);
    color: var(--t-text);
}

.tk-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.tk-empty > i {
    color: var(--t-muted);
    font-size: 32px;
}

.tk-empty h2 {
    margin: .6rem 0 .3rem;
    font-size: 17px;
    font-weight: 600;
}

.tk-list {
    overflow: hidden;
}

.tk-item {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .8rem 1.1rem;
    color: inherit;
    text-decoration: none;
}

.tk-item + .tk-item {
    border-top: 1px solid var(--t-border);
}

.tk-item:hover {
    background: var(--t-subtle);
}

.tk-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--t-accent-soft);
    color: var(--t-accent);
    font-size: 17px;
}

.tk-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.tk-title {
    overflow: hidden;
    font-size: 14.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tk-meta {
    overflow: hidden;
    color: var(--t-muted);
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tk-side {
    display: flex;
    flex: none;
    align-items: center;
    gap: .7rem;
    font-size: 12.5px;
}

.tk-when {
    min-width: 72px;
    color: var(--t-muted);
    text-align: right;
}

.tk-due {
    color: var(--t-muted);
}

.tk-item.is-overdue .tk-due, .tk-overdue {
    color: var(--t-danger);
    font-weight: 600;
}

.tk-back {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .9rem;
    color: var(--t-muted);
    font-size: 13.5px;
    text-decoration: none;
}

.tk-back:hover {
    color: var(--t-text);
}

.tk-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.tk-kicker {
    margin-bottom: .2rem;
    color: var(--t-muted);
    font-size: 12.5px;
    font-weight: 500;
}

.tk-facts {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.1rem;
    margin-top: .45rem;
    color: var(--t-muted);
    font-size: 13px;
}

.tk-facts i {
    margin-right: .3rem;
}

.tk-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 1.25rem;
}

.tk-section {
    padding: 1.1rem 1.25rem;
}

.tk-section + .tk-section {
    margin-top: 1rem;
}

.tk-section h2, .tk-act h2 {
    margin: 0 0 .75rem;
    font-size: 15px;
    font-weight: 600;
}

.tk-instructions {
    margin: 0;
    white-space: pre-line;
}

.tk-answers {
    display: grid;
    grid-template-columns: minmax(120px, 34%) minmax(0, 1fr);
    gap: .55rem 1rem;
    margin: 0;
    font-size: 14px;
}

.tk-answers dt {
    color: var(--t-muted);
    font-weight: 500;
}

.tk-answers dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.tk-value {
    white-space: pre-line;
}

.tk-file {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin: 0 .6rem .2rem 0;
}

.tk-sofar {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 14px;
}

.tk-sofar li + li {
    margin-top: .6rem;
}

.tk-comment {
    margin: .3rem 0;
    padding: .45rem .65rem;
    border-left: 3px solid var(--t-border-strong);
    background: var(--t-subtle);
    white-space: pre-line;
}

.tk-act {
    position: sticky;
    top: 1rem;
    padding: 1.1rem 1.25rem;
}

.tk-take {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--t-border);
}

.tk-take p {
    font-size: 13.5px;
}

.tk-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .9rem;
}

@media (max-width: 900px) {
    .tk-grid {
        grid-template-columns: 1fr;
    }

    .tk-act {
        position: static;
    }

    .tk-side .tk-when {
        display: none;
    }
}

.tk-size {
    margin-right: 1rem;
    font-size: 12px;
}

/* the task's own card beside it stays in view; its details (priority, due, pass it on) under it */
.tk-aside {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tk-aside .tk-act {
    position: static;
}

.tk-change .tk-row + .tk-row {
    margin-top: .8rem;
    padding-top: .8rem;
    border-top: 1px solid var(--t-border);
}

.tk-change .form-label {
    margin-bottom: .25rem;
    font-size: 12.5px;
    color: var(--t-muted);
}

.tk-inline {
    display: flex;
    gap: .4rem;
}

.tk-pass {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.tk-pass .t-btn {
    align-self: flex-start;
}

.tk-fill .tf {
    margin-bottom: 1rem;
}

.tk-fill .tf-messages:empty {
    display: none;
}

.tk-priority {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .05rem .5rem;
    border-radius: 999px;
    background: var(--t-subtle);
    color: var(--t-muted);
    font-size: 12px;
    font-weight: 600;
}

.tk-priority-high {
    background: color-mix(in srgb, #d97706 14%, transparent);
    color: #b45309;
}

.tk-priority-urgent {
    background: color-mix(in srgb, var(--t-danger) 14%, transparent);
    color: var(--t-danger);
}

.tk-answers dd.tk-num .tk-value,
.tk-table .tk-num {
    font-variant-numeric: tabular-nums;
}

.tk-grid-answer {
    overflow-x: auto;
}

.tk-table {
    border-collapse: collapse;
    font-size: 13px;
}

.tk-table th,
.tk-table td {
    padding: .25rem .6rem .25rem 0;
    border-bottom: 1px solid var(--t-border);
    text-align: left;
}

.tk-table th {
    color: var(--t-muted);
    font-weight: 600;
}

.tk-table .tk-num {
    text-align: right;
}

.tk-doc {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.tk-note {
    color: var(--t-muted);
}

.tk-tools {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .6rem;
}

.tk-search {
    max-width: 320px;
}

.tk-list.tk-hide-workflow .tk-col-workflow,
.tk-list.tk-hide-for .tk-col-for,
.tk-list.tk-hide-priority .tk-col-priority,
.tk-list.tk-hide-due .tk-col-due,
.tk-list.tk-hide-since .tk-col-since {
    display: none;
}

.tk-none {
    padding: 1rem 1.25rem;
}

.tk-draft .tk-main {
    color: inherit;
    text-decoration: none;
}

@media (max-width: 900px) {
    .tk-aside {
        position: static;
    }
}

/* ---- Two-step sign-in (Pages/Authentication/TwoStep, TwoStepSetup) ------------------------------- */

.t-qr-steps {
    margin: 0 0 .8rem;
    padding-left: 1.2rem;
}

.t-qr-steps li {
    margin-bottom: .35rem;
}

.t-qr {
    width: 196px;
    margin: .4rem 0 .8rem;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--t-border);
    border-radius: 8px;
}

.t-qr svg {
    display: block;
    width: 100%;
    height: auto;
}

.t-qr-key {
    margin-bottom: 1.2rem;
    font-size: 13.5px;
}

.t-qr-key summary {
    color: var(--t-accent);
    cursor: pointer;
}

.t-qr-key code {
    display: inline-block;
    margin-top: .4rem;
    font-size: 14px;
    letter-spacing: .04em;
    word-break: break-all;
}

.t-code-input {
    max-width: 220px;
    font-size: 20px;
    letter-spacing: .15em;
}

.t-recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem 1.5rem;
    margin: 0 0 1rem;
    padding-left: 1.6rem;
}

.t-recovery-codes code {
    font-size: 15px;
    letter-spacing: .03em;
    color: var(--t-text);
}

.t-recovery-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}

.t-twostep-form {
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--t-border);
}

.t-twostep-form h3 {
    margin: 0 0 .25rem;
    font-size: 15px;
    font-weight: 600;
}

.t-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .35rem 1rem;
    margin: 0 0 .5rem;
}

.t-facts dt {
    font-weight: 500;
    color: var(--t-muted);
}

.t-facts dd {
    margin: 0;
}

/* printing the recovery codes: the codes only */
@media print {
    .t-sidebar, .t-topbar, .t-recovery-actions, .t-narrow-card .t-btn {
        display: none !important;
    }
}

/* the licence ends soon or has ended (_Layout, admins) */
.t-licence-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin: 0 0 1rem;
    font-size: 14px;
}

.t-licence-notice a {
    margin-left: auto;
    font-weight: 600;
}
