:root {
    --tmws-wine: #800020;
    --tmws-wine-dark: #5e0018;
    --tmws-black: #0a0305;
    --tmws-gold: #a8782e;
    --tmws-gold-light: #c9a96e;
    --tmws-ink: #1a1014;
    --tmws-muted: #6e6569;
    --tmws-line: rgba(128, 0, 32, .12);
    --tmws-line-gold: rgba(168, 120, 46, .22);
    --tmws-page: #f7f5f2;
    --tmws-surface: #fff;
    --tmws-soft: #fbf8f6;
    --tmws-sidebar: 238px;
    --tmws-radius: 10px;
    --tmws-shadow: 0 22px 64px rgba(42, 18, 26, .10);
    --tmws-font-ui: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
    --tmws-font-title: "Roboto Slab", Georgia, serif;
    --tmws-text-caption: 11px;
    --tmws-text-small: 13px;
    --tmws-text-label: 14px;
    --tmws-text-body: 15px;
    --tmws-text-action: 15px;
    --tmws-text-title: 20px;
    --tmws-control-height-compact: 38px;
    --tmws-control-height: 42px;
    --tmws-control-radius: 7px;
    --tmws-card-radius: 8px;
    --tmws-focus-ring: 0 0 0 3px rgba(128, 0, 32, .10);
    --tmws-danger: #8f2430;
    --tmws-danger-soft: #fff5f5;
    --tmws-success: #17653b;
}

html.tmws-app-maximized,
body.tmws-app-maximized {
    width: 100%;
    height: 100%;
    overflow: hidden !important;
}

body.tmws-no-scroll { overflow: hidden !important; }

body.tmws-app-page {
    background: var(--tmws-page) !important;
    overflow: hidden;
}

body.tmws-app-page #masthead,
body.tmws-app-page .site-header,
body.tmws-app-page .main-navigation,
body.tmws-app-page #site-navigation,
body.tmws-app-page .site-footer,
body.tmws-app-page .footer-widgets,
body.tmws-app-page .site-info,
body.tmws-app-page .tuca-main-menu,
body.tmws-app-page .tm-footerlike,
body.tmws-app-page .tm-service-footer,
body.tmws-app-page .entry-header {
    display: none !important;
}

body.tmws-app-page #page,
body.tmws-app-page #content,
body.tmws-app-page #primary,
body.tmws-app-page #main,
body.tmws-app-page .inside-article,
body.tmws-app-page .entry-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

body.tmws-app-page .entry-content > .tmws-root:first-child {
    margin-top: 0;
}

.tmws-root,
.tmws-root * { box-sizing: border-box; }

.tmws-root [hidden],
.tmws-sidebar-scrim[hidden],
.tmws-command[hidden],
.tmws-quick-action[hidden],
.tmws-action-toast[hidden],
.tmws-route-pending[hidden] { display: none !important; }

.tmws-root {
    position: relative;
    width: min(1760px, calc(100vw - 88px));
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    min-height: 0;
    margin: 12px 0 12px 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: var(--tmws-sidebar) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    color: var(--tmws-ink);
    background: var(--tmws-page);
    border: 1px solid var(--tmws-line-gold);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--tmws-shadow);
    font-family: var(--tmws-font-ui);
    font-size: 16px;
    line-height: 1.45;
    text-align: left;
}

/*
 * Workspace UI contract
 * ---------------------
 * `.tmws-ui-*` classes are the reusable primitives for new Workspace markup.
 * The composed plugins keep their public class names; the adapter farther below
 * aliases those names to the same primitives only while they live in Workspace.
 */
