/* Explicit adapters to the legacy cascade. Documents and public players are excluded. */
body.ts2 { background: var(--ts-bg) !important; }
body.ts2.app-authenticated #appScreen { display: grid !important; grid-template-columns: var(--ts-sidebar) minmax(0, 1fr) !important; min-height: 100dvh; padding: 0 !important; margin: 0 !important; }
body.ts2 #appScreen > main { width: 100% !important; max-width: none !important; min-width: 0 !important; padding: 88px 32px 32px !important; margin: 0 !important; background: var(--ts-bg) !important; }
body.ts2 .sidebar { position: fixed !important; inset: 0 auto 0 0 !important; width: var(--ts-sidebar) !important; height: 100dvh !important; border: 0 !important; border-right: 1px solid var(--ts-border) !important; border-radius: 0 !important; padding: 16px 12px 8px !important; background: var(--ts-surface) !important; box-shadow: none !important; transform: none !important; z-index: 80 !important; display: flex !important; flex-direction: column !important; }
body.ts2 #appScreen > main { grid-column: 2; }
body.ts2 .sidebar-brand { height: 48px !important; min-height: 48px !important; padding: 4px 12px !important; margin: 0 0 16px !important; display: flex !important; align-items: center; }
body.ts2 .sidebar-brand img { width: 100px !important; height: 32px !important; flex: 0 0 100px !important; object-fit: contain !important; object-position: left center; }
body.ts2 .sidebar-nav { overflow-y: auto !important; min-height: 0; flex: 1; padding: 0 !important; }
body.ts2 .sidebar-group { margin: 0 0 20px !important; padding: 0 !important; }
body.ts2 .sidebar-group-label { font: 600 11px/1.4 var(--ts-font) !important; letter-spacing: 0 !important; padding: 0 12px 8px !important; color: var(--ts-muted) !important; }
body.ts2 .sidebar .menu-item { width: 100%; min-height: 38px !important; margin: 2px 0 !important; padding: 8px 10px !important; display: flex; align-items: center; gap: 10px !important; border: 0 !important; border-radius: var(--ts-radius) !important; text-align: left; font: 500 13px/1.4 var(--ts-font) !important; letter-spacing: 0 !important; background: transparent !important; color: var(--ts-muted) !important; box-shadow: none !important; cursor: pointer; }
body.ts2 .sidebar .menu-item:hover { background: var(--ts-subtle) !important; color: var(--ts-text) !important; }
body.ts2 .sidebar .menu-item.active { background: var(--ts-brand-tint) !important; color: var(--ts-brand) !important; font-weight: 600 !important; }
body.ts2 .sidebar .menu-item::before, body.ts2 .sidebar .menu-item::after { display: none !important; }
body.ts2 .sidebar .menu-item.hidden, body.ts2 .sidebar-group[hidden] { display: none !important; }
body.ts2 .sidebar .nav-icon { width: 18px !important; height: 18px !important; min-width: 18px !important; stroke-width: 1.75 !important; color: currentColor !important; }
body.ts2 .sidebar-account { margin: 0 !important; padding: 16px 8px 8px !important; border-top: 1px solid var(--ts-border) !important; border-radius: 0 !important; background: transparent !important; gap: 8px !important; grid-template-columns: 32px minmax(0, 1fr) 32px !important; }
body.ts2 .sidebar-user-avatar { width: 32px !important; height: 32px !important; font-size: 12px !important; background: var(--ts-subtle) !important; color: var(--ts-text) !important; }
body.ts2 .sidebar-account-copy strong { font: 600 12px/1.5 var(--ts-font) !important; }
body.ts2 .sidebar-account-copy span { font: 400 11px/1.4 var(--ts-font) !important; }
body.ts2 #logoutBtn { width: 32px !important; min-width: 32px !important; height: 36px !important; padding: 6px !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
body.ts2 #logoutBtn span, body.ts2 .sidebar-footer { display: none !important; }
.ts-shell-bar { position: fixed; inset: 0 0 auto var(--ts-sidebar); height: var(--ts-header); z-index: 75; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: var(--ts-surface); border-bottom: 1px solid var(--ts-border); }
.ts-shell-trail { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ts-shell-trail span { color: var(--ts-muted); }
.ts-shell-trail strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-shell-right { display: flex; gap: 16px; align-items: center; padding-right: 48px; }
.ts-shell-date { color: var(--ts-muted); font-size: 12px; }
.ts-shell-mobile-menu { display: none; }
body.ts2 #notificationCenter { position: fixed !important; top: 12px !important; right: 24px !important; z-index: 90 !important; margin: 0 !important; }
body.ts2 .notification-bell { width: 40px !important; height: 40px !important; min-height: 40px !important; border: 0 !important; box-shadow: none !important; background: transparent !important; }
body.ts2 .mobile-app-header, body.ts2 .mobile-bottom-nav, body.ts2 .mobile-sign-fab, body.ts2 .mobile-menu-btn { display: none !important; }
.ts-home-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; margin-bottom: 32px; border-block: 1px solid var(--ts-border); background: var(--ts-surface); }
.ts-home-metric { min-height: 120px; padding: 20px 24px; border: 0; border-right: 1px solid var(--ts-border); background: transparent; text-align: left; color: var(--ts-text); }
.ts-home-metric:last-child { border-right: 0; }
.ts-home-metric:hover { background: var(--ts-subtle); }
.ts-home-metric > span { display: flex; align-items: center; gap: 8px; color: var(--ts-muted); font-size: 13px; }
.ts-home-metric strong { display: block; margin: 8px 0 4px; font-size: 32px; font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; }
.ts-home-metric small { color: var(--ts-muted); font-size: 12px; }
.ts-home-columns { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; }
.ts-work-list { border-top: 1px solid var(--ts-border); }
.ts-work-row { width: 100%; min-width: 0; padding: 18px 16px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; border: 0; border-bottom: 1px solid var(--ts-border); background: transparent; color: var(--ts-text); }
.ts-work-row:hover { background: var(--ts-subtle); }
.ts-work-row > svg { color: var(--ts-muted); }
.ts-work-row strong { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.ts-work-row small { display: block; color: var(--ts-muted); margin-top: 4px; font-size: 12px; }
.ts-work-row-end { display: grid; min-width: 0; gap: 8px; justify-items: end; font-variant-numeric: tabular-nums; text-align: right; }
.ts-work-row-end > * { max-width: 100%; overflow-wrap: anywhere; }
.ts-work-row-end > b { font-weight: 600; font-size: 13px; }
.ts-home-links { display: grid; border-top: 1px solid var(--ts-border); }
.ts-home-link { display: flex; align-items: center; gap: 12px; padding: 14px 0; color: var(--ts-text); background: transparent; border: 0; border-bottom: 1px solid var(--ts-border); text-align: left; }
.ts-home-link svg:last-child { margin-left: auto; width: 14px; }
.ts-home-recent { margin-top: 24px; }
.ts-home-recent .ts-work-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.ts-home-recent .ts-work-row-end { display: none; }
@media (max-width: 1279px) {
  :root { --ts-sidebar: 216px; }
  body.ts2 #appScreen > main { padding-inline: 24px !important; }
  .ts-home-columns { grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; }
}
@media (max-width: 1023px) {
  body.ts2.app-authenticated #appScreen { grid-template-columns: minmax(0, 1fr) !important; }
  body.ts2 #appScreen > main { grid-column: 1; }
  body.ts2 .sidebar { transform: translateX(-100%) !important; width: 280px !important; visibility: hidden; }
  body.ts2:not(.sidebar-open) #appScreen > .sidebar { display: none !important; }
  body.ts2.sidebar-open .sidebar { transform: none !important; visibility: visible; z-index: 200 !important; }
  body.ts2 .sidebar .menu-item { min-height: 44px !important; }
  body.ts2 .mobile-sidebar-overlay { position: fixed !important; inset: 0 !important; z-index: 195 !important; background: #20242b66 !important; }
  body.ts2.sidebar-open .mobile-sidebar-overlay { display: block !important; }
  .ts-shell-bar { left: 0; padding-inline: 16px; }
  .ts-shell-mobile-menu { display: inline-flex; }
  .ts-shell-trail > span { display: none; }
}
@media (max-width: 767px) {
  body.ts2 #appScreen > main { padding: 84px 16px max(24px, env(safe-area-inset-bottom)) !important; }
  body.ts2.app-authenticated { padding-top: 0 !important; }
  .ts-shell-right { display: none; }
  body.ts2 #notificationCenter { right: 12px !important; }
  body.ts2 .notification-panel { width: min(380px, calc(100vw - 24px)) !important; right: 0 !important; }
  .ts-home-metrics { grid-template-columns: 1fr 1fr; }
  .ts-home-metric { padding: 16px 12px; min-height: 116px; border-bottom: 1px solid var(--ts-border); }
  .ts-home-metric strong { font-size: 28px; }
  .ts-home-metric > span { font-size: 12px; }
  .ts-home-metric small { font-size: 11px; }
  .ts-home-metric:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 90px; }
  .ts-home-columns { grid-template-columns: 1fr; gap: 32px; }
  .ts-work-row { grid-template-columns: minmax(0, 1fr) auto; padding-block: 16px; gap: 8px; }
  .ts-work-row > svg { display: none; }
  .ts-work-row-end { max-width: 126px; }
  .ts-home-recent { display: none; }
}