.tmws-ui-system .tmws-ui-button {
    min-height: var(--tmws-control-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--tmws-control-radius);
    font: 700 var(--tmws-text-action)/1 var(--tmws-font-ui);
    text-decoration: none;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.tmws-ui-system .tmws-ui-button--primary { color: #fff; background: var(--tmws-wine); border-color: var(--tmws-wine); }
.tmws-ui-system .tmws-ui-button--primary:not(:disabled):hover,
.tmws-ui-system .tmws-ui-button--primary:focus-visible { color: #fff; background: var(--tmws-wine-dark); border-color: var(--tmws-wine-dark); box-shadow: var(--tmws-focus-ring); outline: 0; }
.tmws-ui-system .tmws-ui-button--secondary { color: var(--tmws-ink); background: #fff; border-color: var(--tmws-line); }
.tmws-ui-system .tmws-ui-button--secondary:not(:disabled):hover,
.tmws-ui-system .tmws-ui-button--secondary:focus-visible { color: var(--tmws-wine); background: var(--tmws-soft); border-color: rgba(128, 0, 32, .34); box-shadow: var(--tmws-focus-ring); outline: 0; }
.tmws-ui-system .tmws-ui-field { min-height: var(--tmws-control-height); padding: 8px 10px; color: var(--tmws-ink); background: #fff; border: 1px solid var(--tmws-line); border-radius: var(--tmws-control-radius); font: 600 var(--tmws-text-body)/1.3 var(--tmws-font-ui); }
.tmws-ui-system .tmws-ui-card { background: var(--tmws-surface); border: 1px solid var(--tmws-line); border-radius: var(--tmws-card-radius); box-shadow: none; }
.tmws-ui-system .tmws-ui-label { color: var(--tmws-muted); font: 700 var(--tmws-text-label)/1.3 var(--tmws-font-ui); }
.tmws-ui-system .tmws-ui-help { color: var(--tmws-muted); font: 400 var(--tmws-text-small)/1.45 var(--tmws-font-ui); }

.tmws-root.is-maximized {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    width: auto;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    margin: 0;
    transform: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.tmws-root.is-maximized .tmws-sidebar { border-radius: 0; }
body.admin-bar .tmws-root.is-maximized {
    height: 100vh !important;
    height: 100dvh !important;
}

.tmws-root button,
.tmws-root input,
.tmws-root select,
.tmws-root textarea { font: inherit; }

.tmws-root button,
.tmws-root a { -webkit-tap-highlight-color: transparent; }

.tmws-root svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tmws-sidebar {
    position: relative;
    z-index: 40;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 20px 13px 15px;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 18%),
        linear-gradient(165deg, var(--tmws-black) 0%, #180007 58%, #430011 118%);
    border-right: 1px solid rgba(201, 169, 110, .24);
    border-radius: 13px 0 0 13px;
    overflow: hidden;
}

.tmws-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 7px 20px;
    border-bottom: 1px solid rgba(201, 169, 110, .18);
}

.tmws-brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
}

.tmws-brand-logo {
    display: block;
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.tmws-brand strong {
    display: block;
    max-width: 130px;
    color: #fff;
    font-family: var(--tmws-font-title);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
}

.tmws-sidebar-close { display: none; }

.tmws-nav {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 13px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 169, 110, .3) transparent;
}

.tmws-nav > p {
    margin: 18px 10px 7px;
    padding-top: 15px;
    color: rgba(201, 169, 110, .72);
    border-top: 1px solid rgba(201, 169, 110, .14);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.tmws-nav-item {
    position: relative;
    width: 100%;
    min-height: 51px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 2px 0;
    padding: 8px 9px;
    color: rgba(255, 255, 255, .72);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.tmws-nav-item:hover,
.tmws-nav-item:focus-visible {
    color: #fff;
    background: rgba(128, 0, 32, .28);
    border-color: rgba(201, 169, 110, .18);
    outline: none;
}

.tmws-nav-item.is-active {
    color: #fff;
    background: linear-gradient(90deg, rgba(128, 0, 32, .96), rgba(101, 0, 25, .76));
    border-color: rgba(201, 169, 110, .30);
    box-shadow: inset 3px 0 0 var(--tmws-gold-light), 0 8px 24px rgba(0, 0, 0, .12);
}

.tmws-nav-icon {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    display: grid;
    place-items: center;
    color: var(--tmws-gold-light);
}

.tmws-nav-icon svg { width: 18px; height: 18px; }
.tmws-nav-item > span:last-child { min-width: 0; flex: 1; }
.tmws-nav-item strong,
.tmws-nav-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmws-nav-item strong { color: inherit; font-size: var(--tmws-text-action); font-weight: 700; }
.tmws-nav-item > span:last-child > strong { display: flex; align-items: center; gap: 7px; overflow: visible; }
.tmws-nav-attention-count {
    min-width: 17px;
    height: 17px;
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    padding: 0 4px;
    margin-left: auto;
    color: #fff7df;
    background: #8a1635;
    border: 1px solid rgba(228, 196, 124, .72);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .22);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.tmws-nav-item.is-active .tmws-nav-attention-count { background: #5f081f; border-color: rgba(255, 231, 166, .88); }
.tmws-nav-item small { margin-top: 1px; color: rgba(255, 255, 255, .48); font-size: var(--tmws-text-small); }
.tmws-nav-item.is-active small { color: rgba(255, 255, 255, .66); }

.tmws-sidebar-tools { flex: 0 0 auto; margin-top: auto; padding-top: 11px; border-top: 1px solid rgba(201, 169, 110, .18); }
.tmws-sidebar-tools > p { margin: 0 8px 7px; color: rgba(201, 169, 110, .72); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.tmws-sidebar-action,
.tmws-sidebar-sync .trd-sync-all-btn {
    width: 100%;
    min-height: 40px !important;
    display: flex !important;
    align-items: center;
    gap: 9px;
    margin: 0 0 5px !important;
    padding: 7px 9px !important;
    color: rgba(255, 255, 255, .82) !important;
    background: rgba(255, 255, 255, .045) !important;
    border: 1px solid rgba(201, 169, 110, .16) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    cursor: pointer;
    text-align: left;
}
.tmws-sidebar-action:hover,
.tmws-sidebar-action:focus-visible,
.tmws-sidebar-sync .trd-sync-all-btn:hover,
.tmws-sidebar-sync .trd-sync-all-btn:focus-visible { color: #fff !important; background: rgba(128, 0, 32, .42) !important; border-color: rgba(201, 169, 110, .35) !important; outline: none; }
.tmws-sidebar-action > span { width: 24px; height: 24px; display: grid; place-items: center; color: var(--tmws-gold-light); }
.tmws-sidebar-action svg,
.tmws-sidebar-sync .trd-sync-all-btn svg { width: 16px !important; height: 16px !important; flex: 0 0 16px; color: var(--tmws-gold-light); }
.tmws-sidebar-action strong,
.tmws-sidebar-sync .trd-sync-all-btn span { flex: 1; font-size: var(--tmws-text-action) !important; font-weight: 700; }
.tmws-sidebar-action kbd { margin-left: auto; color: rgba(255, 255, 255, .48); background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .10); }
.tmws-sidebar-sync:empty { display: none; }
.tmws-sidebar-sync .trd-sync-wrap { width: 100%; display: block !important; }
.tmws-sidebar-sync .trd-sync-last-state { display: block; min-height: 0; margin: 0 7px 5px; color: rgba(255, 255, 255, .52); font-size: var(--tmws-text-caption); line-height: 1.4; }
.tmws-sidebar-health {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    margin-top: 7px;
    padding: 12px 10px 5px;
    border-top: 1px solid rgba(201, 169, 110, .13);
}

.tmws-health-item {
    --tmws-health-color: var(--tmws-gold-light);
    position: relative;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    justify-self: center;
    border-radius: 50%;
    cursor: help;
    outline: none;
}

.tmws-health-item--blue { --tmws-health-color: #58a9bd; }
.tmws-health-item--green { --tmws-health-color: #61b987; }
.tmws-health-item[data-state="loading"] { opacity: .58; }
.tmws-health-item[data-state="warning"] { --tmws-health-color: #d9a441; }
.tmws-health-item[data-state="error"] { --tmws-health-color: #dc6570; }

.tmws-health-pulse {
    position: relative;
    width: 9px;
    height: 9px;
    display: block;
    background: var(--tmws-health-color);
    border: 1px solid rgba(255, 255, 255, .36);
    border-radius: 50%;
    box-shadow: 0 0 12px color-mix(in srgb, var(--tmws-health-color) 65%, transparent);
}

.tmws-health-pulse::after {
    content: '';
    position: absolute;
    inset: -5px;
    border: 1px solid var(--tmws-health-color);
    border-radius: inherit;
    animation: tmws-health-pulse 2.4s cubic-bezier(.2, .7, .2, 1) infinite;
}

.tmws-health-item:nth-child(2) .tmws-health-pulse::after { animation-delay: .45s; }
.tmws-health-item:nth-child(3) .tmws-health-pulse::after { animation-delay: .9s; }

.tmws-health-item:focus-visible {
    box-shadow: 0 0 0 2px rgba(201, 169, 110, .38);
}

.tmws-account-menu { position: relative; min-width: 0; }
.tmws-account-card {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 9px;
    margin-top: 8px;
    padding: 9px;
    color: #fff;
    background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(201,169,110,.055));
    border: 1px solid rgba(201,169,110,.20);
    border-radius: 10px;
    box-shadow: inset 0 1px rgba(255,255,255,.035);
    font: inherit;
    appearance: none;
    text-align: left;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.tmws-account-card:hover,
.tmws-account-card:focus-visible,
.tmws-account-card[aria-expanded="true"] { background: linear-gradient(135deg, rgba(128,0,32,.48), rgba(201,169,110,.10)); border-color: rgba(201,169,110,.38); outline: 0; }
.tmws-account-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #351018;
    background: linear-gradient(145deg, #f5e5bd, #c9a96e);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 50%;
    font-family: var(--tmws-font-title);
    font-size: 15px;
    box-shadow: 0 6px 14px rgba(0,0,0,.18);
}
.tmws-account-card > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.tmws-account-card strong,
.tmws-account-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmws-account-card strong { color: rgba(255,255,255,.92); font-size: 11px; }
.tmws-account-card small { color: rgba(226,199,142,.70); font-size: 9px; letter-spacing: .04em; }
.tmws-account-chevron {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,.62) !important;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 7px;
    transform: rotate(-90deg);
    transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.tmws-account-card[aria-expanded="true"] .tmws-account-chevron { color: #fff !important; background: rgba(128,0,32,.62); border-color: rgba(201,169,110,.36); }
.tmws-account-chevron svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.tmws-account-popover {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 125;
    width: min(100%, 224px);
    padding: 11px;
    color: #302527;
    background: rgba(255, 253, 248, .99);
    border: 1px solid rgba(201,169,110,.48);
    border-radius: 11px;
    box-shadow: 0 18px 42px rgba(0,0,0,.28);
}
.tmws-account-popover > span { display: block; color: #8a7774; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.tmws-account-popover > strong { display: block; margin: 3px 0 10px; color: #261c1e; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmws-account-popover button {
    width: 100%;
    padding: 9px 10px;
    color: #790020;
    background: #fff6f6;
    border: 1px solid rgba(128,0,32,.15);
    border-radius: 8px;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}
.tmws-account-popover button:hover,
.tmws-account-popover button:focus-visible { color: #fff; background: #800020; outline: 0; }

.tmws-logout-dialog { position: fixed; inset: 0; z-index: 100010; display: grid; place-items: center; padding: 20px; }
.tmws-logout-dialog__backdrop { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; background: rgba(21,7,11,.72); border: 0; backdrop-filter: blur(8px); cursor: default; }
.tmws-logout-dialog__card {
    position: relative;
    z-index: 1;
    width: min(100%, 460px);
    display: grid;
    grid-template-columns: 48px minmax(0,1fr);
    gap: 16px;
    padding: 24px;
    color: #2b2022;
    background: linear-gradient(145deg, #fffdfa, #f8f1e7);
    border: 1px solid rgba(201,169,110,.58);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(22,5,9,.42);
}
.tmws-logout-dialog__icon { width: 48px; height: 48px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,#9b002a,#650018); border-radius: 14px; font-size: 22px; }
.tmws-logout-dialog__card > div > span { color: #9b7b46; font-size: 10px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.tmws-logout-dialog__card h2 { margin: 4px 0 7px; color: #21181a; font-size: 23px; line-height: 1.1; }
.tmws-logout-dialog__card p { margin: 0; color: #756a68; font-size: 13px; line-height: 1.55; }
.tmws-logout-dialog__actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; margin-top: 6px; }
.tmws-logout-dialog__actions button,
.tmws-logout-dialog__actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 14px; border-radius: 9px; font: inherit; font-size: 12px; font-weight: 800; text-decoration: none !important; cursor: pointer; }
.tmws-logout-dialog__actions button { color: #594d4f; background: #fff; border: 1px solid #ddd1c3; }
.tmws-logout-dialog__actions a { color: #fff !important; background: #800020; border: 1px solid #800020; box-shadow: 0 8px 20px rgba(128,0,32,.18); }
.tmws-logout-dialog__actions button:hover,
.tmws-logout-dialog__actions button:focus-visible { border-color: #b99a62; outline: 0; }
.tmws-logout-dialog__actions a:hover,
.tmws-logout-dialog__actions a:focus-visible { background: #650018; outline: 2px solid rgba(201,169,110,.42); outline-offset: 2px; }

.tmws-health-tooltip {
    position: absolute;
    bottom: calc(100% + 9px);
    left: 0;
    z-index: 120;
    width: 196px;
    padding: 10px 11px;
    color: #2c2426;
    background: rgba(255, 255, 255, .985);
    border: 1px solid rgba(201, 169, 110, .56);
    border-radius: 9px;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .27);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.tmws-health-item:nth-child(2) .tmws-health-tooltip { left: 50%; transform: translate(-50%, 5px); }
.tmws-health-item:nth-child(3) .tmws-health-tooltip { right: 0; left: auto; }
.tmws-health-item:hover .tmws-health-tooltip,
.tmws-health-item:focus .tmws-health-tooltip { opacity: 1; visibility: visible; transform: translateY(0); }
.tmws-health-item:nth-child(2):hover .tmws-health-tooltip,
.tmws-health-item:nth-child(2):focus .tmws-health-tooltip { transform: translate(-50%, 0); }
.tmws-health-tooltip strong,
.tmws-health-tooltip small { display: block; }
.tmws-health-tooltip strong { color: var(--tmws-wine); font-size: 11px; font-weight: 800; line-height: 1.35; }
.tmws-health-tooltip small { margin-top: 3px; color: #675d60; font-size: 10px; line-height: 1.45; }

@keyframes tmws-health-pulse {
    0% { opacity: .72; transform: scale(.62); }
    70%, 100% { opacity: 0; transform: scale(1.55); }
}

.tmws-main { min-width: 0; min-height: 0; max-height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; background: var(--tmws-page); }

.tmws-topbar {
    position: relative;
    top: auto;
    z-index: 30;
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 15px 24px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--tmws-line-gold);
    backdrop-filter: blur(16px);
}

.tmws-heading { min-width: 0; }
.tmws-heading > span {
    display: block;
    margin-bottom: 2px;
    color: var(--tmws-wine);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.tmws-heading h1 {
    margin: 0;
    overflow: hidden;
    color: var(--tmws-ink);
    font-family: var(--tmws-font-title);
    font-size: clamp(22px, 2vw, 29px);
    font-weight: 400;
    line-height: 1.14;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tmws-heading p {
    margin: 4px 0 0;
    color: var(--tmws-muted);
    font-size: 12px;
    line-height: 1.35;
}

.tmws-topbar-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; margin-left: auto; }

.tmws-window-controls {
    order: 99;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-left: 3px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 10px;
}

.tmws-window-controls button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--tmws-wine);
    background: #fff;
    border: 1px solid rgba(128, 0, 32, .16);
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(42, 18, 26, .06);
    cursor: pointer;
}

.tmws-window-controls button svg { width: 17px; height: 17px; stroke-width: 1.9; }
.tmws-window-controls button:hover:not(:disabled),
.tmws-window-controls button:focus-visible { color: #fff; background: var(--tmws-wine); border-color: var(--tmws-wine); outline: 2px solid rgba(168, 120, 46, .35); outline-offset: 2px; }
.tmws-window-controls button:disabled { display: none; }

.tmws-context-pill {
    min-width: 150px;
    max-width: 230px;
    padding: 7px 10px;
    color: var(--tmws-ink) !important;
    background: #fffaf2;
    border: 1px solid var(--tmws-line-gold);
    border-radius: 8px;
    text-decoration: none !important;
}
.tmws-context-pill span,
.tmws-context-pill strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmws-context-pill span { color: var(--tmws-gold); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tmws-context-pill strong { margin-top: 1px; font-size: 11px; }
.tmws-context-pill:hover,
.tmws-context-pill:focus-visible { border-color: rgba(128, 0, 32, .34); outline: 3px solid rgba(128, 0, 32, .08); }

.tmws-search-button,
.tmws-primary-button {
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border-radius: 7px;
    cursor: pointer;
    font-size: var(--tmws-text-action);
}
.tmws-search-button { color: #51474c; background: var(--tmws-soft); border: 1px solid var(--tmws-line); }
.tmws-search-button svg { width: 16px; height: 16px; }
.tmws-root kbd {
    min-width: 22px;
    padding: 2px 5px;
    color: inherit;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(128, 0, 32, .12);
    border-radius: 4px;
    box-shadow: none;
    font: 10px/1.4 var(--tmws-font-ui);
    text-align: center;
}
.tmws-search-button kbd { margin-left: 6px; color: #81757a; }
.tmws-primary-button {
    padding-inline: 15px;
    color: #fff !important;
    background: var(--tmws-wine);
    border: 1px solid var(--tmws-wine);
    font-weight: 700;
}
.tmws-primary-button:hover,
.tmws-primary-button:focus-visible { color: #fff; background: var(--tmws-wine-dark); outline: 2px solid rgba(168, 120, 46, .35); outline-offset: 2px; }
.tmws-primary-button svg { width: 16px; height: 16px; stroke-width: 2; }

.tmws-new-wrap { position: relative; }

.tmws-content { min-width: 0; min-height: 0; padding: 18px; overflow: auto; overscroll-behavior: contain; }
.tmws-root.is-maximized .tmws-content.tmws-content--max-fit { overflow-y: clip; }
.tmws-panel { min-width: 0; }
.tmws-panel.is-active { animation: tmws-enter .18s ease both; }
@keyframes tmws-enter { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

.tmws-module-surface {
    min-width: 0;
    width: 100%;
    padding: 18px;
    background: var(--tmws-surface);
    border: 1px solid var(--tmws-line);
    border-radius: var(--tmws-radius);
    box-shadow: 0 14px 42px rgba(42, 18, 26, .055);
}

/* Dosarele și clienții sunt două perspective ale aceluiași registru. */
.tmws-root[data-active-view="dosare"] .tmws-content,
.tmws-root[data-active-view="clienti"] .tmws-content { overflow: hidden; }
.tmws-panel--directory { height: 100%; min-height: 0; }
.tmws-panel--directory .tmws-module-surface {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 0;
    overflow: hidden;
}
.tmws-directory-toolbar {
    position: relative;
    z-index: 3;
    min-height: 55px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px 0;
}
.tmws-directory-switch {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(112px, 1fr));
    gap: 3px;
    padding: 3px;
    background: #eee9e6;
    border: 1px solid rgba(128, 0, 32, .09);
    border-radius: 9px;
}
.tmws-directory-actions { min-width: 0; margin-left: auto; }
.tmws-directory-actions:empty { display: none; }
.tmws-directory-actions .trd-sync-wrap { display: flex; align-items: center; gap: 8px; }
.tmws-directory-actions .trd-sync-all-btn { display: inline-flex !important; align-items: center; gap: 8px !important; }
.tmws-directory-actions .trd-sync-last-state { max-width: 220px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tmws-directory-switch button {
    min-height: 34px;
    padding: 6px 18px;
    color: #695e63;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: var(--tmws-text-action);
    font-weight: 700;
    transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.tmws-directory-switch button:hover { color: var(--tmws-wine); }
.tmws-directory-switch button:focus-visible { outline: 2px solid rgba(128, 0, 32, .32); outline-offset: 1px; }
.tmws-directory-switch button.is-active {
    color: var(--tmws-ink);
    background: #fff;
    box-shadow: 0 1px 5px rgba(42, 18, 26, .13);
}
.tmws-directory-scroll {
    min-height: 0;
    padding: 14px 18px 18px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(128, 0, 32, .32) transparent;
}
.tmws-directory-scroll::-webkit-scrollbar { width: 10px; }
.tmws-directory-scroll::-webkit-scrollbar-thumb { background: rgba(128, 0, 32, .25); border: 3px solid transparent; border-radius: 99px; background-clip: padding-box; }

/* Common adapter: the old modules keep their behavior, but share one visual surface. */
.tmws-module-surface > .trd-app,
.tmws-module-surface > .tmcb-today,
.tmws-module-surface > .tmcb-client-profile,
.tmws-module-surface > .tfc-app,
.tmws-module-surface > .tvc-app,
.tmws-module-surface > [data-tvc-app] {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    color: var(--tmws-ink) !important;
    font-family: var(--tmws-font-ui) !important;
}

.tmws-module-surface .trd-app {
    --trd-red: var(--tmws-wine);
    --trd-red-dark: var(--tmws-wine-dark);
    --trd-gold: var(--tmws-gold);
    --trd-ink: var(--tmws-ink);
    --trd-muted: var(--tmws-muted);
    --trd-line: rgba(128, 0, 32, .12);
    --trd-soft: var(--tmws-soft);
}
.tmws-module-surface .tfc-app {
    --tfc-red: var(--tmws-wine);
    --tfc-red-dark: var(--tmws-wine-dark);
    --tfc-gold: var(--tmws-gold);
    --tfc-ink: var(--tmws-ink);
    --tfc-muted: var(--tmws-muted);
    --tfc-line: rgba(128, 0, 32, .12);
    --tfc-soft: var(--tmws-soft);
}
.tmws-module-surface .tvc-app {
    --tvc-red: var(--tmws-wine);
    --tvc-red-dark: var(--tmws-wine-dark);
    --tvc-gold: var(--tmws-gold);
    --tvc-ink: var(--tmws-ink);
    --tvc-muted: var(--tmws-muted);
    --tvc-line: rgba(128, 0, 32, .12);
    --tvc-soft: var(--tmws-soft);
}

.tmws-module-surface .trd-shell,
.tmws-module-surface .tfc-shell,
.tmws-module-surface .tvc-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.tmws-module-surface .tmcb-client-profile-hero,
.tmws-module-surface .tmcb-today-title { display: none !important; }

.tmws-module-surface .trd-topbar,
.tmws-module-surface .tfc-topbar,
.tmws-module-surface .tvc-topbar {
    min-height: 0;
    justify-content: flex-end;
    margin: 0 0 14px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--tmws-line);
}

.tmws-module-surface--calendar .trd-topbar { justify-content: flex-start; }
.tmws-ui-system .tmws-module-surface--calendar .trd-calendar-summary .trd-calendar-source::before {
    display: none !important;
    content: none !important;
}
.tmws-module-surface .tmcb-today-hero { grid-template-columns: 1fr; padding: 0; background: transparent; border: 0; box-shadow: none; }
.tmws-module-surface .tmcb-today-metrics { width: 100%; }

.tmws-today-case-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 14px;
    padding: 16px 18px;
    background:
        radial-gradient(circle at 8% 0, rgba(201, 169, 110, .22), transparent 28%),
        linear-gradient(135deg, #fffaf6 0%, #fff 52%, #fbf2f5 100%);
    border: 1px solid rgba(128, 0, 32, .14);
    border-left: 4px solid var(--tmws-wine);
    border-radius: 13px;
    box-shadow: 0 18px 44px rgba(58, 28, 36, .07);
}

.tmws-today-case-banner > div:first-child {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.tmws-today-case-banner span {
    color: var(--tmws-gold);
    font-size: var(--tmws-text-caption);
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.tmws-today-case-banner strong {
    color: var(--tmws-ink);
    font: 600 21px/1.15 var(--tmws-font-title);
}

.tmws-today-case-banner small {
    max-width: 760px;
    color: var(--tmws-muted);
    font-size: var(--tmws-text-small);
    font-weight: 600;
    line-height: 1.45;
}

.tmws-today-case-banner__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Radar in the registry: no duplicated create/search/deadline controls, more room for the inventory. */
.tmws-module-surface--dosare [data-open-form],
.tmws-module-surface--dosare .trd-upcoming-widget { display: none !important; }
.tmws-module-surface--dosare .trd-topbar { display: none !important; }
.tmws-module-surface--dosare .trd-stats { gap: 9px; margin: 0 0 12px; }
.tmws-module-surface--dosare .trd-stats button { min-height: 66px; padding: 11px 13px; }
.tmws-module-surface--dosare .trd-stats strong { font-size: 22px; }
.tmws-module-surface--dosare .trd-stats span { margin-top: 3px; font-size: 11px; }
.tmws-module-surface--dosare .tmws-status-count { display: none; }
.tmws-module-surface--dosare .trd-filters { margin: 12px 0; }
.tmws-module-surface--dosare .trd-filter-row { padding-block: 7px; }
.tmws-module-surface--dosare .trd-app .trd-filter-row--court .trd-court-tabs { display: none !important; }
.tmws-module-surface--dosare .trd-app .trd-filter-row--court .trd-court-select {
    width: 390px !important;
    max-width: 100%;
    flex: 0 1 390px;
    min-height: 40px;
    display: block !important;
    padding: 7px 38px 7px 12px;
    color: var(--tmws-ink);
    background-color: #fff;
    border: 1px solid rgba(128, 0, 32, .18);
    border-radius: 7px;
    box-shadow: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}
.tmws-module-surface--dosare .trd-app .trd-filter-row--court .trd-court-select:hover { border-color: rgba(128, 0, 32, .38); }
.tmws-module-surface--dosare .trd-app .trd-filter-row--court .trd-court-select:focus-visible { border-color: var(--tmws-wine); outline: 3px solid rgba(128, 0, 32, .10); }

/* Desktop registry: four owner filters become two balanced rows in Workspace. */
@media (min-width: 960px) {
    .tmws-module-surface--dosare .trd-filters {
        display: grid;
        grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr);
    }
    .tmws-module-surface--dosare .trd-filters-header { display: none; }
    .tmws-module-surface--dosare .trd-filter-row {
        min-width: 0;
        padding: 10px 14px;
    }
    .tmws-module-surface--dosare .trd-filter-row:nth-child(2),
    .tmws-module-surface--dosare .trd-filter-row:nth-child(4) { border-right: 1px solid var(--tmws-line); }
    .tmws-module-surface--dosare .trd-filter-row:nth-child(4),
    .tmws-module-surface--dosare .trd-filter-row:nth-child(5) { border-bottom: 0; }
    .tmws-module-surface--dosare .trd-filter-label { width: 58px; }
    .tmws-module-surface--dosare :is(.trd-tabs, .trd-sort-tabs, .trd-view-mode-tabs) { min-width: 0; }
    .tmws-module-surface--dosare .trd-app .trd-filter-row--court .trd-court-select {
        width: 100% !important;
        flex: 1 1 auto;
    }
}

/* One global search. Radar keeps filters, but not a second search field. */
.tmws-module-surface #trd-search,
.tmws-module-surface .tmcb-client-search { display: none !important; }
.tmws-module-surface .trd-filters-header { justify-content: flex-start; }

/* Owner widgets stay out of work views; the top-level Settings center renders canonical options. */
.tmws-module-surface--dosare #trd-cron-widget,
.tmws-module-surface--dosare .trd-upcoming-days-config,
.tmws-module-surface--dosare .trd-upcoming-save-btn { display: none !important; }
.tmws-settings #trd-cron-widget,
.tmws-settings .trd-upcoming-days-config,
.tmws-settings .trd-upcoming-save-btn { display: flex !important; }
.tmws-settings #trd-cron-widget { margin: 0; }
.tmws-settings .trd-cron-toggle { width: 100%; }
.tmws-settings .trd-cron-panel { margin-top: 8px; }

.tmws-module-surface .trd-primary,
.tmws-module-surface .tfc-primary,
.tmws-module-surface .tvc-primary,
.tmws-module-surface .trd-tabs button.active,
.tmws-module-surface .trd-court-tabs button.active,
.tmws-module-surface .trd-sort-tabs button.active,
.tmws-module-surface .trd-view-mode-tabs button.active,
.tmws-module-surface .tfc-tabs button.is-active,
.tmws-module-surface .tvc-tabs button.is-active {
    color: #fff !important;
    background: var(--tmws-wine) !important;
    border-color: var(--tmws-wine) !important;
}

.tmws-module-surface .tfc-tabs,
.tmws-module-surface .tvc-tabs {
    border-color: var(--tmws-line);
    background: #fff;
}

/* Identity Checks ships a dark standalone tab rail. Inside the light Workspace
   surface every state is restated explicitly, so no white-on-white cascade can
   leak through when the owner stylesheet loads after the shell. */
.tmws-module-surface--verificari .tvc-tabs {
    border-color: rgba(128, 0, 32, .14);
    background: #f6f1ef;
    box-shadow: none;
}

.tmws-module-surface--verificari .tvc-tabs button:not(.is-active) {
    color: var(--tmws-ink) !important;
    background: rgba(255, 255, 255, .88) !important;
    border-color: rgba(128, 0, 32, .09) !important;
    box-shadow: none !important;
}

.tmws-module-surface--verificari .tvc-tabs button:not(.is-active) span {
    color: var(--tmws-muted) !important;
}

.tmws-module-surface--verificari .tvc-tabs button:not(.is-active):hover,
.tmws-module-surface--verificari .tvc-tabs button:not(.is-active):focus-visible {
    color: var(--tmws-wine) !important;
    background: #fff !important;
    border-color: rgba(128, 0, 32, .30) !important;
    box-shadow: 0 0 0 3px rgba(128, 0, 32, .08) !important;
}

.tmws-module-surface--verificari .tvc-tabs button:not(.is-active):hover span,
.tmws-module-surface--verificari .tvc-tabs button:not(.is-active):focus-visible span {
    color: var(--tmws-wine-dark) !important;
}

.tmws-module-surface--verificari .tvc-tabs button.is-active span {
    color: rgba(255, 255, 255, .76) !important;
}

.tmws-module-surface h2,
.tmws-module-surface .trd-card h3,
.tmws-module-surface .tmcb-client-profile h2,
.tmws-module-surface .tmcb-today h2 {
    font-family: var(--tmws-font-title) !important;
}

.tmws-module-surface .trd-card,
.tmws-module-surface .trd-filters,
.tmws-module-surface .trd-stats button,
.tmws-module-surface .trd-upcoming-widget,
.tmws-module-surface .tfc-panel,
.tmws-module-surface .tvc-panel,
.tmws-module-surface .tvc-band,
.tmws-module-surface .tmcb-client-panel,
.tmws-module-surface .tmcb-today-panel {
    border-color: var(--tmws-line) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

/* Unified component adapter — scoped to the new application, never standalone. */
.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-app,
    .trd-calendar-app,
    .trd-institutions-app,
    .tfc-app,
    .tvc-app,
    .tcf-app,
    .tmcb-client-profile,
    .tmcb-today,
    .tad-workbench
) {
    color: var(--tmws-ink) !important;
    font-family: var(--tmws-font-ui) !important;
    font-size: var(--tmws-text-body);
    line-height: 1.45;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-app,
    .trd-calendar-app,
    .trd-institutions-app,
    .tfc-app,
    .tvc-app,
    .tcf-app,
    .tmcb-client-profile,
    .tmcb-today,
    .tad-workbench
) :where(button, input, select, textarea) {
    font-family: var(--tmws-font-ui) !important;
    letter-spacing: 0;
}

/* Every textual action uses one readable label size. Descriptive children may
 * remain on the secondary text tier, but the action itself never shrinks. */
.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :where(
    button,
    input[type="submit"],
    input[type="button"]
) {
    font-size: var(--tmws-text-action) !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-app,
    .tfc-app,
    .tvc-app,
    .tcf-app,
    .tmcb-client-profile,
    .tmcb-today,
    .tad-workbench
) :is(h2, h3),
.tmws-ui-system :is(.tmcb-client-panel-head, .tmcb-today-panel-head) strong {
    color: var(--tmws-ink);
    font-family: var(--tmws-font-title) !important;
    font-weight: 400 !important;
    letter-spacing: 0;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-app,
    .tfc-app,
    .tvc-app,
    .tcf-app,
    .tmcb-client-profile,
    .tmcb-today,
    .tad-workbench
) h3,
.tmws-ui-system :is(.tmcb-client-panel-head, .tmcb-today-panel-head) strong {
    font-size: var(--tmws-text-title) !important;
    line-height: 1.25;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-app,
    .tfc-app,
    .tvc-app,
    .tcf-app,
    .tmcb-client-profile,
    .tmcb-today,
    .tad-workbench
) :where(p, li, td, dd) {
    line-height: 1.45;
    letter-spacing: 0;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-app,
    .tfc-app,
    .tvc-app,
    .tcf-app,
    .tmcb-client-profile,
    .tmcb-today,
    .tad-workbench
) :where(label) {
    font-size: var(--tmws-text-label);
    font-weight: 700;
    line-height: 1.3;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-app,
    .tfc-app,
    .tvc-app,
    .tcf-app,
    .tmcb-client-profile,
    .tmcb-today,
    .tad-workbench
) :where(small, .trd-help, .tfc-help, .tvc-muted) {
    font-size: var(--tmws-text-small);
    line-height: 1.4;
}

/* Buttons: one height, weight, radius and interaction language. */
.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-primary, .trd-secondary, .trd-danger, .trd-ghost,
    .tfc-primary, .tfc-secondary, .tfc-danger,
    .tvc-primary, .tvc-secondary, .tvc-danger,
    .tcf-primary, .tcf-secondary,
    .tmcb-button, .tmcb-client-action, .tmcb-panel-action,
    .tad-button
) {
    min-height: var(--tmws-control-height) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px;
    padding: 0 14px !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: var(--tmws-control-radius) !important;
    box-shadow: none !important;
    font-family: var(--tmws-font-ui) !important;
    font-size: var(--tmws-text-action) !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    transform: none !important;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-primary,
    .tfc-primary,
    .tvc-primary,
    .tcf-primary,
    .tmcb-button--primary,
    .tmcb-client-action--primary,
    .tad-button--primary
),
.tmws-ui-system .tmws-ui-button--primary {
    color: #fff !important;
    background: var(--tmws-wine) !important;
    border-color: var(--tmws-wine) !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-secondary, .trd-ghost,
    .tfc-secondary,
    .tvc-secondary,
    .tcf-secondary,
    .tmcb-button:not(.tmcb-button--primary),
    .tmcb-client-action:not(.tmcb-client-action--primary):not(.tmcb-client-action--danger),
    .tmcb-panel-action,
    .tad-button--secondary, .tad-button--ghost
) {
    color: var(--tmws-ink) !important;
    background: #fff !important;
    border-color: var(--tmws-line) !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-danger,
    .tfc-danger,
    .tvc-danger,
    .tmcb-client-action--danger,
    .tad-button--danger
) {
    color: var(--tmws-danger) !important;
    background: var(--tmws-danger-soft) !important;
    border-color: rgba(143, 36, 48, .24) !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-primary, .trd-secondary, .trd-danger, .trd-ghost,
    .tfc-primary, .tfc-secondary, .tfc-danger,
    .tvc-primary, .tvc-secondary, .tvc-danger,
    .tcf-primary, .tcf-secondary,
    .tmcb-button, .tmcb-client-action, .tmcb-panel-action,
    .tad-button
):not(:disabled):hover,
.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-primary, .trd-secondary, .trd-danger, .trd-ghost,
    .tfc-primary, .tfc-secondary, .tfc-danger,
    .tvc-primary, .tvc-secondary, .tvc-danger,
    .tcf-primary, .tcf-secondary,
    .tmcb-button, .tmcb-client-action, .tmcb-panel-action,
    .tad-button
):focus-visible {
    color: var(--tmws-wine) !important;
    background: var(--tmws-soft) !important;
    border-color: rgba(128, 0, 32, .34) !important;
    box-shadow: var(--tmws-focus-ring) !important;
    outline: 0 !important;
    transform: none !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-primary,
    .tfc-primary,
    .tvc-primary,
    .tcf-primary,
    .tmcb-button--primary,
    .tmcb-client-action--primary,
    .tad-button--primary
):not(:disabled):hover,
.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-primary,
    .tfc-primary,
    .tvc-primary,
    .tcf-primary,
    .tmcb-button--primary,
    .tmcb-client-action--primary,
    .tad-button--primary
):focus-visible {
    color: #fff !important;
    background: var(--tmws-wine-dark) !important;
    border-color: var(--tmws-wine-dark) !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-primary, .trd-secondary, .trd-danger, .trd-ghost,
    .tfc-primary, .tfc-secondary, .tfc-danger,
    .tvc-primary, .tvc-secondary, .tvc-danger,
    .tcf-primary, .tcf-secondary,
    .tmcb-button, .tmcb-client-action, .tmcb-panel-action,
    .tad-button
):disabled {
    cursor: not-allowed !important;
    opacity: .5 !important;
}

.tmws-ui-system .tmws-module-surface .trd-today-btn {
    min-height: var(--tmws-control-height) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 14px !important;
    color: var(--tmws-ink) !important;
    background: #fff !important;
    border: 1px solid var(--tmws-line) !important;
    border-radius: var(--tmws-control-radius) !important;
    box-shadow: none !important;
    font: 700 var(--tmws-text-body)/1 var(--tmws-font-ui) !important;
    text-decoration: none !important;
    transform: none !important;
}
.tmws-ui-system .tmws-module-surface .trd-today-btn:hover,
.tmws-ui-system .tmws-module-surface .trd-today-btn:focus-visible {
    color: var(--tmws-wine) !important;
    background: var(--tmws-soft) !important;
    border-color: rgba(128, 0, 32, .34) !important;
    box-shadow: var(--tmws-focus-ring) !important;
    outline: 0 !important;
}

/* Fields: identical proportions without touching toggles, radios or uploads. */
.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-app,
    .tfc-app,
    .tvc-app,
    .tcf-app,
    .tmcb-client-profile,
    .tad-workbench
) :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]),
    select
) {
    width: 100%;
    max-width: 100%;
    min-height: var(--tmws-control-height) !important;
    margin: 0;
    padding: 8px 10px !important;
    color: var(--tmws-ink) !important;
    background-color: #fff !important;
    border: 1px solid var(--tmws-line) !important;
    border-radius: var(--tmws-control-radius) !important;
    box-shadow: none !important;
    font-family: var(--tmws-font-ui) !important;
    font-size: var(--tmws-text-action) !important;
    font-weight: 600 !important;
    line-height: 1.3;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-app,
    .tfc-app,
    .tvc-app,
    .tcf-app,
    .tmcb-client-profile,
    .tad-workbench
) textarea {
    width: 100%;
    min-height: 96px;
    margin: 0;
    padding: 9px 10px !important;
    color: var(--tmws-ink) !important;
    background: #fff !important;
    border: 1px solid var(--tmws-line) !important;
    border-radius: var(--tmws-control-radius) !important;
    box-shadow: none !important;
    font-family: var(--tmws-font-ui) !important;
    font-size: var(--tmws-text-body) !important;
    font-weight: 400 !important;
    line-height: 1.5;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-app,
    .tfc-app,
    .tvc-app,
    .tcf-app,
    .tmcb-client-profile,
    .tad-workbench
) :is(input, select, textarea):focus {
    border-color: rgba(128, 0, 32, .48) !important;
    box-shadow: var(--tmws-focus-ring) !important;
    outline: 0 !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(input, select, textarea):disabled {
    color: #8b8285 !important;
    background-color: #f1eeec !important;
    cursor: not-allowed;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(input[type="checkbox"], input[type="radio"]) {
    accent-color: var(--tmws-wine);
}

.tmws-ui-system #tcf-json-import { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; }

/* Tabs and segmented controls share one neutral/active state model. */
.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-tabs,
    .tfc-tabs,
    .tvc-tabs,
    .tcf-tabs
) {
    gap: 6px !important;
    padding: 6px !important;
    background: #f4efec !important;
    border: 1px solid var(--tmws-line) !important;
    border-radius: var(--tmws-card-radius) !important;
    box-shadow: none !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-tabs,
    .tfc-tabs,
    .tvc-tabs,
    .tcf-tabs
) button {
    min-width: 0;
    min-height: 50px !important;
    padding: 8px 10px !important;
    color: var(--tmws-ink) !important;
    background: rgba(255, 255, 255, .84) !important;
    border: 1px solid rgba(128, 0, 32, .08) !important;
    border-radius: var(--tmws-control-radius) !important;
    box-shadow: none !important;
    font-family: var(--tmws-font-ui) !important;
    font-size: var(--tmws-text-body) !important;
    font-weight: 700 !important;
    line-height: 1.15;
    transform: none !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-tabs,
    .tfc-tabs,
    .tvc-tabs,
    .tcf-tabs
) button span {
    color: var(--tmws-muted) !important;
    font-size: var(--tmws-text-small) !important;
    font-weight: 600 !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-tabs,
    .tfc-tabs,
    .tvc-tabs,
    .tcf-tabs
) button:is(.active, .is-active) {
    color: #fff !important;
    background: var(--tmws-wine) !important;
    border-color: var(--tmws-wine) !important;
    box-shadow: 0 4px 12px rgba(128, 0, 32, .14) !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-tabs,
    .tfc-tabs,
    .tvc-tabs,
    .tcf-tabs
) button:is(.active, .is-active) span { color: rgba(255, 255, 255, .76) !important; }

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-tabs,
    .tfc-tabs,
    .tvc-tabs,
    .tcf-tabs
) button:not(.active):not(.is-active):hover,
.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-tabs,
    .tfc-tabs,
    .tvc-tabs,
    .tcf-tabs
) button:not(.active):not(.is-active):focus-visible {
    color: var(--tmws-wine) !important;
    background: #fff !important;
    border-color: rgba(128, 0, 32, .30) !important;
    box-shadow: var(--tmws-focus-ring) !important;
    outline: 0 !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-sort-tabs,
    .trd-view-mode-tabs,
    .trd-view-toggle,
    .trd-calendar-view,
    .trdi-type-tabs,
    .tfc-document-switch,
    .tfc-accounting-subtabs
) button {
    min-height: var(--tmws-control-height-compact) !important;
    padding: 0 11px !important;
    border-radius: var(--tmws-control-radius) !important;
    font-family: var(--tmws-font-ui) !important;
    font-size: var(--tmws-text-action) !important;
    font-weight: 700 !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-sort-tabs,
    .trd-view-mode-tabs,
    .trd-view-toggle,
    .trd-calendar-view,
    .trdi-type-tabs,
    .tfc-document-switch,
    .tfc-accounting-subtabs
) button:is(.active, .is-active) {
    color: #fff !important;
    background: var(--tmws-wine) !important;
    border-color: var(--tmws-wine) !important;
    box-shadow: none !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-sort-tabs,
    .trd-view-mode-tabs,
    .trd-view-toggle,
    .trd-calendar-view,
    .trdi-type-tabs,
    .tfc-document-switch,
    .tfc-accounting-subtabs
) button:not(.active):not(.is-active):hover,
.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-sort-tabs,
    .trd-view-mode-tabs,
    .trd-view-toggle,
    .trd-calendar-view,
    .trdi-type-tabs,
    .tfc-document-switch,
    .tfc-accounting-subtabs
) button:not(.active):not(.is-active):focus-visible {
    color: var(--tmws-wine) !important;
    background: #fff !important;
    border-color: rgba(128, 0, 32, .30) !important;
    box-shadow: var(--tmws-focus-ring) !important;
    outline: 0 !important;
}

/* Cards and dense data views feel like one product, while semantic colors stay owned. */
.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-card, .trd-filters, .trd-stats button, .trd-upcoming-widget, .trd-panel,
    .tfc-card, .tfc-panel, .tfc-form, .tfc-empty,
    .tvc-panel, .tvc-band, .tvc-form, .tvc-workflow, .tvc-metrics article, .tvc-notice,
    .tcf-card, .tcf-panel, .tcf-empty,
    .tmcb-client-panel, .tmcb-client-module-card, .tmcb-today-panel, .tmcb-task-card, .tmcb-today-empty,
    .tad-card, .tad-compact-panel, .tad-empty
) {
    border-radius: var(--tmws-card-radius) !important;
    box-shadow: none !important;
}

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-table,
    .tfc-table,
    .tvc-table,
    .tcf-table,
    .tad-workbench table
) { font-size: var(--tmws-text-label); }

.tmws-ui-system :is(.tmws-module-surface, .tmws-panel--matter) :is(
    .trd-table,
    .tfc-table,
    .tvc-table,
    .tcf-table,
    .tad-workbench table
) th {
    color: var(--tmws-muted);
    font-size: var(--tmws-text-small);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Case Files and Atelier lose their standalone frame when mounted in a matter. */
.tmws-ui-system .tmws-matter-work .tcf-shell {
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.tmws-ui-system .tmws-matter-pane--documents .tad-workbench--embedded {
    --tad-wine: var(--tmws-wine);
    --tad-wine-dark: var(--tmws-wine-dark);
    --tad-gold: var(--tmws-gold);
    --tad-ink: var(--tmws-ink);
    --tad-muted: var(--tmws-muted);
    --tad-line: var(--tmws-line);
    --tad-soft: var(--tmws-soft);
}
.tmws-ui-system .tmws-matter-pane--documents .tad-workbench--embedded .tad-shell { border-radius: var(--tmws-card-radius); box-shadow: none; }
.tmws-ui-system .tmws-matter-pane--documents .tad-workbench--embedded .tad-main { padding: 24px; }
.tmws-ui-system .tmws-matter-pane--documents .tad-workbench--embedded .tad-card { padding: 18px; }

.tmws-root[data-active-view="settings"] .tmws-content { padding: 0; overflow: hidden; }
.tmws-root[data-active-view="settings"] .tmws-panel[data-tmws-panel="settings"],
.tmws-root[data-active-view="settings"] .tmws-module-surface--settings,
.tmws-settings { height: 100%; min-height: 0; }
.tmws-module-surface--settings {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.tmws-settings { display: block; max-width: none; margin: 0; font-size: var(--tmws-text-body); line-height: 1.5; }
.tmws-settings button,
.tmws-settings input,
.tmws-settings select,
.tmws-settings textarea { font-family: var(--tmws-font-ui) !important; }
.tmws-settings-panel-title > span { color: var(--tmws-gold-light); font-size: var(--tmws-text-caption); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.tmws-settings-layout { height: 100%; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 0; align-items: stretch; }
.tmws-settings-nav { min-height: 0; display: grid; align-content: start; gap: 3px; padding: 16px 12px; overflow-y: auto; background: #faf8f6; border: 0; border-right: 1px solid var(--tmws-line-gold); border-radius: 0; box-shadow: none; }
.tmws-settings-nav button { width: 100%; min-height: 64px; display: grid; grid-template-columns: 27px minmax(0, 1fr); column-gap: 9px; padding: 9px 10px; color: #71666a; background: transparent; border: 1px solid transparent; border-radius: 7px; cursor: pointer; text-align: left; }
.tmws-settings-nav button:hover,
.tmws-settings-nav button:focus-visible { color: var(--tmws-wine); background: #fbf4f6; outline: none; }
.tmws-settings-nav button.is-active { color: var(--tmws-wine); background: linear-gradient(90deg, #fbf1f4, #fff); border-color: rgba(128, 0, 32, .16); box-shadow: inset 3px 0 0 var(--tmws-wine); }
.tmws-settings-nav button > span { grid-row: 1 / 3; display: grid; place-items: center; color: var(--tmws-gold); font-size: var(--tmws-text-caption); }
.tmws-settings-nav strong,
.tmws-settings-nav small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmws-settings-nav strong { font-size: var(--tmws-text-action); }
.tmws-settings-nav small { color: #8f8589; font-size: var(--tmws-text-small); }
.tmws-settings-panels { min-width: 0; min-height: 0; padding: 18px 22px 0; overflow-y: auto; background: var(--tmws-page); }
.tmws-settings-panel.is-active { animation: tmws-enter .18s ease both; }
.tmws-settings-panel-title { margin: 0 0 12px; padding: 5px 2px 12px; border-bottom: 1px solid var(--tmws-line); }
.tmws-settings-panel-title > span { color: var(--tmws-wine); }
.tmws-settings-panel-title h2 { margin: 4px 0 4px; color: var(--tmws-ink); font-family: var(--tmws-font-title) !important; font-size: 27px; font-weight: 400; }
.tmws-settings-panel-title p { margin: 0; max-width: 760px; color: var(--tmws-muted); font-size: var(--tmws-text-label); line-height: 1.5; }
.tmws-settings-panel form { display: grid; gap: 11px; margin: 0; }
.tmws-settings-panel form.is-saving :is(.tmws-setting-toggle, .tmws-setting-field) { pointer-events: none; opacity: .72; }
.tmws-settings-autosave-status { min-height: 25px; display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 0 3px; color: var(--tmws-muted); font-size: var(--tmws-text-small); }
.tmws-settings-autosave-status::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; background: #9d9296; border-radius: 50%; }
.tmws-settings-autosave-status.is-saving::before { background: var(--tmws-gold); animation: tmws-settings-pulse 1s ease-in-out infinite; }
.tmws-settings-autosave-status.is-success { color: #17653b; }
.tmws-settings-autosave-status.is-success::before { background: #2f8a58; }
.tmws-settings-autosave-status.is-error { color: #a21f2d; }
.tmws-settings-autosave-status.is-error::before { background: #b4232f; }
@keyframes tmws-settings-pulse { 0%, 100% { opacity: .42; } 50% { opacity: 1; } }
.tmws-settings-card { padding: 19px; background: #fff; border: 1px solid var(--tmws-line); border-radius: 10px; box-shadow: 0 8px 26px rgba(42, 18, 26, .045); }
.tmws-settings-card--ai { border-color: rgba(168, 120, 46, .28); background: linear-gradient(145deg, #fff, #fffaf2); }
.tmws-integration-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.tmws-integration-summary > div { min-width: 0; padding: 12px; background: #fbf8f6; border: 1px solid var(--tmws-line); border-radius: 8px; }
.tmws-integration-summary span,
.tmws-integration-summary strong { display: block; }
.tmws-integration-summary span { color: var(--tmws-wine); font-size: var(--tmws-text-caption); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.tmws-integration-summary strong { margin-top: 5px; color: var(--tmws-ink); font-size: var(--tmws-text-label); line-height: 1.45; }
.tmws-settings-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.tmws-settings-card-head > div > span { color: var(--tmws-wine); font-size: var(--tmws-text-caption); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.tmws-settings-card-head h3 { margin: 3px 0 4px; color: var(--tmws-ink); font-family: var(--tmws-font-title) !important; font-size: 21px; font-weight: 400; }
.tmws-settings-card-head p { margin: 0; max-width: 720px; color: var(--tmws-muted); font-size: var(--tmws-text-label); line-height: 1.55; }
.tmws-settings-card-head > b { flex: 0 0 auto; padding: 5px 8px; color: #6d4e16; background: #fff7e5; border: 1px solid rgba(168, 120, 46, .22); border-radius: 999px; font-size: var(--tmws-text-caption); letter-spacing: .04em; text-transform: uppercase; }
.tmws-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.tmws-settings-grid--single { grid-template-columns: minmax(0, 1fr); }
.tmws-setting-field { min-width: 0; display: flex; flex-direction: column; gap: 5px; color: #4f4549; font-size: var(--tmws-text-label); font-weight: 700; }
.tmws-setting-field--wide { grid-column: 1 / -1; }
.tmws-setting-field input,
.tmws-setting-field select,
.tmws-setting-field textarea { width: 100%; min-height: var(--tmws-control-height); margin: 0; padding: 8px 10px; color: var(--tmws-ink); background: #fcfaf9; border: 1px solid rgba(128, 0, 32, .13); border-radius: var(--tmws-control-radius); box-shadow: none; font-size: var(--tmws-text-body); font-weight: 400; }
.tmws-setting-field textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
.tmws-settings-panel[data-tmws-settings-panel="prompts"] .tmws-setting-field textarea { min-height: 168px; }
.tmws-prompt-type-editor { display: grid; gap: 9px; margin-top: 14px; }
.tmws-prompt-type-editor-head { padding: 10px 12px; background: rgba(255, 255, 255, .72); border: 1px solid rgba(128, 0, 32, .11); border-radius: 9px; }
.tmws-prompt-type-editor-head span { display: block; color: var(--tmws-wine); font-size: var(--tmws-text-caption); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.tmws-prompt-type-editor-head p { margin: 4px 0 0; color: var(--tmws-muted); font-size: var(--tmws-text-label); line-height: 1.45; }
.tmws-prompt-type-group { background: #fff; border: 1px solid rgba(128, 0, 32, .12); border-radius: 10px; overflow: hidden; }
.tmws-prompt-type-group summary { min-height: 49px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; color: var(--tmws-ink); cursor: pointer; font-size: var(--tmws-text-action); font-weight: 800; list-style: none; }
.tmws-prompt-type-group summary::-webkit-details-marker { display: none; }
.tmws-prompt-type-group summary::before { content: "›"; color: var(--tmws-wine); font-size: 22px; line-height: 1; transition: transform .16s ease; }
.tmws-prompt-type-group[open] summary::before { transform: rotate(90deg); }
.tmws-prompt-type-group summary small { margin-left: auto; color: var(--tmws-muted); font-size: var(--tmws-text-small); font-weight: 700; }
.tmws-prompt-type-list { display: grid; gap: 10px; padding: 0 13px 13px; }
.tmws-document-type-prompt { display: grid; gap: 5px; padding: 11px; background: #fcfaf9; border: 1px solid rgba(128, 0, 32, .11); border-radius: 9px; }
.tmws-document-type-prompt span { color: var(--tmws-ink); font-size: var(--tmws-text-label); font-weight: 800; }
.tmws-document-type-prompt small { color: var(--tmws-muted); font-size: var(--tmws-text-small); line-height: 1.4; }
.tmws-document-type-prompt textarea { width: 100%; min-height: 138px; margin: 0; padding: 9px 10px; color: var(--tmws-ink); background: #fff; border: 1px solid rgba(128, 0, 32, .13); border-radius: var(--tmws-control-radius); box-shadow: none; font-family: var(--tmws-font-ui) !important; font-size: var(--tmws-text-body); line-height: 1.5; resize: vertical; }
.tmws-document-type-prompt textarea:focus { border-color: rgba(128, 0, 32, .48); outline: 3px solid rgba(128, 0, 32, .07); }
.tmws-setting-field input:focus,
.tmws-setting-field select:focus,
.tmws-setting-field textarea:focus { background: #fff; border-color: rgba(128, 0, 32, .48); outline: 3px solid rgba(128, 0, 32, .07); }
.tmws-setting-field input[readonly] { color: #756b6f; background: #f2efed; cursor: copy; }
.tmws-setting-field small { color: #968c90; font-size: var(--tmws-text-small); font-weight: 400; line-height: 1.4; }
.tmws-settings-switchboard { display: grid; gap: 7px; margin-top: 11px; }
.tmws-settings-switchboard--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tmws-setting-toggle { min-height: 58px; display: flex; align-items: center; gap: 11px; padding: 10px 12px; color: var(--tmws-ink); background: #fbf8f6; border: 1px solid var(--tmws-line); border-radius: 8px; cursor: pointer; }
.tmws-setting-toggle > input[type="checkbox"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tmws-setting-toggle-track { position: relative; width: 36px; height: 21px; flex: 0 0 36px; background: #c9c2c5; border-radius: 999px; transition: background .16s ease; }
.tmws-setting-toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; background: #fff; border-radius: 50%; box-shadow: 0 2px 5px rgba(0, 0, 0, .18); transition: transform .16s ease; }
.tmws-setting-toggle input[type="checkbox"]:checked + .tmws-setting-toggle-track { background: var(--tmws-wine); }
.tmws-setting-toggle input[type="checkbox"]:checked + .tmws-setting-toggle-track::after { transform: translateX(15px); }
.tmws-setting-toggle input[type="checkbox"]:focus-visible + .tmws-setting-toggle-track { outline: 3px solid rgba(128, 0, 32, .15); }
.tmws-setting-toggle-copy { min-width: 0; }
.tmws-setting-toggle-copy strong,
.tmws-setting-toggle-copy small { display: block; }
.tmws-setting-toggle-copy strong { font-size: var(--tmws-text-label); }
.tmws-setting-toggle-copy small { margin-top: 2px; color: var(--tmws-muted); font-size: var(--tmws-text-small); font-weight: 400; line-height: 1.4; }
.tmws-settings-copyline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 11px; padding: 9px 10px; background: #fffaf0; border: 1px solid var(--tmws-line-gold); border-radius: 8px; }
.tmws-settings-copyline span { color: #75571e; font-size: var(--tmws-text-small); font-weight: 700; }
.tmws-settings-copyline input { min-width: 0; height: var(--tmws-control-height-compact); padding: 6px 8px; color: #77674b; background: rgba(255, 255, 255, .76); border: 1px solid rgba(168, 120, 46, .18); border-radius: var(--tmws-control-radius); font-size: var(--tmws-text-small); }
.tmws-settings-copyline button,
.tmws-settings-owner-actions a { min-height: var(--tmws-control-height); display: inline-flex; align-items: center; justify-content: center; padding: 7px 12px; color: #fff !important; background: var(--tmws-wine); border: 1px solid var(--tmws-wine); border-radius: var(--tmws-control-radius); cursor: pointer; font-size: var(--tmws-text-action); font-weight: 700; text-decoration: none !important; }
.tmws-settings-owner-actions { display: flex; align-items: center; gap: 10px; margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--tmws-line); }
.tmws-settings-owner-actions small { color: var(--tmws-muted); font-size: var(--tmws-text-small); }
.tmws-settings-inline-note,
.tmws-token-guidance { margin: 11px 0 0; padding: 10px 11px; color: #6b5b3b; background: #fffaf0; border: 1px solid var(--tmws-line-gold); border-radius: 8px; font-size: var(--tmws-text-small); line-height: 1.5; }
.tmws-token-guidance { display: flex; align-items: center; gap: 10px; }
.tmws-token-guidance strong { color: #5f4214; white-space: nowrap; }
.tmws-settings-advanced,
.tmws-settings-danger { background: #fff; border: 1px solid var(--tmws-line); border-radius: 10px; overflow: hidden; }
.tmws-settings-advanced summary,
.tmws-settings-danger summary { min-height: 54px; display: flex; flex-direction: column; justify-content: center; padding: 11px 44px 11px 17px; color: var(--tmws-ink); cursor: pointer; list-style: none; position: relative; }
.tmws-settings-advanced summary::-webkit-details-marker,
.tmws-settings-danger summary::-webkit-details-marker { display: none; }
.tmws-settings-advanced summary::after,
.tmws-settings-danger summary::after { content: "+"; position: absolute; top: 50%; right: 17px; transform: translateY(-50%); color: var(--tmws-wine); font-size: 20px; font-weight: 300; }
.tmws-settings-advanced[open] summary::after,
.tmws-settings-danger[open] summary::after { content: "−"; }
.tmws-settings-advanced summary span { font-size: var(--tmws-text-label); font-weight: 700; }
.tmws-settings-advanced summary small { margin-top: 2px; color: var(--tmws-muted); font-size: var(--tmws-text-small); }
.tmws-settings-advanced-body { padding: 16px; border-top: 1px solid var(--tmws-line); }
.tmws-settings-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.tmws-settings-template-grid section { padding: 12px; background: var(--tmws-soft); border: 1px solid var(--tmws-line); border-radius: 8px; }
.tmws-settings-template-grid h4 { margin: 0 0 9px; color: var(--tmws-ink); font-family: var(--tmws-font-title); font-size: 18px; font-weight: 400; }
.tmws-settings-template-grid .tmws-setting-field + .tmws-setting-field { margin-top: 9px; }
.tmws-settings-danger { border-color: rgba(180, 35, 47, .2); }
.tmws-settings-danger summary { color: #8f2430; font-size: var(--tmws-text-label); font-weight: 700; }
.tmws-settings-danger > div { padding: 13px; background: #fff8f8; border-top: 1px solid rgba(180, 35, 47, .15); }
.tmws-settings-save { position: sticky; z-index: 5; bottom: 0; min-height: 66px; display: flex; align-items: center; justify-content: flex-end; gap: 13px; padding: 11px 12px; background: rgba(247, 245, 242, .94); border-top: 1px solid var(--tmws-line-gold); backdrop-filter: blur(12px); }
.tmws-settings-save > span { flex: 1; color: var(--tmws-muted); font-size: var(--tmws-text-small); text-align: right; }
.tmws-settings-save > span.is-success { color: #17653b; }
.tmws-settings-save > span.is-error { color: #a21f2d; }
.tmws-settings-save button { min-height: var(--tmws-control-height); padding: 8px 16px; color: #fff; background: var(--tmws-wine); border: 1px solid var(--tmws-wine); border-radius: var(--tmws-control-radius); cursor: pointer; font-size: var(--tmws-text-action); font-weight: 700; }
.tmws-settings-save button:hover,
.tmws-settings-save button:focus-visible { background: var(--tmws-wine-dark); outline: 3px solid rgba(128, 0, 32, .10); }
.tmws-settings-save button:disabled { opacity: .62; cursor: wait; }
.tmws-settings-warning,
.tmws-settings-unavailable { display: flex; align-items: center; gap: 8px; padding: 13px 15px; color: #785719; background: #fff7e5; border: 1px solid var(--tmws-line-gold); border-radius: 9px; font-size: var(--tmws-text-label); }
.tmws-settings-warning span { color: #897348; }
.tmws-access-logic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 11px; }
.tmws-access-logic article { position: relative; min-height: 108px; padding: 16px 17px 15px 52px; background: #fff; border: 1px solid var(--tmws-line); border-radius: 10px; box-shadow: 0 8px 26px rgba(42, 18, 26, .035); }
.tmws-access-logic article::before { content: ""; position: absolute; top: 18px; left: 17px; width: 22px; height: 22px; border: 1px solid rgba(128, 0, 32, .18); border-radius: 50%; background: radial-gradient(circle at center, var(--tmws-wine) 0 3px, #f8e9ed 4px 100%); }
.tmws-access-logic article:nth-child(2)::before { border-color: rgba(168, 120, 46, .25); background: radial-gradient(circle at center, var(--tmws-gold) 0 3px, #fff6e4 4px 100%); }
.tmws-access-logic article > span { display: block; margin-bottom: 4px; color: var(--tmws-wine); font-size: var(--tmws-text-caption); font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.tmws-access-logic article:nth-child(2) > span { color: #88651e; }
.tmws-access-logic strong { display: block; color: var(--tmws-ink); font-family: var(--tmws-font-title); font-size: 17px; font-weight: 400; }
.tmws-access-logic p { margin: 5px 0 0; color: var(--tmws-muted); font-size: var(--tmws-text-label); line-height: 1.55; }
.tmws-settings-add-user { flex: 0 0 auto; min-height: var(--tmws-control-height); display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; color: #fff; background: var(--tmws-wine); border: 1px solid var(--tmws-wine); border-radius: var(--tmws-control-radius); cursor: pointer; font-size: var(--tmws-text-action); font-weight: 700; }
.tmws-settings-add-user b { font-size: 16px; font-weight: 300; line-height: 1; transition: transform .18s ease; }
.tmws-settings-add-user:hover,
.tmws-settings-add-user:focus-visible { background: var(--tmws-wine-dark); outline: 3px solid rgba(128, 0, 32, .10); }
.tmws-settings-add-user.is-open b { transform: rotate(45deg); }
.tmws-access-team-card { margin-bottom: 11px; }
.tmws-access-member-list { display: grid; gap: 6px; }
.tmws-access-member { overflow: hidden; background: #fbfaf8; border: 1px solid var(--tmws-line); border-radius: 9px; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.tmws-access-member[open] { background: #fff; border-color: rgba(128, 0, 32, .22); box-shadow: 0 10px 28px rgba(42, 18, 26, .055); }
.tmws-access-member > summary { min-height: 62px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 11px; cursor: pointer; list-style: none; }
.tmws-access-member > summary::-webkit-details-marker { display: none; }
.tmws-access-member > summary:focus-visible { outline: 3px solid rgba(128, 0, 32, .10); outline-offset: -3px; }
.tmws-access-member-action { min-height: 36px; display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; color: var(--tmws-wine); background: #fff; border: 1px solid rgba(128, 0, 32, .18); border-radius: 7px; font-size: var(--tmws-text-small); font-weight: 800; }
.tmws-access-member-action > i { position: relative; width: 14px; height: 14px; }
.tmws-access-member-action > i::before,
.tmws-access-member-action > i::after { content: ""; position: absolute; top: 6px; left: 2px; width: 10px; height: 1.5px; background: currentColor; border-radius: 999px; transition: transform .16s ease; }
.tmws-access-member-action > i::after { transform: rotate(90deg); }
.tmws-access-member[open] .tmws-access-member-action { color: #fff; background: var(--tmws-wine); border-color: var(--tmws-wine); }
.tmws-access-member[open] .tmws-access-member-action > i::after { transform: rotate(0); }
.tmws-access-avatar { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--tmws-wine), #4e0013); border: 1px solid rgba(201, 169, 110, .42); border-radius: 50%; font-family: var(--tmws-font-title); font-size: 15px; }
.tmws-access-member-identity { min-width: 0; }
.tmws-access-member-identity strong,
.tmws-access-member-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmws-access-member-identity strong { color: var(--tmws-ink); font-size: var(--tmws-text-label); }
.tmws-access-member-identity small { margin-top: 2px; color: var(--tmws-muted); font-size: var(--tmws-text-small); }
.tmws-access-member > summary > b { padding: 4px 7px; color: #6d4e16; background: #fff7e5; border: 1px solid rgba(168, 120, 46, .22); border-radius: 999px; font-size: var(--tmws-text-caption); }
.tmws-access-member-form { padding: 15px; border-top: 1px solid var(--tmws-line); background: linear-gradient(180deg, #fff, #fcfaf8); }
.tmws-access-member-grid { align-items: end; }
.tmws-access-password-intro { align-self: stretch; padding: 11px 12px; background: #fbf7f5; border: 1px solid var(--tmws-line); border-radius: 8px; }
.tmws-access-password-intro span { display: block; color: var(--tmws-wine); font-size: var(--tmws-text-caption); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tmws-access-password-intro p { margin: 5px 0 0; color: var(--tmws-muted); font-size: var(--tmws-text-small); line-height: 1.45; }
.tmws-access-password-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 10px; }
.tmws-access-password-tools button { min-height: 36px; padding: 6px 10px; color: var(--tmws-wine); background: #fff; border: 1px solid rgba(128, 0, 32, .20); border-radius: 7px; cursor: pointer; font-size: var(--tmws-text-small); font-weight: 700; }
.tmws-access-password-tools button:hover,
.tmws-access-password-tools button:focus-visible { color: #fff; background: var(--tmws-wine); outline: 3px solid rgba(128, 0, 32, .10); }
.tmws-access-password-tools span { flex: 1 1 270px; color: var(--tmws-muted); font-size: var(--tmws-text-small); line-height: 1.45; }
.tmws-access-member-form .tmws-settings-save { position: static; z-index: auto; min-height: 52px; margin: 13px -3px -3px; padding: 9px 3px 0; background: transparent; border-top: 1px solid var(--tmws-line); backdrop-filter: none; }
.tmws-access-remove { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 13px 15px; background: #fff9f8; border-top: 1px solid rgba(162, 31, 45, .15); }
.tmws-access-remove > div > span { display: block; color: #942534; font-size: var(--tmws-text-caption); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tmws-access-remove > div > p { margin: 4px 0 0; color: var(--tmws-muted); font-size: var(--tmws-text-small); line-height: 1.45; }
.tmws-access-remove > [data-tmws-settings-status] { max-width: 280px; color: var(--tmws-muted); font-size: var(--tmws-text-small); line-height: 1.4; text-align: right; }
.tmws-access-remove > [data-tmws-settings-status].is-success { color: #17653b; }
.tmws-access-remove > [data-tmws-settings-status].is-error { color: #a21f2d; }
.tmws-access-remove > button { min-height: 38px; padding: 7px 12px; color: #9a2131; background: #fff; border: 1px solid rgba(162, 31, 45, .32); border-radius: 7px; cursor: pointer; font-size: var(--tmws-text-small); font-weight: 800; }
.tmws-access-remove > button:hover,
.tmws-access-remove > button:focus-visible { color: #fff; background: #9a2131; border-color: #9a2131; outline: 3px solid rgba(162, 31, 45, .10); }
.tmws-access-remove > button:disabled { opacity: .62; cursor: wait; }
.tmws-access-remove--locked { grid-template-columns: minmax(0, 1fr); background: #fbfaf8; }
.tmws-access-remove--locked > div > span { color: #81766e; }
.tmws-access-calendar { grid-template-columns: minmax(210px, .75fr) minmax(0, 1.25fr); background: #fffdf7; border-top-color: rgba(168, 120, 46, .22); }
.tmws-access-calendar > div > span { color: #7a5a1d; }
.tmws-access-calendar .tmws-settings-copyline { width: 100%; grid-template-columns: minmax(0, 1fr) auto; margin: 0; }
.tmws-access-empty { margin: 0; padding: 14px; color: var(--tmws-muted); background: var(--tmws-soft); border-radius: 7px; font-size: var(--tmws-text-label); text-align: center; }
.tmws-access-invite-form { margin-bottom: 11px !important; padding: 10px; background: linear-gradient(145deg, #f9edf1, #fff9ec); border: 1px solid rgba(128, 0, 32, .14); border-radius: 11px; }
.tmws-access-invite-form[hidden] { display: none !important; }
.tmws-access-invite-form .tmws-settings-card { box-shadow: none; }
.tmws-access-invite-form .tmws-settings-save { position: static; z-index: auto; min-height: 48px; margin: 0; padding: 7px 2px 0; background: transparent; border-top: 0; backdrop-filter: none; }
.tmws-access-existing { margin-bottom: 11px; }
.tmws-access-role-card { margin-bottom: 18px; }
.tmws-module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 11px; }
.tmws-module-grid article { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 10px 11px; background: var(--tmws-soft); border: 1px solid var(--tmws-line); border-radius: 8px; }
.tmws-module-grid article > div { min-width: 0; flex: 1; }
.tmws-module-grid strong,
.tmws-module-grid small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmws-module-grid strong { color: var(--tmws-ink); font-size: var(--tmws-text-label); }
.tmws-module-grid small { color: var(--tmws-muted); font-size: var(--tmws-text-small); }
.tmws-module-grid b { color: #8b7f84; font-size: var(--tmws-text-caption); }
.tmws-module-state { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; }
.tmws-module-state.is-on { background: #2b8754; box-shadow: 0 0 0 4px rgba(43, 135, 84, .10); }
.tmws-module-state.is-off { background: #b34a55; box-shadow: 0 0 0 4px rgba(179, 74, 85, .10); }
.tmws-role-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.tmws-role-guide article { padding: 10px 11px; background: var(--tmws-soft); border: 1px solid var(--tmws-line); border-radius: 8px; }
.tmws-role-guide strong,
.tmws-role-guide span { display: block; }
.tmws-role-guide strong { color: var(--tmws-wine); font-size: var(--tmws-text-label); }
.tmws-role-guide span { margin-top: 2px; color: var(--tmws-muted); font-size: var(--tmws-text-small); line-height: 1.45; }

.tmws-matter-hero,
.tmws-matter-work,
.tmws-task-rail {
    background: var(--tmws-surface);
    border: 1px solid var(--tmws-line);
    border-radius: var(--tmws-radius);
}
.tmws-matter-hero { position: relative; padding: 24px; overflow: hidden; }
.tmws-matter-hero::after { content: ""; position: absolute; width: 250px; height: 250px; right: -95px; top: -145px; background: radial-gradient(circle, rgba(168, 120, 46, .20), transparent 68%); pointer-events: none; }
.tmws-matter-title { min-height: var(--tmws-control-height); display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding-right: 320px; }
.tmws-back { min-height: var(--tmws-control-height); display: inline-flex; align-items: center; margin: 0 5px 0 0; padding: 0 14px 0 0; color: var(--tmws-wine); background: none; border: 0; border-right: 1px solid var(--tmws-line); cursor: pointer; font-size: var(--tmws-text-small); font-weight: 700; }
.tmws-matter-title > p,
.tmws-section-head span { margin: 0 0 4px; color: var(--tmws-wine); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.tmws-matter-title > p { margin: 0; }
.tmws-matter-title h2 { margin: 0; max-width: 800px; color: var(--tmws-ink); font-family: var(--tmws-font-title); font-size: clamp(26px, 3vw, 38px); font-weight: 400; line-height: 1.12; }
.tmws-matter-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0; }
.tmws-matter-badges span { padding: 5px 8px; color: #5e5559; background: #fbf7f5; border: 1px solid var(--tmws-line); border-radius: 999px; font-size: 10px; }
.tmws-matter-badges .tmws-status--active { color: #17653b; background: #edf8f1; border-color: #cfe9d8; }
.tmws-matter-badges .tmws-status--on_hold { color: #7b5712; background: #fff7e5; border-color: #efdfb6; }
.tmws-matter-badges .tmws-status--closed { color: #665a5f; background: #f3f0f1; border-color: #ddd5d8; }
.tmws-matter-badges .tmws-status--archived { color: #6c4f19; background: #fff9ed; border-color: var(--tmws-line-gold); }
.tmws-matter-actions { position: absolute; z-index: 2; top: 23px; right: 72px; display: flex; gap: 7px; }
.tmws-matter-actions a,
.tmws-matter-actions button { min-height: var(--tmws-control-height); display: inline-flex; align-items: center; padding: 7px 12px; color: var(--tmws-wine); background: #fff; border: 1px solid rgba(128, 0, 32, .20); border-radius: var(--tmws-control-radius); cursor: pointer; font-size: var(--tmws-text-action); font-weight: 700; text-decoration: none; }
.tmws-matter-actions .is-primary { color: #fff; background: var(--tmws-wine); border-color: var(--tmws-wine); }
.tmws-matter-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 16px 0 0; background: var(--tmws-line); border: 1px solid var(--tmws-line); border-radius: 8px; overflow: hidden; }
.tmws-matter-facts > div { min-width: 0; padding: 12px 13px; background: var(--tmws-soft); }
.tmws-matter-facts dt { margin: 0 0 3px; color: var(--tmws-muted); font-size: var(--tmws-text-small); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.tmws-matter-facts dd { margin: 0; overflow: hidden; color: var(--tmws-ink); font-size: var(--tmws-text-body); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.tmws-matter-object { margin: 13px 0 0; color: #5d5357; font-size: var(--tmws-text-body); line-height: 1.55; }

.tmws-matter-tabs {
    display: inline-flex;
    gap: 4px;
    margin-top: 13px;
    padding: 4px;
    background: #eee8e5;
    border: 1px solid var(--tmws-line);
    border-radius: 9px;
}
.tmws-matter-tabs button { min-height: var(--tmws-control-height); padding: 7px 14px; color: #695f63; background: transparent; border: 0; border-radius: var(--tmws-control-radius); cursor: pointer; font-size: var(--tmws-text-action); font-weight: 700; }
.tmws-matter-tabs button.is-active { color: #fff; background: var(--tmws-wine); box-shadow: 0 4px 12px rgba(128, 0, 32, .18); }
.tmws-matter-pane { min-width: 0; }
.tmws-matter-pane--documents { margin-top: 15px; }
.tmws-documents-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 15px 0 10px; padding: 17px 19px; background: #fffaf2; border: 1px solid var(--tmws-line-gold); border-radius: var(--tmws-radius); }
.tmws-documents-intro span { color: var(--tmws-wine); font-size: var(--tmws-text-caption); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.tmws-documents-intro h3 { margin: 4px 0 0; color: var(--tmws-ink); font-family: var(--tmws-font-title); font-size: 21px; font-weight: 400; }
.tmws-documents-intro p { max-width: 650px; margin: 1px 0 0; color: var(--tmws-muted); font-size: var(--tmws-text-label); line-height: 1.55; }
.tmws-matter-pane--documents .tad-workbench--embedded { width: 100%; margin: 0; }
.tmws-matter-pane--documents .tad-workbench--embedded .tad-shell { min-height: 680px; border-radius: var(--tmws-radius); box-shadow: 0 12px 36px rgba(42, 18, 26, .08); }

.tmws-matter-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 15px; margin-top: 15px; align-items: start; }
.tmws-matter-work,
.tmws-task-rail { padding: 17px; }
.tmws-task-rail { position: sticky; top: 112px; }
.tmws-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.tmws-section-head h3 { margin: 0; color: var(--tmws-ink); font-family: var(--tmws-font-title); font-size: 20px; font-weight: 400; }
.tmws-section-head small { color: var(--tmws-muted); font-size: var(--tmws-text-small); }
.tmws-section-head b { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; color: #fff; background: var(--tmws-wine); border-radius: 999px; font-size: 10px; }
.tmws-task-head-actions { display: flex; align-items: center; gap: 7px; }
.tmws-task-head-actions button { min-height: 30px; padding: 5px 9px; color: var(--tmws-wine); background: #fff; border: 1px solid rgba(128, 0, 32, .20); border-radius: 7px; cursor: pointer; font-size: 10px; font-weight: 750; }
.tmws-task-head-actions button:hover,
.tmws-task-head-actions button:focus-visible { background: #fff7f9; border-color: rgba(128, 0, 32, .44); outline: 0; }
.tmws-matter-work #tcf-app { margin: 0 !important; }
.tmws-matter-work .tcf-topbar { min-height: 0; justify-content: flex-end; padding: 0 0 12px; border-bottom: 1px solid var(--tmws-line); }
.tmws-matter-work .tcf-tabs { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 7px !important; overflow: visible !important; }
.tmws-matter-work .tcf-tabs button { min-width: 0 !important; }
.tmws-task-list { display: grid; gap: 8px; }
.tmws-task { padding: 12px; background: var(--tmws-soft); border: 1px solid var(--tmws-line); border-left: 3px solid #a59b91; border-radius: 7px; }
.tmws-task--urgent { border-left-color: #b4232f; }
.tmws-task--high { border-left-color: var(--tmws-gold); }
.tmws-task > span { color: var(--tmws-muted); font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.tmws-task > strong { display: block; margin-top: 3px; color: var(--tmws-ink); font-size: var(--tmws-text-body); }
.tmws-task > p { margin: 5px 0 0; color: var(--tmws-muted); font-size: var(--tmws-text-small); }
.tmws-task footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--tmws-line); }
.tmws-task footer small { color: var(--tmws-muted); font-size: 9px; }
.tmws-task footer a { color: var(--tmws-wine); font-size: 10px; font-weight: 700; text-decoration: none; }
.tmws-task-actions { display: flex; align-items: center; gap: 7px; }
.tmws-task-actions form { margin: 0; }
.tmws-task-actions button { padding: 0; color: #17653b; background: transparent; border: 0; cursor: pointer; font-size: var(--tmws-text-action); font-weight: 700; }
.tmws-flow-success { display: flex; align-items: center; gap: 9px; margin-top: 12px; padding: 10px 13px; color: #175b37; background: #edf8f1; border: 1px solid #cfe9d8; border-radius: 8px; font-size: 11px; }
.tmws-flow-success span { color: #4f6759; }
.tmws-flow-success--error { color: #8f2430; background: #fff4f5; border-color: rgba(143, 36, 48, .22); }
.tmws-flow-success--error span { color: #725b61; }
.tmws-lifecycle { margin-top: 15px; padding: 17px 18px; background: linear-gradient(135deg, #fff 0%, #fbf7f5 100%); border: 1px solid var(--tmws-line); border-radius: var(--tmws-radius); }
.tmws-lifecycle-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.tmws-lifecycle-head > div > span { color: var(--tmws-wine); font-size: var(--tmws-text-caption); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.tmws-lifecycle-head h3 { margin: 4px 0 3px; color: var(--tmws-ink); font-family: var(--tmws-font-title); font-size: 22px; font-weight: 400; }
.tmws-lifecycle-head p { margin: 0; color: var(--tmws-muted); font-size: var(--tmws-text-label); line-height: 1.5; }
.tmws-lifecycle-head > b { flex: 0 0 auto; padding: 6px 9px; color: #76591d; background: #fff8e9; border: 1px solid var(--tmws-line-gold); border-radius: 999px; font-size: var(--tmws-text-small); }
.tmws-lifecycle-track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 17px 0 0; padding: 0; list-style: none; }
.tmws-lifecycle-track li { position: relative; min-width: 0; display: flex; align-items: center; gap: 7px; color: #9a8f93; font-size: var(--tmws-text-small); font-weight: 700; }
.tmws-lifecycle-track li:not(:last-child)::after { content: ""; position: absolute; z-index: 0; top: 7px; right: 6px; left: 22px; height: 1px; background: #ddd4d7; }
.tmws-lifecycle-track i { position: relative; z-index: 1; width: 15px; height: 15px; flex: 0 0 15px; display: block; background: #fff; border: 2px solid #cfc4c8; border-radius: 50%; }
.tmws-lifecycle-track span { position: relative; z-index: 1; overflow: hidden; padding-right: 8px; background: #fbf8f6; text-overflow: ellipsis; white-space: nowrap; }
.tmws-lifecycle-track .is-done { color: #4e6959; }
.tmws-lifecycle-track .is-done i { background: #2b8754; border-color: #2b8754; box-shadow: inset 0 0 0 3px #fff; }
.tmws-lifecycle-track .is-done::after { background: #a9cfb9; }
.tmws-lifecycle-track .is-current { color: var(--tmws-wine); }
.tmws-lifecycle-track .is-current i { background: var(--tmws-wine); border-color: var(--tmws-wine); box-shadow: 0 0 0 4px rgba(128, 0, 32, .10), inset 0 0 0 3px #fff; }
.tmws-lifecycle-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--tmws-line); }
.tmws-lifecycle-actions form { margin: 0; }
.tmws-lifecycle-action { min-height: var(--tmws-control-height); padding: 7px 13px; color: var(--tmws-wine) !important; background: #fff !important; border: 1px solid rgba(128, 0, 32, .20) !important; border-radius: var(--tmws-control-radius); cursor: pointer; font-size: var(--tmws-text-action); font-weight: 700; transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
.tmws-lifecycle-action:not(.tmws-lifecycle-action--closed):not(.tmws-lifecycle-action--archived):hover,
.tmws-lifecycle-action:not(.tmws-lifecycle-action--closed):not(.tmws-lifecycle-action--archived):focus-visible { color: var(--tmws-wine) !important; background: #fff7f9 !important; border-color: rgba(128, 0, 32, .45) !important; box-shadow: var(--tmws-focus-ring); outline: 0; }
.tmws-lifecycle-action--closed { color: #fff !important; background: var(--tmws-wine) !important; border-color: var(--tmws-wine) !important; }
.tmws-lifecycle-action--closed:hover,
.tmws-lifecycle-action--closed:focus-visible { color: #fff !important; background: var(--tmws-wine-dark) !important; border-color: var(--tmws-wine-dark) !important; box-shadow: var(--tmws-focus-ring); outline: 0; }
.tmws-lifecycle-action--archived { color: #644610 !important; background: #fff8e8 !important; border-color: var(--tmws-line-gold) !important; }
.tmws-lifecycle-action--archived:hover,
.tmws-lifecycle-action--archived:focus-visible { color: #644610 !important; background: #fff4da !important; border-color: rgba(164, 122, 36, .42) !important; box-shadow: 0 0 0 3px rgba(164, 122, 36, .12); outline: 0; }
.tmws-flow-launcher { display: grid; grid-template-columns: minmax(230px, .72fr) minmax(0, 1.55fr); gap: 18px; margin-top: 15px; padding: 17px; background: #fff; border: 1px solid var(--tmws-line); border-radius: var(--tmws-radius); }
.tmws-flow-intro > span,
.tmws-flow-options button > span { color: var(--tmws-wine); font-size: 9px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.tmws-flow-intro h3 { margin: 5px 0 7px; color: var(--tmws-ink); font-family: var(--tmws-font-title); font-size: 21px; font-weight: 400; }
.tmws-flow-intro p { max-width: 360px; margin: 0; color: var(--tmws-muted); font-size: var(--tmws-text-label); line-height: 1.55; }
.tmws-flow-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tmws-flow-options form { min-width: 0; margin: 0; }
.tmws-flow-options button { position: relative; width: 100%; min-height: 116px; display: flex; flex-direction: column; align-items: flex-start; padding: 12px 12px 31px; color: var(--tmws-ink); background: var(--tmws-soft); border: 1px solid var(--tmws-line); border-radius: 8px; cursor: pointer; text-align: left; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.tmws-flow-options button:hover,
.tmws-flow-options button:focus-visible { background: #fff8f9; border-color: rgba(128, 0, 32, .35); outline: none; transform: translateY(-1px); }
.tmws-flow-options button strong { margin-top: 4px; font-family: var(--tmws-font-title); font-size: 15px; font-weight: 400; }
.tmws-flow-options button small { margin-top: 5px; color: var(--tmws-muted); font-size: var(--tmws-text-small); line-height: 1.45; }
.tmws-flow-options button b { position: absolute; bottom: 10px; left: 12px; color: var(--tmws-gold); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }

.tmws-empty,
.tmws-locked { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 26px; color: var(--tmws-ink); background: #fff; border: 1px solid var(--tmws-line); border-radius: 9px; }
.tmws-empty span,
.tmws-locked span { color: var(--tmws-muted); font-size: 12px; }
.tmws-empty button { margin-top: 7px; padding: 8px 11px; color: #fff; background: var(--tmws-wine); border: 0; border-radius: 7px; cursor: pointer; }
.tmws-empty--compact { padding: 16px; background: var(--tmws-soft); }

.tmws-auth-screen,
.tmws-auth-screen * { box-sizing: border-box; }
.tmws-auth-screen {
    position: fixed;
    z-index: 100000;
    inset: 0;
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(380px, .78fr) minmax(440px, 1fr);
    margin: 0;
    color: var(--tmws-ink);
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    font-family: var(--tmws-font-ui);
    text-align: left;
}
.tmws-auth-visual {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: clamp(34px, 4vw, 64px);
    color: #fff;
    background:
        linear-gradient(rgba(128, 0, 32, .93), rgba(128, 0, 32, .93)),
        url('https://www.tucamaria.ro/wp-content/uploads/2026/09/ChatGPT-Image-Sep-1-2026-at-10_13_06-AM-1.avif') center / cover no-repeat;
    background-blend-mode: multiply;
    isolation: isolate;
    overflow: hidden;
}
.tmws-auth-orbit { position: absolute; z-index: 0; border: 1px solid rgba(221, 190, 126, .38); border-radius: 50%; pointer-events: none; }
.tmws-auth-orbit--one { width: 520px; height: 520px; right: -240px; bottom: -190px; }
.tmws-auth-orbit--two { width: 390px; height: 390px; right: -175px; bottom: -125px; border-color: rgba(221, 190, 126, .25); }
.tmws-auth-visual > header,
.tmws-auth-promise { position: relative; z-index: 1; }
.tmws-auth-visual > header { display: flex; align-items: center; gap: 15px; }
.tmws-auth-logo { width: 58px; height: 58px; object-fit: contain; }
.tmws-auth-monogram { width: 68px; height: 68px; display: grid; place-items: center; color: #f4ddb0; border: 1px solid rgba(226,199,142,.62); border-radius: 50%; font: 400 24px/1 var(--tmws-font-title); }
.tmws-auth-visual > header div { min-width: 0; padding-left: 15px; border-left: 1px solid rgba(226, 199, 142, .36); }
.tmws-auth-visual > header span,
.tmws-auth-visual > header strong { display: block; }
.tmws-auth-visual > header span { color: rgba(255,255,255,.64); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.tmws-auth-visual > header strong { margin-top: 4px; color: #fff; font-family: var(--tmws-font-title); font-size: 21px; font-weight: 400; }
.tmws-auth-promise { max-width: 430px; margin: auto 0; padding: 48px 0; }
.tmws-auth-promise > span { color: #e2c78e; font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.tmws-auth-promise h1 { margin: 14px 0 12px; color: #fff; font-family: var(--tmws-font-title); font-size: clamp(32px, 3.4vw, 46px); font-weight: 400; letter-spacing: -.025em; line-height: 1.08; }
.tmws-auth-promise p { max-width: 390px; margin: 0; color: rgba(255,255,255,.74); font-size: 14px; line-height: 1.6; }
.tmws-auth-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background:
        radial-gradient(circle at 100% 0, rgba(168,120,46,.09), transparent 27%),
        linear-gradient(180deg, #fff, #fdfaf8);
    overflow: hidden;
}
.tmws-auth-panel > * { width: min(100%, 420px); }
.tmws-auth-status { width: fit-content; min-height: 31px; display: inline-flex; align-items: center; gap: 9px; padding: 6px 11px; color: #725216; background: #fff9e9; border: 1px solid rgba(168,120,46,.23); border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tmws-auth-status i { background: #2f8955; box-shadow: 0 0 0 4px rgba(47,137,85,.10); }
.tmws-auth-overline { margin: 0 0 8px; color: var(--tmws-wine); font-size: 10px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.tmws-auth-panel h2 { margin: 0; color: #1a1014; font-family: var(--tmws-font-title); font-size: 36px; font-weight: 400; letter-spacing: -.025em; line-height: 1.06; }
.tmws-auth-lead { margin: 12px 0 26px; color: #70656a; font-size: 14px; line-height: 1.55; }
.tmws-auth-panel > form { width: min(100%, 420px); }
.tmws-auth-panel form { display: grid; gap: 17px; margin: 0; }
.tmws-auth-panel form p { margin: 0; }
.tmws-auth-panel form label { display: grid; gap: 7px; color: #463b3f; font-size: 12px; font-weight: 700; }
.tmws-auth-panel form input[type="text"],
.tmws-auth-panel form input[type="email"],
.tmws-auth-panel form input[type="password"] { width: 100%; height: 54px; padding: 11px 15px; color: #1a1114; background: #fff; border: 1px solid #d8cdd0; border-radius: 11px; box-shadow: 0 6px 18px rgba(42,18,26,.025); font: 15px/1.2 var(--tmws-font-ui); transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.tmws-auth-panel form input:hover { border-color: rgba(128,0,32,.34); }
.tmws-auth-panel form input:focus { background: #fff; border-color: var(--tmws-wine); box-shadow: 0 0 0 4px rgba(128,0,32,.09); outline: 0; }
.tmws-auth-panel .login-remember label { display: flex; align-items: center; gap: 9px; color: #6d6266; font-size: 12px; font-weight: 500; }
.tmws-auth-panel .login-remember input { width: 17px; height: 17px; margin: 0; accent-color: var(--tmws-wine); }
.tmws-auth-panel .tmws-auth-remember { display: flex; align-items: center; gap: 9px; color: #6d6266; font-size: 12px; font-weight: 500; }
.tmws-auth-panel .tmws-auth-remember input { width: 17px; height: 17px; margin: 0; accent-color: var(--tmws-wine); }
.tmws-auth-panel .login-submit input { width: 100%; min-height: 54px; color: #fff; background: linear-gradient(135deg, #79001e, #980027); border: 1px solid #79001e; border-radius: 11px; box-shadow: 0 12px 26px rgba(128,0,32,.18); cursor: pointer; font: 700 14px/1 var(--tmws-font-ui); letter-spacing: .01em; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.tmws-auth-panel .login-submit input:hover,
.tmws-auth-panel .login-submit input:focus-visible { color: #fff; background: linear-gradient(135deg, #5f0018, #800020); box-shadow: 0 16px 32px rgba(128,0,32,.24), 0 0 0 4px rgba(128,0,32,.09); outline: 0; transform: translateY(-1px); }
.tmws-auth-primary { width: 100%; min-height: 54px; padding: 11px 16px; color: #fff; background: linear-gradient(135deg, #79001e, #980027); border: 1px solid #79001e; border-radius: 11px; box-shadow: 0 12px 26px rgba(128,0,32,.18); cursor: pointer; font: 700 14px/1 var(--tmws-font-ui); transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.tmws-auth-primary:hover,
.tmws-auth-primary:focus-visible { color: #fff; background: linear-gradient(135deg, #5f0018, #800020); box-shadow: 0 16px 32px rgba(128,0,32,.24), 0 0 0 4px rgba(128,0,32,.09); outline: 0; transform: translateY(-1px); }
.tmws-auth-error { margin: 0 0 18px; padding: 12px 14px; color: #7e1d29; background: #fff5f5; border: 1px solid rgba(143,36,48,.22); border-radius: 10px; font-size: 12px; line-height: 1.55; }
.tmws-auth-password-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.tmws-auth-password-tools button { min-height: 38px; padding: 8px 11px; color: var(--tmws-wine); background: #fff; border: 1px solid rgba(128,0,32,.22); border-radius: 9px; cursor: pointer; font: 700 11px/1.2 var(--tmws-font-ui); }
.tmws-auth-password-tools button:hover,
.tmws-auth-password-tools button:focus-visible { color: #fff; background: var(--tmws-wine); border-color: var(--tmws-wine); outline: 3px solid rgba(128,0,32,.10); }
.tmws-auth-password-hint { margin: -5px 0 0 !important; color: #877b7f; font-size: 10px !important; line-height: 1.5; }
.tmws-auth-password-hint.is-success { color: var(--tmws-success); }
.tmws-auth-assist { display: flex; justify-content: flex-start; gap: 14px; margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(128,0,32,.10); }
.tmws-auth-assist span { color: #968b8f; font-size: 10px; }
.tmws-auth-reset { color: var(--tmws-wine) !important; font-size: 11px; font-weight: 700; text-decoration: none !important; }
.tmws-auth-reset:hover,
.tmws-auth-reset:focus-visible { color: var(--tmws-wine-dark) !important; text-decoration: underline !important; outline: 0; }
.tmws-auth-notice { display: grid; gap: 6px; margin: 0 0 26px; padding: 17px 18px; color: #463a3e; background: #fff8ea; border: 1px solid rgba(168,120,46,.22); border-radius: 12px; }
.tmws-auth-notice strong { color: #76571a; font-size: 12px; }
.tmws-auth-notice span { color: #74686c; font-size: 12px; line-height: 1.55; }
.tmws-auth-secondary { width: 100%; min-height: 50px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; color: var(--tmws-wine) !important; background: #fff; border: 1px solid rgba(128,0,32,.24); border-radius: 11px; font-size: 13px; font-weight: 700; text-decoration: none !important; }
.tmws-auth-secondary:hover,
.tmws-auth-secondary:focus-visible { color: var(--tmws-wine-dark) !important; background: #fff6f8; border-color: rgba(128,0,32,.42); box-shadow: var(--tmws-focus-ring); outline: 0; }

@media (max-width: 820px) {
    .tmws-auth-screen { width: 100%; height: 100vh; height: 100dvh; min-height: 0; grid-template-columns: 1fr; margin: 0; border-radius: 0; overflow: hidden; }
    .tmws-auth-visual { display: none; }
    .tmws-auth-panel { min-height: 0; padding: 28px 24px; }
    .tmws-auth-panel h2 { font-size: 34px; }
}

.tmws-command { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: start center; padding: min(13vh, 110px) 16px 20px; }
.tmws-root.is-command-open > .tmws-sidebar,
.tmws-root.is-command-open > .tmws-main,
.tmws-root.is-command-open > .tmws-mobile-bar,
.tmws-root.is-command-open > .tmws-mobile-dock {
    pointer-events: none;
    filter: blur(2.5px);
}
.tmws-command-backdrop,
.tmws-command-backdrop:hover,
.tmws-command-backdrop:focus,
.tmws-command-backdrop:focus-visible,
.tmws-command-backdrop:active {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 3, 5, .70) !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
    backdrop-filter: none !important;
}
.tmws-command-dialog { position: relative; z-index: 2; width: min(640px, 100%); max-height: min(700px, 78vh); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--tmws-line-gold); border-radius: 11px; box-shadow: 0 32px 90px rgba(0, 0, 0, .30); overflow: hidden; }
.tmws-command-dialog > header { min-height: 58px; display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-bottom: 1px solid var(--tmws-line); }
.tmws-command-dialog > header svg { flex: 0 0 20px; color: var(--tmws-wine); }
.tmws-command-dialog input { min-width: 0; flex: 1; height: 38px; padding: 0; color: var(--tmws-ink); background: transparent; border: 0; box-shadow: none; outline: 0; font-size: 15px; }
.tmws-command-results { min-height: 160px; padding: 8px; overflow: auto; }
.tmws-command-results > p { margin: 10px 8px 5px; color: var(--tmws-gold); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.tmws-command-results > button,
.tmws-command-results > a { width: 100%; min-height: 49px; display: flex; align-items: center; gap: 10px; padding: 7px 9px; color: var(--tmws-ink); background: transparent; border: 0; border-radius: 7px; cursor: pointer; text-align: left; text-decoration: none; }
.tmws-command-results > button:hover,
.tmws-command-results > a:hover,
.tmws-command-results > button:focus-visible,
.tmws-command-results > a:focus-visible { color: var(--tmws-wine); background: #fbf4f6; outline: none; }
.tmws-command-results .tmws-nav-icon { color: var(--tmws-wine); background: #f7e9ed; border-radius: 6px; }
.tmws-command-results > button > span:nth-child(2),
.tmws-command-results > a > span:nth-child(2) { min-width: 0; flex: 1; }
.tmws-command-results strong,
.tmws-command-results small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmws-command-results strong { font-size: var(--tmws-text-action); }
.tmws-command-results small { margin-top: 2px; color: var(--tmws-muted); font-size: var(--tmws-text-small); }
.tmws-command-results > button > svg,
.tmws-command-results > a > svg { width: 15px; height: 15px; color: #a89ba0; }
.tmws-command-empty { padding: 30px 12px; color: var(--tmws-muted); font-size: 12px; text-align: center; }
.tmws-command-dialog > footer { display: flex; gap: 18px; padding: 8px 13px; color: var(--tmws-muted); background: var(--tmws-soft); border-top: 1px solid var(--tmws-line); font-size: 9px; }
.tmws-command-dialog > footer span { display: flex; align-items: center; gap: 4px; }

/* One contextual action surface shared by Azi and Calendar. */
.tmws-quick-action {
    position: fixed;
    inset: 0;
    z-index: 100010;
    display: grid;
    place-items: center;
    padding: 18px;
    overflow: hidden;
    overscroll-behavior: none;
    animation: none !important;
    transition: none !important;
}
.tmws-quick-action,
.tmws-quick-action * { box-sizing: border-box; }
.tmws-quick-action__backdrop,
.tmws-quick-action__backdrop:hover,
.tmws-quick-action__backdrop:focus,
.tmws-quick-action__backdrop:active {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: rgba(10, 3, 5, .58);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: blur(8px);
    transform: none !important;
    transition: none !important;
    animation: none !important;
    touch-action: manipulation;
    cursor: default;
}
.tmws-quick-action__dialog {
    position: relative;
    z-index: 2;
    width: min(560px, 100%);
    max-height: min(760px, calc(100dvh - 36px));
    overflow: auto;
    color: var(--tmws-ink);
    background: #fff;
    border: 1px solid var(--tmws-line-gold);
    border-radius: 13px;
    box-shadow: 0 34px 100px rgba(0, 0, 0, .30);
    overscroll-behavior: contain;
    transform: none !important;
    transition: none !important;
    animation: none !important;
}
.tmws-quick-action__dialog > header {
    position: sticky;
    top: 0;
    z-index: 3;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--tmws-line);
    backdrop-filter: blur(12px);
}
.tmws-quick-action__dialog > header span { display: block; color: var(--tmws-gold); font-size: var(--tmws-text-caption); font-weight: 700; letter-spacing: .10em; text-transform: uppercase; }
.tmws-quick-action__dialog > header h2 { margin: 2px 0 0; color: var(--tmws-ink); font: 600 22px/1.15 var(--tmws-font-title); }
.tmws-quick-action__dialog > header button { width: 38px; height: 38px; display: grid; flex: 0 0 38px; place-items: center; padding: 0; color: var(--tmws-muted); background: var(--tmws-soft); border: 1px solid var(--tmws-line); border-radius: 50%; cursor: pointer; }
.tmws-quick-action__dialog > header button:hover,
.tmws-quick-action__dialog > header button:focus-visible { color: var(--tmws-wine); border-color: rgba(128, 0, 32, .34); outline: var(--tmws-focus-ring); }
.tmws-quick-action__dialog > header svg { width: 17px; height: 17px; }
.tmws-quick-action__dialog [data-tmws-quick-panel] { padding: 18px; }
.tmws-quick-action__dialog form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; }
.tmws-calendar-choice { display: grid; gap: 12px; }
.tmws-calendar-choice__date { margin: 0; color: var(--tmws-wine); font-size: var(--tmws-text-label); font-weight: 800; text-transform: capitalize; }
.tmws-calendar-choice__intro { margin: 0 0 2px; color: var(--tmws-muted); font-size: var(--tmws-text-body); }
.tmws-calendar-choice__options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tmws-calendar-choice__options button {
    min-height: 142px;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding: 17px;
    color: var(--tmws-ink);
    background: linear-gradient(145deg, #fff, #fbf7f5);
    border: 1px solid rgba(128, 0, 32, .14);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(42, 18, 26, .05);
    cursor: pointer;
    text-align: left;
}
.tmws-calendar-choice__options button:hover,
.tmws-calendar-choice__options button:focus-visible { border-color: rgba(128, 0, 32, .42); box-shadow: 0 12px 30px rgba(70, 24, 36, .10), var(--tmws-focus-ring); outline: 0; }
.tmws-calendar-choice__options button > span { color: var(--tmws-gold); font-size: var(--tmws-text-caption); font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.tmws-calendar-choice__options button > strong { color: var(--tmws-wine); font: 600 18px/1.2 var(--tmws-font-title); }
.tmws-calendar-choice__options button > small { color: var(--tmws-muted); font-size: var(--tmws-text-small); line-height: 1.4; }
.tmws-quick-field { min-width: 0; display: grid; gap: 6px; margin: 0; }
.tmws-quick-field--wide { grid-column: 1 / -1; }
.tmws-quick-field > span,
.tmws-quick-mode legend { color: #453a3f; font-size: var(--tmws-text-label); font-weight: 700; }
.tmws-quick-field span small { color: var(--tmws-muted); font-size: var(--tmws-text-small); font-weight: 500; }
.tmws-quick-field :is(input, select, textarea) {
    width: 100%;
    min-height: var(--tmws-control-height);
    margin: 0;
    padding: 9px 11px;
    color: var(--tmws-ink);
    background: #fff;
    border: 1px solid rgba(128, 0, 32, .18);
    border-radius: var(--tmws-control-radius);
    box-shadow: none;
    font: 500 var(--tmws-text-body)/1.35 var(--tmws-font-ui);
}
.tmws-quick-field textarea { min-height: 78px; resize: vertical; }
.tmws-quick-field :is(input, select, textarea):focus { border-color: rgba(128, 0, 32, .56); box-shadow: var(--tmws-focus-ring); outline: 0; }
.tmws-person-picker__control { position: relative; min-width: 0; }
.tmws-person-picker__hint { color: var(--tmws-muted); font-size: var(--tmws-text-small); font-weight: 500; line-height: 1.35; }
.tmws-person-results {
    position: absolute;
    z-index: 12;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    max-height: 286px;
    padding: 5px;
    overflow: auto;
    background: #fff;
    border: 1px solid rgba(128, 0, 32, .18);
    border-radius: 9px;
    box-shadow: 0 18px 48px rgba(36, 15, 22, .18);
    overscroll-behavior: contain;
}
.tmws-person-option {
    width: 100%;
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 10px;
    padding: 9px 10px;
    color: var(--tmws-ink);
    background: transparent;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    text-align: left;
}
.tmws-person-option:hover,
.tmws-person-option:focus-visible,
.tmws-person-option[aria-selected="true"] { color: var(--tmws-wine); background: #fbf1f4; outline: 0; }
.tmws-person-option strong { min-width: 0; overflow: hidden; font-size: var(--tmws-text-action); text-overflow: ellipsis; white-space: nowrap; }
.tmws-person-option__meta { align-self: center; color: var(--tmws-muted); font-size: var(--tmws-text-small); font-weight: 600; white-space: nowrap; }
.tmws-person-option small { grid-column: 1 / -1; min-width: 0; overflow: hidden; color: var(--tmws-muted); font-size: var(--tmws-text-small); text-overflow: ellipsis; white-space: nowrap; }
.tmws-person-results__empty { padding: 16px 12px; color: var(--tmws-muted); font-size: var(--tmws-text-small); text-align: center; }
.tmws-person-context {
    padding: 12px;
    background: linear-gradient(135deg, #fffafa, #fbf5f1);
    border: 1px solid rgba(128, 0, 32, .14);
    border-left: 3px solid var(--tmws-wine);
    border-radius: 8px;
}
.tmws-person-context > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tmws-person-context > header div { min-width: 0; }
.tmws-person-context > header strong,
.tmws-person-context > header small { display: block; }
.tmws-person-context > header strong { color: var(--tmws-wine); font-size: var(--tmws-text-label); }
.tmws-person-context > header small { margin-top: 2px; color: var(--tmws-muted); font-size: var(--tmws-text-small); }
.tmws-person-context > header > span { flex: 0 0 auto; padding: 4px 7px; color: var(--tmws-wine); background: #f7e8ed; border-radius: 999px; font-size: var(--tmws-text-caption); font-weight: 700; }
.tmws-person-context > p { max-height: 108px; margin: 10px 0 7px; overflow: auto; color: #392e33; font-size: var(--tmws-text-label); line-height: 1.45; white-space: pre-wrap; }
.tmws-person-context > small { color: var(--tmws-muted); font-size: var(--tmws-text-small); font-weight: 600; }
.tmws-new-person-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tmws-quick-mode { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; border: 0; }
.tmws-quick-mode--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tmws-quick-mode legend { grid-column: 1 / -1; margin-bottom: 6px; }
.tmws-quick-mode label { position: relative; min-height: 44px; display: grid; place-items: center; margin: 0; cursor: pointer; }
.tmws-quick-mode input { position: absolute; opacity: 0; pointer-events: none; }
.tmws-quick-mode label span { width: 100%; height: 100%; display: grid; place-items: center; padding: 9px 12px; color: var(--tmws-ink); background: var(--tmws-soft); border: 1px solid var(--tmws-line); border-radius: var(--tmws-control-radius); font-size: var(--tmws-text-action); font-weight: 700; }
.tmws-quick-mode input:checked + span { color: #fff; background: var(--tmws-wine); border-color: var(--tmws-wine); }
.tmws-quick-note { grid-column: 1 / -1; margin: -2px 0 0; color: var(--tmws-muted); font-size: var(--tmws-text-small); }
.tmws-quick-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }
.tmws-quick-status { grid-column: 1 / -1; min-height: 20px; margin: 0; color: var(--tmws-success); font-size: var(--tmws-text-small); font-weight: 700; }
.tmws-quick-status[data-tone="error"] { color: var(--tmws-danger); }
.tmws-quick-status[data-tone="warning"] { color: #9a6a16; }
.tmws-action-toast[data-tone="warning"] { background: #9a6a16; color: #fff; }
.tmws-new-person-fields__intro { grid-column: 1 / -1; margin: 0; color: var(--tmws-muted); font-size: var(--tmws-text-small); line-height: 1.45; }
.tmws-action-toast { position: fixed; z-index: 100020; right: 18px; bottom: 18px; max-width: min(380px, calc(100vw - 36px)); padding: 11px 14px; color: #fff; background: var(--tmws-black); border: 1px solid rgba(201, 169, 110, .34); border-radius: 9px; box-shadow: 0 18px 48px rgba(0, 0, 0, .26); font-size: var(--tmws-text-body); font-weight: 700; }
.tmws-action-toast[data-tone="error"] { background: #35121c; }
.tmws-route-pending {
    position: absolute;
    z-index: 90;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(247, 245, 242, .70);
    pointer-events: auto;
}
.tmws-route-pending > div {
    min-width: min(360px, calc(100vw - 44px));
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 3px 12px;
    align-items: center;
    padding: 16px 18px;
    color: var(--tmws-ink);
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(168, 120, 46, .28);
    border-radius: 13px;
    box-shadow: 0 22px 70px rgba(42, 18, 26, .16);
}
.tmws-route-pending span {
    grid-row: 1 / span 2;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(128, 0, 32, .14);
    border-top-color: var(--tmws-wine);
    border-radius: 50%;
    animation: tmwsRouteSpin .72s linear infinite;
}
.tmws-route-pending strong { color: var(--tmws-wine); font-size: var(--tmws-text-action); line-height: 1.15; }
.tmws-route-pending small { color: var(--tmws-muted); font-size: var(--tmws-text-small); line-height: 1.25; }
.tmws-root.is-route-pending .tmws-content { pointer-events: none; }
.tmcb-task-card.is-new { animation: tmwsTaskArrive .55s ease both; }

.tmws-shell .tmcb-task-card.is-updating,
.tmws-shell .tmws-task.is-updating,
.tmws-shell .tmcb-client-action-row.is-updating {
    opacity: .62;
    pointer-events: none;
    transition: opacity .16s ease;
}
@keyframes tmwsRouteSpin { to { transform: rotate(360deg); } }
@keyframes tmwsTaskArrive { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.tmws-mobile-bar,
.tmws-mobile-dock,
.tmws-mobile-context,
.tmws-sidebar-scrim { display: none; }

@media (max-width: 1120px) {
    .tmws-root { --tmws-sidebar: 214px; }
    .tmws-matter-grid { grid-template-columns: minmax(0, 1fr) 280px; }
    .tmws-matter-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tmws-heading p { max-width: 460px; }
}

@media (max-width: 860px) {
    .tmws-root { --tmws-control-height: 44px; position: fixed; inset: 0; width: auto; max-width: none; height: 100vh; height: 100dvh; min-height: 0; margin: 0; padding-top: env(safe-area-inset-top); transform: none; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); border: 0; border-radius: 0; overflow: hidden; overscroll-behavior: none; }
    .tmws-root[data-tmws-window="normal"] {
        position: relative;
        inset: auto;
        z-index: 100000;
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: calc(100dvh - 16px);
        margin: 8px auto 18px;
        padding-top: 0;
        overflow: visible;
        overscroll-behavior: auto;
        pointer-events: auto;
        isolation: isolate;
    }
    .tmws-root[data-tmws-window="normal"] .tmws-main,
    .tmws-root[data-tmws-window="normal"] .tmws-content,
    .tmws-root[data-tmws-window="normal"] .tmws-panel,
    .tmws-root[data-tmws-window="normal"] .tmws-module-surface,
    .tmws-root[data-tmws-window="normal"] .tmws-panel--matter {
        max-height: none;
        overflow: visible;
    }
    .tmws-root[data-tmws-window="normal"] .tmws-panel--directory,
    .tmws-root[data-tmws-window="normal"] .tmws-panel--directory .tmws-module-surface,
    .tmws-root[data-tmws-window="normal"] .tmws-directory-scroll {
        height: auto;
        overflow: visible;
    }
    .tmws-main { grid-row: 2; min-width: 0; min-height: 0; max-height: 100%; overflow: hidden; }
    .tmws-content,
    .tmws-module-surface { min-width: 0; max-width: 100%; overflow-x: clip; }
    .tmws-mobile-bar { position: relative; grid-row: 1; z-index: 35; min-height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 7px 11px; color: #fff; background: linear-gradient(90deg, var(--tmws-black), var(--tmws-wine)); border-bottom: 1px solid rgba(201, 169, 110, .34); }
    .tmws-mobile-brand { display: flex; align-items: center; gap: 7px; min-width: 0; }
    .tmws-mobile-brand .tmws-brand-logo { width: 34px; height: 34px; }
    .tmws-mobile-brand strong { overflow: hidden; font-family: var(--tmws-font-title); font-size: 14px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
    .tmws-mobile-actions { display: flex; align-items: center; gap: 3px; }
    .tmws-mobile-context { min-height: 40px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; color: #fff4dc !important; background: rgba(255, 255, 255, .07); border: 1px solid rgba(201, 169, 110, .32); border-radius: 999px; font-size: 12px; font-weight: 700; text-decoration: none !important; }
    .tmws-mobile-context svg { width: 14px; height: 14px; }
    .tmws-mode-toggle { min-height: 40px; padding: 4px 10px; color: #fff4dc; background: rgba(201, 169, 110, .12); border: 1px solid rgba(201, 169, 110, .44); border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
    .tmws-mode-toggle[aria-pressed="true"] { color: #fff; background: rgba(128, 0, 32, .72); }
    .tmws-root[data-tmws-device="desktop"] .tmws-mode-toggle { display: none; }
    .tmws-icon-button,
    .tmws-sidebar-close { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; color: inherit; background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
    .tmws-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10002; width: min(292px, 86vw); transform: translateX(-102%); box-shadow: 18px 0 48px rgba(0, 0, 0, .28); transition: transform .20s ease; }
    .tmws-sidebar.is-open { transform: none; }
    .tmws-sidebar.is-open ~ .tmws-mobile-dock { display: none !important; }
    .tmws-sidebar-close { margin-left: auto; color: rgba(255, 255, 255, .72); }
    .tmws-sidebar-scrim { position: fixed; inset: 0; z-index: 10001; display: block; background: rgba(10, 3, 5, .58); border: 0; }
    .tmws-topbar { top: auto; min-height: 72px; padding: 10px 13px; }
    .tmws-heading > span,
    .tmws-heading p { display: none; }
    .tmws-heading h1 { font-size: 20px; }
    .tmws-context-pill { display: none; }
    .tmws-search-button { display: none; }
    .tmws-search-button span,
    .tmws-search-button kbd { display: none; }
    .tmws-content { padding: 10px; }
    .tmws-module-surface { padding: 12px; }
    .tmws-panel--directory .tmws-module-surface { padding: 0; }
    .tmws-directory-toolbar { min-height: 56px; align-items: stretch; flex-direction: column; gap: 7px; padding: 10px 10px 0; }
    .tmws-directory-switch { width: 100%; }
    .tmws-directory-switch button { min-height: 36px; padding-inline: 10px; }
    .tmws-directory-actions { width: 100%; flex: 0 0 auto; }
    .tmws-directory-actions .trd-sync-wrap { justify-content: flex-end; }
    .tmws-directory-scroll { padding: 10px 10px 18px; }
    .tmws-matter-grid { grid-template-columns: 1fr; }
    .tmws-task-rail { position: static; }
    .tmws-root[data-active-view="settings"] .tmws-content { overflow: auto; }
    .tmws-root[data-active-view="settings"] .tmws-panel[data-tmws-panel="settings"],
    .tmws-root[data-active-view="settings"] .tmws-module-surface--settings,
    .tmws-settings { height: auto; min-height: 100%; }
    .tmws-settings-layout { height: auto; grid-template-columns: 1fr; }
    .tmws-settings-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); border-right: 0; border-bottom: 1px solid var(--tmws-line-gold); }
    .tmws-settings-nav button { min-height: 66px; }
    .tmws-settings-nav small { overflow: visible; line-height: 1.25; text-overflow: clip; white-space: normal; }
    .tmws-settings-panels { padding: 16px; overflow: visible; }
    .tmws-settings-grid,
    .tmws-settings-switchboard--two,
    .tmws-settings-template-grid,
    .tmws-access-logic,
    .tmws-integration-summary { grid-template-columns: 1fr; }
    .tmws-module-grid,
    .tmws-role-guide { grid-template-columns: 1fr; }
    .tmws-access-member > summary { grid-template-columns: 34px minmax(0, 1fr) auto; }
    .tmws-access-member > summary > b { grid-column: 2; width: max-content; }
    .tmws-access-member-action { grid-column: 3; grid-row: 1 / span 2; padding-inline: 9px; }
    .tmws-access-member-action > span { display: none; }
    .tmws-access-member-form { padding: 12px; }
    .tmws-access-password-tools { align-items: stretch; }
    .tmws-access-password-tools button { flex: 1 1 145px; }
    .tmws-access-password-tools span { flex-basis: 100%; }
    .tmws-access-remove { grid-template-columns: 1fr; align-items: stretch; }
    .tmws-access-calendar { grid-template-columns: 1fr; }
    .tmws-access-remove > [data-tmws-settings-status] { max-width: none; text-align: left; }
    .tmws-access-remove > button { width: 100%; }
    .tmws-settings-card { padding: 15px; }
    .tmws-settings-copyline { grid-template-columns: 1fr auto; }
    .tmws-settings-copyline span { grid-column: 1 / -1; }
    .tmws-settings-save { bottom: 0; }
    .tmws-auth { width: min(620px, calc(100% - 20px)); grid-template-columns: 1fr; margin: 10px auto; }
    .tmws-auth-quick { border-top: 1px solid rgba(201, 169, 110, .30); border-left: 0; }
    .tmws-today-case-banner {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        margin: 0 0 12px;
        padding: 14px;
    }
    .tmws-today-case-banner strong { font-size: 20px; }
    .tmws-today-case-banner__actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .tmws-today-case-banner__actions .tmws-ui-button { width: 100%; justify-content: center; }
    .tmws-flow-launcher { grid-template-columns: 1fr; }
    .tmws-lifecycle-track li { align-items: flex-start; flex-direction: column; gap: 5px; }
    .tmws-lifecycle-track li:not(:last-child)::after { top: 7px; left: 15px; }
    .tmws-lifecycle-track span { max-width: 100%; padding-right: 4px; font-size: 11px; white-space: normal; }
    .tmws-documents-intro { align-items: stretch; flex-direction: column; gap: 7px; }

    /* Mobile is a distinct quick-work surface. Desktop never enters viewer mode. */
    .tmws-root[data-tmws-mode="viewer"] .tmws-full-control { display: none !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-mobile-bar { padding-left: 14px; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-mobile-dock {
        position: fixed;
        z-index: 10000;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
        left: 8px;
        min-height: 58px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        padding: 5px;
        color: #fff;
        background: rgba(10, 3, 5, .97);
        border: 1px solid rgba(201, 169, 110, .38);
        border-radius: 13px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
        backdrop-filter: blur(14px);
    }
    .tmws-mobile-dock button { min-width: 0; display: grid; place-items: center; align-content: center; gap: 2px; padding: 5px 2px; color: rgba(255, 255, 255, .62); background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
    .tmws-mobile-dock button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
    .tmws-mobile-dock button span { overflow: hidden; max-width: 100%; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
    .tmws-mobile-dock button.is-active { color: #fff5dd; background: linear-gradient(155deg, rgba(128, 0, 32, .95), rgba(128, 0, 32, .60)); }
    .tmws-root[data-tmws-mode="viewer"] .tmws-content { padding-bottom: 82px; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--directory .tmws-directory-scroll { padding-bottom: 82px; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-directory-actions { display: none; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-topbar { min-height: 58px; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-heading h1 { font-size: 18px; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-primary-button { min-height: 34px; }
    /* Viewer: scan and act quickly, without editing or operational settings. */
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--dosare .trd-topbar,
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--dosare .trd-filters-header,
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--dosare .trd-sync-progress { display: none !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--dosare .trd-filter-row:last-child { display: none !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--dosare .trd-filters { padding: 9px !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--dosare .trd-stats { overflow-x: auto; scrollbar-width: none; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--clienti .tmcb-client-edit,
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--clienti .tmcb-client-edit-form,
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--clienti .tmcb-client-note-form,
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--clienti .tmcb-client-note-edit,
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--clienti .tmcb-client-panel--actions,
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--clienti .tmcb-client-casefile-empty .tmcb-client-action { display: none !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--clienti .tmcb-client-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--clienti .tmcb-client-metrics article { min-height: 78px !important; padding: 11px 8px !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tmws-matter-actions,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tmws-flow-launcher,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tmws-lifecycle-actions,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tmws-task-rail,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tcf-topbar-actions button,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter [data-tcf-tab="import"],
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tcf-panel form,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tcf-document-form,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tcf-document-actions { display: none !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tad-new-project,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tad-hero,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tad-card--form,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tad-card--facts,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tad-card--generation,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tad-source-form,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tad-header-links,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tad-link-client,
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tad-actions { display: none !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-panel--matter .tmws-documents-intro p { display: none; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-topbar { display: none !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-app { width: 100% !important; margin: 0 !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-shell { padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-tabs {
        width: 100% !important;
        min-width: 0 !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 4px !important;
        margin: 0 0 12px !important;
        padding: 4px !important;
        border-radius: 10px !important;
        overflow: hidden !important;
    }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-tabs button {
        width: auto !important;
        min-width: 0 !important;
        min-height: 42px !important;
        display: flex !important;
        justify-content: center !important;
        padding: 7px 4px !important;
        overflow: hidden !important;
        font-size: 13px !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        text-align: center !important;
    }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-tabs button span { display: none !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-panels > .tfc-panel,
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-panels > .tfc-empty,
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-panels > .tfc-loading { border-radius: 10px !important; box-shadow: none !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-issue-board > .tfc-preflight { display: none !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare :is(input, select, textarea) { font-size: 16px !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-fiscal-flow { display: grid; gap: 9px; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-new-document { width: auto !important; justify-self: start !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-invoice-detail--rapid { display: grid; gap: 12px; padding: 14px !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-invoice-detail--rapid > .tfc-section-head { align-items: flex-start; flex-direction: column; gap: 5px; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-invoice-detail--rapid > .tfc-table-actions { display: grid !important; grid-template-columns: 1fr; gap: 8px; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-invoice-detail--rapid > .tfc-table-actions button { width: 100% !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-receipt-success { display: grid; gap: 7px; padding: 20px 16px !important; text-align: center; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-receipt-success > span { color: var(--tmws-gold); font-size: var(--tmws-text-caption); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-receipt-success h3,
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-receipt-success p { margin: 0; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-receipt-success > div { display: grid; gap: 8px; margin-top: 9px; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-head > div:first-child span { color: var(--tmws-gold); font-size: var(--tmws-text-caption); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-head h3 { margin: 2px 0 3px; font-size: 20px; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-head p { margin: 0; color: var(--tmws-muted); font-size: var(--tmws-text-small); }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-head > .tfc-inline-alert,
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-head__actions { grid-column: 1 / -1; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-head__actions { display: flex; gap: 8px; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-head__actions > * { flex: 1; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-list { display: grid; gap: 8px; margin-top: 9px; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-card { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; padding: 13px; background: #fff; border: 1px solid var(--tmws-line); border-radius: 9px; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-card > div:first-child strong,
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-card > div:first-child span { display: block; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-card > div:first-child strong { color: var(--tmws-ink); font-size: var(--tmws-text-body); }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-card > div:first-child span { overflow: hidden; color: var(--tmws-muted); font-size: var(--tmws-text-small); text-overflow: ellipsis; white-space: nowrap; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-card > p { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; margin: 0; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-card > p span { padding: 4px 7px; color: var(--tmws-wine); background: rgba(128, 0, 32, .06); border-radius: 999px; font-size: var(--tmws-text-caption); font-weight: 700; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-card > b { align-self: start; color: var(--tmws-ink); font-size: var(--tmws-text-label); white-space: nowrap; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-card__actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-card__actions:empty { display: none; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-card__actions button { width: 100% !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--facturare .tfc-rapid-anaf-empty { padding: 24px 14px !important; text-align: center; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--calendar [data-view="month"] { display: none !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--calendar .trd-calendar-week { grid-template-columns: 1fr !important; overflow: visible !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--calendar .trd-calendar-week-col:has(.trd-calendar-week-empty):not(.today) { display: none !important; }
    .tmws-root[data-tmws-mode="viewer"] .tmws-module-surface--calendar .trd-calendar-week-col { min-width: 0 !important; }
}

/* Keep the registry's Status control as compact as Sorting and Display.
 * This rule must follow the shared primary-tab system, which is intentionally roomier. */
@media (min-width: 960px) {
    .tmws-ui-system .tmws-module-surface--calendar .trd-calendar-app .trd-topbar {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px 20px;
        padding-bottom: 12px;
    }
    .tmws-ui-system .tmws-module-surface--calendar .trd-topbar > .trd-calendar-controls {
        min-width: 0;
        flex: 0 0 auto;
    }
    .tmws-ui-system .tmws-module-surface--calendar .trd-topbar > .trd-calendar-summary {
        width: auto;
        min-width: 0;
        max-width: 860px;
        flex: 1 1 620px;
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 0 !important;
        margin: 0 0 0 auto !important;
        padding: 4px;
        background: #f5f2f0;
        border: 1px solid rgba(58, 43, 48, .10);
        border-radius: 12px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78);
    }
    .tmws-ui-system .tmws-module-surface--calendar .trd-topbar > .trd-calendar-summary .trd-calendar-source {
        min-width: 0;
        min-height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 0 6px;
        overflow: hidden;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        white-space: nowrap;
    }
    .tmws-ui-system .tmws-module-surface--calendar .trd-topbar > .trd-calendar-summary .trd-calendar-source + .trd-calendar-source {
        border-left: 1px solid rgba(58, 43, 48, .10);
    }
    .tmws-ui-system .tmws-module-surface--calendar .trd-topbar > .trd-calendar-summary .trd-calendar-source span {
        order: 1;
        display: inline !important;
        margin: 0;
        color: #5f5659;
        font: 700 clamp(13px, 1.15vw, var(--tmws-text-action))/1 var(--tmws-font-ui);
        white-space: nowrap;
    }
    .tmws-ui-system .tmws-module-surface--calendar .trd-topbar > .trd-calendar-summary .trd-calendar-source strong {
        order: 2;
        display: inline !important;
        margin: 0;
        color: var(--tmws-wine);
        font-family: var(--tmws-font-ui);
        font-size: clamp(13px, 1.05vw, var(--tmws-text-label));
        font-variant-numeric: tabular-nums;
        font-weight: 600;
        line-height: 1;
        opacity: .76;
        white-space: nowrap;
    }
    .tmws-ui-system .tmws-module-surface--calendar .trd-topbar > .trd-calendar-summary .trd-calendar-source strong::before { content: '('; }
    .tmws-ui-system .tmws-module-surface--calendar .trd-topbar > .trd-calendar-summary .trd-calendar-source strong::after { content: ')'; }
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row .trd-tabs {
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row .trd-tabs button {
        min-height: var(--tmws-control-height-compact) !important;
        padding: 0 11px !important;
        font-size: var(--tmws-text-action) !important;
    }
}

/* Wide desktop: one quiet iOS-like registry strip. The owner controls stay intact;
 * only their Workspace composition and visible density change. */
@media (min-width: 1280px) {
    /* The owner summary is folded into the first segmented group below. */
    .tmws-ui-system .tmws-module-surface--dosare .trd-stats {
        display: none !important;
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-filters {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0;
        min-height: 54px;
        padding: 6px;
        overflow: visible;
        background: #f5f2f0;
        border: 1px solid rgba(58, 43, 48, .12);
        border-radius: 14px;
        box-shadow: 0 1px 2px rgba(24, 17, 20, .04), inset 0 1px 0 rgba(255, 255, 255, .82);
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row {
        position: relative;
        width: auto;
        min-width: 0;
        min-height: 42px;
        gap: 0;
        padding: 2px !important;
        border: 0 !important;
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row:has(> .trd-tabs) {
        flex: 0 0 auto;
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row--court {
        width: 176px;
        min-width: 176px;
        max-width: 176px;
        flex: 0 0 176px;
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-label {
        position: absolute;
        z-index: 120;
        top: calc(100% + 8px);
        left: 50%;
        width: auto;
        padding: 5px 8px;
        color: #fff;
        background: #191417;
        border-radius: 7px;
        box-shadow: 0 7px 18px rgba(24, 17, 20, .18);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .02em;
        line-height: 1.2;
        opacity: 0;
        pointer-events: none;
        text-transform: none;
        transform: translate(-50%, -3px);
        transition: opacity .14s ease, transform .14s ease;
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-label::before {
        position: absolute;
        bottom: 100%;
        left: 50%;
        width: 8px;
        height: 8px;
        content: "";
        background: #191417;
        transform: translate(-50%, 4px) rotate(45deg);
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row:hover .trd-filter-label,
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row:focus-within .trd-filter-label {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row :is(.trd-tabs, .trd-sort-tabs, .trd-view-mode-tabs) {
        min-width: 0;
        flex-wrap: nowrap !important;
        gap: 1px !important;
        padding: 2px !important;
        background: rgba(118, 101, 107, .09) !important;
        border: 0 !important;
        border-radius: 10px !important;
        box-shadow: inset 0 0 0 1px rgba(58, 43, 48, .045) !important;
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row :is(.trd-tabs, .trd-sort-tabs, .trd-view-mode-tabs) button {
        position: relative;
        min-height: 34px !important;
        height: 34px !important;
        padding: 0 5px !important;
        color: #5f5659 !important;
        background: transparent !important;
        border-color: transparent !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        font-size: 13px !important;
        line-height: 1 !important;
        overflow: visible !important;
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-tabs .tmws-status-count {
        position: static;
        min-width: 0;
        height: auto;
        display: inline !important;
        margin-left: 4px;
        padding: 0;
        color: inherit;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        font-size: inherit;
        font-variant-numeric: tabular-nums;
        font-weight: 600;
        letter-spacing: inherit;
        line-height: inherit;
        opacity: .72;
        pointer-events: none;
        vertical-align: baseline;
        white-space: nowrap;
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row :is(.trd-tabs, .trd-sort-tabs, .trd-view-mode-tabs) button:not(.active):hover,
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row :is(.trd-tabs, .trd-sort-tabs, .trd-view-mode-tabs) button:not(.active):focus-visible {
        color: var(--tmws-ink) !important;
        background: rgba(255, 255, 255, .72) !important;
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row :is(.trd-tabs, .trd-sort-tabs, .trd-view-mode-tabs) button.active {
        color: #fff !important;
        background: var(--tmws-wine) !important;
        border-color: var(--tmws-wine) !important;
        box-shadow: 0 2px 6px rgba(128, 0, 32, .18) !important;
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-app .trd-filter-row--court .trd-court-select {
        width: 100% !important;
        min-width: 0;
        min-height: 40px !important;
        height: 40px !important;
        padding: 0 32px 0 11px;
        background-color: rgba(255, 255, 255, .76);
        border-color: rgba(58, 43, 48, .10);
        border-radius: 10px;
        font-size: 13px;
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-sort-tabs .trd-sort-icon {
        color: inherit !important;
        font-size: 11px !important;
    }
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-tooltip { display: none !important; }
}

@media (min-width: 861px) {
    body.admin-bar .tmws-root { height: calc(100vh - 56px); }
    body.admin-bar .tmws-topbar { top: 0; }
}

@media (max-width: 782px) {
    body.admin-bar .tmws-root { height: calc(100dvh - 46px); }
    body.admin-bar .tmws-mobile-bar { top: 0; }
    body.admin-bar .tmws-sidebar,
    body.admin-bar .tmws-sidebar-scrim { top: 46px; }
    body.admin-bar .tmws-topbar { top: auto; }
    body.admin-bar.tmws-app-maximized .tmws-sidebar,
    body.admin-bar.tmws-app-maximized .tmws-sidebar-scrim { top: 0; }
}

@media (max-width: 640px) {
    .tmws-topbar { gap: 8px; overflow: hidden; }
    .tmws-heading { min-width: 0; flex: 1 1 0; }
    .tmws-topbar-actions { min-width: 0; gap: 5px; }
    .tmws-window-controls { flex: 0 0 auto; }
    .tmws-window-controls button { width: 40px; height: 40px; }
    .tmws-primary-button { min-height: var(--tmws-control-height); padding: 7px 10px; font-size: var(--tmws-text-action); }
    .tmws-module-surface { padding: 10px; border-radius: 7px; }
    .tmws-module-surface .trd-topbar,
    .tmws-module-surface .tfc-topbar,
    .tmws-module-surface .tvc-topbar { align-items: stretch; }
    .tmws-module-surface .trd-topbar-actions,
    .tmws-module-surface .trd-calendar-controls,
    .tmws-module-surface .tvc-topbar-actions { justify-content: flex-start; }
    .tmws-settings-card { padding: 16px; }
    .tmws-settings-field { align-items: flex-start; flex-direction: column; }
    .tmws-settings-note { align-items: flex-start; flex-direction: column; }
    .tmws-matter-hero { padding: 17px; }
    .tmws-matter-title { padding-right: 0; }
    .tmws-matter-title h2 { font-size: 25px; }
    .tmws-matter-actions { position: static; flex-wrap: wrap; margin-top: 15px; }
    .tmws-matter-actions [data-tmws-matter-tab] { display: none; }
    .tmws-matter-facts { grid-template-columns: 1fr; }
    .tmws-matter-facts dd { white-space: normal; }
    .tmws-matter-tabs { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; overflow: hidden; border-radius: 10px; }
    .tmws-matter-tabs button { width: 100%; min-width: 0; justify-content: center; padding-inline: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tmws-flow-options { grid-template-columns: 1fr; }
    .tmws-flow-options button { min-height: 94px; }
    .tmws-matter-work .tcf-tabs { display: flex !important; overflow-x: auto !important; scrollbar-width: thin; }
    .tmws-matter-work .tcf-tabs button { flex: 0 0 116px !important; }
    .tmws-matter-work,
    .tmws-task-rail { padding: 12px; }
    .tmws-section-head { align-items: flex-start; flex-direction: column; gap: 5px; }
    .tmws-task-head-actions { width: 100%; justify-content: space-between; }
    .tmws-command { padding: 8px; }
    .tmws-command-dialog { max-height: calc(100vh - 16px); border-radius: 9px; }
    .tmws-quick-action { width: 100dvw; max-width: 100dvw; align-items: end; justify-items: stretch; padding: 0; contain: layout paint; overflow-x: hidden; touch-action: pan-y; }
    .tmws-quick-action__dialog {
        position: absolute;
        inset: auto 0 0 0;
        width: 100dvw;
        max-width: 100dvw;
        max-height: min(86dvh, 760px);
        overflow-x: hidden;
        overflow-y: auto;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 16px 16px 0 0;
        -webkit-overflow-scrolling: touch;
    }
    .tmws-quick-action__dialog > header { min-height: 64px; padding: 11px 14px; }
    .tmws-quick-action__dialog > header h2 { font-size: 20px; }
    .tmws-quick-action__dialog [data-tmws-quick-panel] { width: 100%; max-width: 100%; overflow-x: hidden; padding: 14px 14px max(18px, env(safe-area-inset-bottom)); }
    .tmws-quick-action__dialog form { grid-template-columns: 1fr; gap: 12px; }
    .tmws-calendar-choice__options,
    .tmws-quick-mode--three { grid-template-columns: 1fr; }
    .tmws-calendar-choice__options button { min-height: 104px; }
    .tmws-quick-field :is(input, select, textarea) { font-size: 16px; }
    .tmws-person-picker__control,
    .tmws-new-person-fields,
    .tmws-quick-field,
    .tmws-quick-mode { max-width: 100%; overflow-x: hidden; }
    .tmws-person-results { position: static; width: 100%; max-width: 100%; max-height: 220px; margin-top: 6px; overflow-x: hidden; box-shadow: none; }
    .tmws-person-option { grid-template-columns: 1fr; gap: 1px; }
    .tmws-person-option__meta,
    .tmws-person-option small { grid-column: 1; white-space: normal; }
    .tmws-person-context > header { align-items: flex-start; }
    .tmws-person-context > header > span { max-width: 46%; text-align: right; }
    .tmws-new-person-fields { grid-template-columns: 1fr; gap: 12px; }
    .tmws-quick-field--wide,
    .tmws-quick-actions,
    .tmws-quick-note,
    .tmws-quick-status { grid-column: 1; }
    .tmws-quick-actions .tmws-ui-button { flex: 1; justify-content: center; }
    .tmws-action-toast { right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); left: 10px; max-width: none; text-align: center; }
}

/* Mobile Complet: selectors stay available without occupying the first viewport. */
@media (max-width: 860px) {
    .tmws-ui-system[data-tmws-mode="full"] .tmws-module-surface--dosare .trd-filters {
        margin: 10px 0 12px !important;
        padding: 0 !important;
        overflow: hidden !important;
        border: 1px solid var(--tmws-line) !important;
        border-radius: 10px !important;
        background: #fff !important;
    }

    .tmws-ui-system[data-tmws-mode="full"] .tmws-module-surface--dosare .trd-filters-header {
        min-height: 50px;
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) 18px;
        gap: 9px;
        align-items: center;
        padding: 9px 12px !important;
        background: #faf8f6 !important;
        border-bottom: 0 !important;
        cursor: pointer;
        user-select: none;
    }

    .tmws-ui-system[data-tmws-mode="full"] .tmws-module-surface--dosare .trd-filters-header:focus-visible {
        outline: 2px solid rgba(128, 0, 32, .34);
        outline-offset: -2px;
    }

    .tmws-ui-system[data-tmws-mode="full"] .tmws-module-surface--dosare .trd-filters-title {
        min-width: 0;
        color: var(--tmws-ink);
        font-size: 12px !important;
        letter-spacing: .045em !important;
        white-space: nowrap;
    }

    .tmws-ui-system[data-tmws-mode="full"] .tmws-module-surface--dosare .tmws-mobile-filter-summary {
        display: block;
        min-width: 0;
        overflow: hidden;
        color: var(--tmws-muted);
        font-size: 11px;
        font-weight: 650;
        line-height: 1.25;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tmws-ui-system[data-tmws-mode="full"] .tmws-module-surface--dosare .tmws-mobile-filter-chevron {
        width: 9px;
        height: 9px;
        justify-self: center;
        border-right: 2px solid var(--tmws-wine);
        border-bottom: 2px solid var(--tmws-wine);
        transform: translateY(-2px) rotate(45deg);
        transition: transform .16s ease;
    }

    .tmws-ui-system[data-tmws-mode="full"] .tmws-module-surface--dosare .trd-filters.is-mobile-open .tmws-mobile-filter-chevron {
        transform: translateY(2px) rotate(225deg);
    }

    .tmws-ui-system[data-tmws-mode="full"] .tmws-module-surface--dosare .trd-filters:not(.is-mobile-open) > .trd-filter-row {
        display: none !important;
    }

    .tmws-ui-system[data-tmws-mode="full"] .tmws-module-surface--dosare .trd-filters.is-mobile-open .trd-filters-header {
        border-bottom: 1px solid var(--tmws-line) !important;
    }

    .tmws-ui-system[data-tmws-mode="full"] .tmws-module-surface--dosare .trd-filters.is-mobile-open > .trd-filter-row {
        display: flex !important;
    }

    .tmws-ui-system[data-tmws-mode="full"] .tmws-module-surface--dosare .trd-filters.is-mobile-open > .trd-filter-row:has(> .trd-tabs) {
        display: block !important;
        width: 100%;
    }

    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row:has(> .trd-tabs) > .trd-filter-label {
        display: block;
        width: auto;
        margin: 0 0 7px;
    }

    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row:has(> .trd-tabs) > .trd-tabs {
        width: 100%;
        max-width: 100%;
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row:has(> .trd-tabs) > .trd-tabs button {
        width: max-content !important;
        min-width: max-content !important;
        flex: 0 0 auto;
        min-height: 38px !important;
        padding: 6px 12px !important;
    }

    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row:has(> .trd-sort-tabs),
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row:has(> .trd-view-mode-tabs) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch !important;
        gap: 8px !important;
    }

    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row:has(> .trd-sort-tabs) > .trd-filter-label,
    .tmws-ui-system .tmws-module-surface--dosare .trd-filter-row:has(> .trd-view-mode-tabs) > .trd-filter-label {
        width: 100% !important;
        min-width: 0 !important;
    }

    .tmws-ui-system .tmws-module-surface--dosare .trd-sort-tabs {
        width: 100%;
        max-width: 100%;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        flex-wrap: nowrap !important;
        gap: 6px !important;
        overflow: visible !important;
    }

    .tmws-ui-system .tmws-module-surface--dosare .trd-sort-tabs button {
        width: 100%;
        min-width: 0 !important;
        padding-inline: 7px !important;
        overflow: hidden;
        font-size: 0 !important;
        white-space: nowrap;
    }

    .tmws-ui-system .tmws-module-surface--dosare .trd-sort-tabs button::before {
        font-size: var(--tmws-text-action);
        line-height: 1;
    }

    .tmws-ui-system .tmws-module-surface--dosare .trd-sort-tabs button[data-sort="next_hearing"]::before { content: "Termen"; }
    .tmws-ui-system .tmws-module-surface--dosare .trd-sort-tabs button[data-sort="client_name"]::before { content: "Nume"; }
    .tmws-ui-system .tmws-module-surface--dosare .trd-sort-tabs button[data-sort="case_number"]::before { content: "Număr"; }

    .tmws-ui-system .tmws-module-surface--dosare .trd-sort-tabs .trd-sort-icon {
        display: inline !important;
        margin-left: 4px;
        font-size: 12px !important;
    }

    .tmws-ui-system .tmws-module-surface--dosare .trd-view-mode-tabs {
        width: 100%;
    }

    .tmws-ui-system .tmws-module-surface--dosare .trd-view-mode-tabs button {
        flex: 1 1 0;
        min-width: 0;
    }
}

@media (min-width: 861px) {
    .tmws-mobile-filter-summary,
    .tmws-mobile-filter-chevron { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .tmws-panel.is-active { animation: none; }
    .tmws-sidebar { transition: none; }
    .tmws-health-pulse::after { animation: none; opacity: .35; }
    .tmws-root * { scroll-behavior: auto !important; }
}
