* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
    font-family: var(--tsh-font);
    background: var(--tsh-bg);
    color: var(--tsh-text);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.tsh-app-body,
body.tsh-login-body {
    background:
            radial-gradient(circle at 52% 32%, rgba(34, 211, 238, .075), transparent 17rem),
            linear-gradient(135deg, transparent 0 42%, rgba(255,255,255,.30) 42.2% 42.35%, transparent 42.6%),
            var(--tsh-bg);
}
a { color: var(--tsh-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.tsh-app-shell {
    height: 100vh;
    display: grid;
    grid-template-columns: var(--tsh-sidebar-width) minmax(0, 1fr);
    overflow: hidden;
}

/* Sidebar — intentionally aligned with AutoHub shell proportions. */
.tsh-sidebar {
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(170deg, var(--tsh-sidebar-bg) 0%, var(--tsh-sidebar-bg-2) 100%);
    color: var(--tsh-sidebar-text);
    border-right: 1px solid rgba(255,255,255,.055);
    position: relative;
}
.tsh-sidebar::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, transparent 10%, var(--tsh-primary) 45%, transparent 90%);
    opacity: .5;
    pointer-events: none;
}
.tsh-brand-row {
    height: 54px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 13px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.tsh-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #fff;
    font-weight: 800;
    font-size: 16.5px;
    letter-spacing: -.025em;
    text-decoration: none;
}
.tsh-brand:hover { text-decoration: none; opacity: .92; }
.tsh-brand-logo {
    width: 29px;
    height: 29px;
    border-radius: 5px;
    object-fit: contain;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.20);
}
.tsh-brand-name { color: #fff; font-weight: 850; }
.tsh-brand-subtitle { color: var(--tsh-sidebar-muted); font-size: 11.5px; margin-top: 1px; }
.tsh-user-card {
    margin: 10px 10px 5px;
    padding: 9px 10px;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 6px;
    background: rgba(255,255,255,.042);
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
}
.tsh-user-card strong { display: block; color: #fff; font-size: 12.5px; letter-spacing: -.01em; }
.tsh-user-card small { display: block; color: var(--tsh-sidebar-muted); font-size: 11.5px; margin-top: 1px; }
.tsh-avatar {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border-radius: 5px;
    background: linear-gradient(135deg, #1d4b91, #2563eb);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
    letter-spacing: -.02em;
}
.tsh-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 7px 8px 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.12) transparent;
}
.tsh-nav-skeleton {
    color: var(--tsh-sidebar-muted);
    font-size: 12px;
    padding: 9px 10px;
}
.tsh-nav-group {
    margin: 14px 8px 5px;
    color: var(--tsh-sidebar-muted);
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: .13em;
    font-weight: 800;
    opacity: .72;
}
.tsh-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--tsh-sidebar-text);
    padding: 7px 9px;
    border-radius: 5px;
    margin: 1px 0;
    font-weight: 650;
    font-size: 12.5px;
    border: 1px solid transparent;
    transition: background 100ms ease, border-color 100ms ease, color 100ms ease;
    position: relative;
    text-decoration: none;
}
.tsh-nav-item:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.tsh-nav-item.is-active {
    background: rgba(37,99,235,.20);
    border-color: rgba(99,148,235,.18);
    color: #e0eaff;
    box-shadow: inset 2px 0 0 var(--tsh-primary);
}
.tsh-nav-child { padding-left: 22px; }
.tsh-nav-icon { width: 16px; display: inline-grid; place-items: center; opacity: .88; flex-shrink: 0; }
.tsh-nav-icon img { width: 14px; height: 14px; object-fit: contain; display: block; }

/* Main shell */
.tsh-main {
    height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--tsh-bg);
}
.tsh-topbar {
    height: 54px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid var(--tsh-border);
    box-shadow: 0 1px 0 rgba(15,23,42,.03), var(--tsh-shadow);
    z-index: 10;
    gap: 10px;
}
.tsh-topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tsh-topbar h1 { font-size: 18px; line-height: 1.1; margin: 2px 0 0; color: #0f172a; letter-spacing: -.02em; }
.tsh-page-kicker { color: var(--tsh-muted); font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .075em; line-height: 1; }
.tsh-topbar-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.tsh-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 18px 16px 28px;
    display: grid;
    gap: 16px;
    background:
            radial-gradient(circle at 50% 28%, rgba(34,211,238,.06), transparent 18rem),
            var(--tsh-bg);
}
.tsh-card {
    background: rgba(255,255,255,.92);
    border: 1px solid var(--tsh-border);
    border-radius: 8px;
    box-shadow: var(--tsh-shadow);
    padding: 16px;
}
.tsh-card h2 { margin: 0 0 10px; font-size: 16px; letter-spacing: -.02em; }
.tsh-card p { color: var(--tsh-muted); line-height: 1.65; margin: 0; }
.tsh-hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: center;
    gap: 20px;
    background: linear-gradient(120deg, #122247 0%, #1a3269 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
    min-height: 92px;
}
.tsh-hero-card::after {
    content: '';
    position: absolute;
    inset: -60px -90px auto auto;
    width: 260px;
    height: 180px;
    border-radius: 50%;
    background: rgba(64,130,255,.18);
    transform: rotate(-18deg);
}
.tsh-hero-card h2 { font-size: 19px; color: #fff; }
.tsh-hero-card p { color: #d9e6ff; }
.tsh-hero-card .tsh-page-kicker { color: #8db8ff; }
.tsh-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; position: relative; z-index: 1; }
.tsh-status-card {
    display: grid;
    gap: 5px;
    padding: 11px 12px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
}
.tsh-status-card:hover { background: rgba(255,255,255,.14); text-decoration: none; }
.tsh-status-card span { color: #cbd7eb; font-size: 11.5px; }
.tsh-status-card strong { font-size: 13px; }
.tsh-dashboard-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.tsh-metric-card { padding: 12px; background: #fff; border: 1px solid var(--tsh-border); border-radius: 7px; box-shadow: var(--tsh-shadow); }
.tsh-metric-card span { display: block; color: var(--tsh-muted); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .075em; }
.tsh-metric-card strong { display: block; margin-top: 6px; font-size: 24px; line-height: 1; color: #0f172a; }
.tsh-two-column { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: 12px; }
.tsh-list { display: grid; gap: 7px; margin-top: 12px; }
.tsh-list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid var(--tsh-border); background: #f8fafc; border-radius: 5px; }
.tsh-list-item strong { font-size: 12.5px; }
.tsh-list-item small { color: var(--tsh-muted); }
.tsh-badge { padding: 3px 7px; border-radius: 999px; font-weight: 800; font-size: 10px; border: 1px solid var(--tsh-border); background: #eef2f7; color: #334155; }
.tsh-badge.ok { background: #ecfdf5; border-color: #bbf7d0; color: #166534; }
.tsh-badge.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.tsh-pill {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef2f7;
    border: 1px solid var(--tsh-border);
    color: #334155;
    font-weight: 750;
    font-size: 12px;
}
.tsh-top-button,
.tsh-form button,
.tsh-link-button {
    min-height: var(--tsh-control-h);
    border: 1px solid var(--tsh-border-strong);
    background: #fff;
    border-radius: 5px;
    padding: 0 10px;
    cursor: pointer;
    font-weight: 750;
    font-size: 12.5px;
    color: #1a2b42;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
}
.tsh-top-button:hover,
.tsh-link-button:hover { background: #f4f7fb; text-decoration: none; }
.tsh-top-button.danger { border-color: #f3b5ae; color: var(--tsh-danger); }
.tsh-top-button img,
.tsh-form button img { width: 14px; height: 14px; object-fit: contain; }

/* Login */
.tsh-login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.tsh-login-shell { width: min(100%, 382px); }
.tsh-login-card {
    display: grid;
    gap: 13px;
    background: rgba(255,255,255,.94);
    border: 1px solid #d9e2ee;
    border-top: 3px solid var(--tsh-primary);
    border-radius: 6px;
    box-shadow: 0 18px 38px rgba(15,23,42,.22), 0 3px 10px rgba(15,23,42,.10);
    padding: 22px 24px 24px;
    position: relative;
    overflow: hidden;
}
.tsh-login-card::after {
    content: '';
    position: absolute;
    right: -65px;
    top: -24px;
    width: 155px;
    height: 155px;
    border: 16px solid rgba(34,211,238,.08);
    border-radius: 50%;
    pointer-events: none;
}
.tsh-login-brand { display: flex; align-items: center; gap: 9px; padding-bottom: 12px; border-bottom: 1px solid #e5edf6; position: relative; z-index: 1; }
.tsh-login-brand img { width: 30px; height: 30px; border-radius: 6px; }
.tsh-login-brand strong { display:block; color: #0f172a; font-size: 13px; }
.tsh-login-brand span { display:block; color: var(--tsh-muted); font-size: 10.5px; margin-top: 1px; }
.tsh-login-copy { position: relative; z-index: 1; }
.tsh-login-copy h1 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.tsh-login-copy p { color: var(--tsh-muted); font-size: 12.5px; margin: 7px 0 0; }
.tsh-form { display: grid; gap: 10px; position: relative; z-index: 1; }
.tsh-form label { display: grid; gap: 5px; }
.tsh-form label span { font-weight: 800; font-size: 11.5px; color: #283a52; }
.tsh-form input {
    width: 100%;
    min-height: var(--tsh-control-h);
    border: 1px solid #cfd9e6;
    border-radius: 5px;
    padding: 0 10px;
    font: inherit;
    color: #0f172a;
    background: #fff;
}
.tsh-form input:focus { outline: 2px solid var(--tsh-primary-ring); border-color: var(--tsh-primary); }
.tsh-form button { background: var(--tsh-primary); border-color: var(--tsh-primary-2); color: #fff; width: 100%; }
.tsh-form button:hover { background: var(--tsh-primary-2); }
.tsh-login-note { color: var(--tsh-muted); font-size: 11.5px; line-height: 1.45; }
.tsh-link { font-size: 12px; font-weight: 700; }
.tsh-alert { padding: 9px 10px; border-radius: 5px; font-size: 12.5px; }
.tsh-alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }

.tsh-toast-root { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: grid; gap: 8px; }
.tsh-toast { padding: 10px 12px; border-radius: 6px; background: #0f172a; color: #fff; box-shadow: var(--tsh-shadow-lg); font-size: 12.5px; }
code { font-family: var(--tsh-mono); background: #eef2f7; border: 1px solid #dde5ee; border-radius: 3px; padding: 1px 5px; font-size: 12px; color: #1e3a5f; }

@media (max-width: 1100px) {
    .tsh-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tsh-hero-card, .tsh-two-column { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .tsh-app-shell { grid-template-columns: 1fr; }
    .tsh-sidebar { display: none; }
    .tsh-topbar { height: auto; min-height: 54px; align-items: flex-start; flex-direction: column; padding: 12px 14px; }
    .tsh-topbar-actions { flex-wrap: wrap; }
    .tsh-dashboard-grid { grid-template-columns: 1fr; }
    .tsh-status-grid { grid-template-columns: 1fr; }
}
.mini-spinner {
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: tsh-spin .8s linear infinite;
}
@keyframes tsh-spin { to { transform: rotate(360deg); } }

/* Iteration 6 Hotfix 1 — Pro-Clean Talpie/AutoHub alignment */
body.tsh-app-body,
body.tsh-login-body {
    background: var(--ah-bg, #f2f5f9);
}
.tsh-brand-logo,
.tsh-login-brand img {
    background: transparent;
    box-shadow: none;
    object-fit: contain;
}
.tsh-brand-logo { border-radius: 4px; }
.tsh-login-brand img { border-radius: 4px; }
.tsh-card,
.tsh-metric-card,
.tsh-login-card {
    background: var(--ah-surface, #fff);
    border-color: var(--ah-border, #dde4ee);
    box-shadow: var(--ah-shadow, 0 3px 10px rgba(15,23,42,.07), 0 1px 3px rgba(15,23,42,.04));
}
.tsh-top-button,
.tsh-link-button {
    transition: background var(--ah-dur-fast, 100ms) ease,
                border-color var(--ah-dur-fast, 100ms) ease,
                box-shadow var(--ah-dur-fast, 100ms) ease,
                transform var(--ah-dur-fast, 100ms) ease;
}
.tsh-top-button:hover,
.tsh-link-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 4px rgba(15,23,42,.07);
}
.tsh-top-button.danger {
    background: #fff;
    border-color: #f3b5ae;
    color: var(--ah-red, var(--tsh-danger));
}
.tsh-top-button.danger:hover { background: #fff5f5; }
.tsh-list-item {
    transition: border-color var(--ah-dur-fast, 100ms) ease,
                background var(--ah-dur-fast, 100ms) ease,
                transform var(--ah-dur-fast, 100ms) ease,
                box-shadow var(--ah-dur-fast, 100ms) ease;
}
a.tsh-list-item:hover {
    transform: translateY(-1px);
    border-color: var(--ah-border-2, #c8d3e0);
    background: #fff;
    box-shadow: 0 1px 4px rgba(15,23,42,.07);
    text-decoration: none;
}
.tsh-hero-card {
    border: 1px solid rgba(26,75,174,.18);
    box-shadow: var(--ah-shadow, var(--tsh-shadow));
}
.tsh-component-baseline p { margin-bottom: 0; }

/* Iteration 7 Hotfix 1 — AutoHub visual alignment and core page shell. */
body.tsh-app-body,
body.tsh-login-body {
    background: var(--ah-bg);
}

.tsh-main { background: var(--ah-bg); }
.tsh-content { padding: 14px 16px 18px; }
.tsh-topbar { background: var(--ah-surface); border-bottom: 1px solid var(--ah-border); }
.tsh-topbar h1 { letter-spacing: -.03em; }

.tsh-core-page { display: grid; gap: 14px; }
.tsh-core-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 58px;
    padding: 2px 2px 0;
}
.tsh-core-hero h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: -.035em;
    color: var(--ah-text);
}
.tsh-core-page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.compact-top { margin-top: 0; }

.tsh-core-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.tsh-system-tile {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 2px 10px;
    padding: 13px 14px;
    min-height: 82px;
    color: var(--ah-text);
    text-decoration: none;
    background: var(--ah-surface);
    border: 1px solid var(--ah-border);
    border-radius: var(--ah-radius-lg);
    box-shadow: var(--ah-shadow);
    transition: transform var(--ah-dur-fast) ease, border-color var(--ah-dur-fast) ease, box-shadow var(--ah-dur-fast) ease;
}
.tsh-system-tile:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--ah-border-2); box-shadow: var(--shadow-md); }
.tsh-system-tile img { grid-row: 1 / span 2; width: 28px; height: 28px; object-fit: contain; align-self: start; }
.tsh-system-tile strong { font-size: 14px; letter-spacing: -.015em; }
.tsh-system-tile span { color: var(--ah-muted); font-size: 12.5px; line-height: 1.35; }

.tsh-section-title {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 10px;
    margin-bottom: 10px;
}
.tsh-section-title h3 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.compact-card { padding: 14px; }

.tsh-action-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tsh-action-grid .ah-btn { min-width: 116px; justify-content: center; }
.tsh-action-grid .btn-ico,
.summary-card .btn-ico { width: 15px; height: 15px; object-fit: contain; }

.tsh-empty-state {
    min-height: 146px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 22px;
    color: var(--ah-muted);
    background: var(--ah-surface-2);
    border: 1px dashed var(--ah-border-2);
    border-radius: var(--ah-radius-lg);
    text-align: center;
}
.tsh-empty-state img { width: 32px; height: 32px; opacity: .65; }
.tsh-empty-state strong { color: var(--ah-text); }

.tsh-page-loading {
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--ah-muted);
    background: var(--ah-surface);
    border: 1px solid var(--ah-border);
    border-radius: var(--ah-radius-lg);
    box-shadow: var(--ah-shadow);
}

.tsh-profile-dl {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 9px 14px;
    margin: 0;
}
.tsh-profile-dl dt { color: var(--ah-muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .045em; }
.tsh-profile-dl dd { margin: 0; color: var(--ah-text); overflow-wrap: anywhere; }

.tsh-planned-card {
    display: flex;
    gap: 14px;
    align-items: center;
    min-height: 132px;
}
.tsh-planned-card img { width: 42px; height: 42px; object-fit: contain; }
.tsh-planned-card h3 { margin: 0 0 5px; }
.tsh-planned-card p { margin: 0; color: var(--ah-muted); max-width: 760px; }

.tsh-two-column.compact-top { gap: 12px; }
.tsh-component-grid.compact { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }

@media (max-width: 860px) {
    .tsh-core-hero { align-items: flex-start; flex-direction: column; }
    .tsh-profile-dl { grid-template-columns: 1fr; }
}


/* Iteration 7 Hotfix 2 — final AutoHub shell polish. */
.tsh-content {
    align-content: start;
    grid-auto-rows: min-content;
}
.tsh-card,
.tsh-metric-card,
.summary-card {
    align-self: start;
}
.tsh-two-column {
    align-items: start;
}
.summary-card-grid,
.tsh-dashboard-grid,
.tsh-core-card-grid {
    align-items: start;
    grid-auto-rows: min-content;
}
.tsh-user-card {
    color: inherit;
    text-decoration: none;
}
.tsh-user-card:hover {
    background: rgba(255,255,255,.065);
    text-decoration: none;
}
.tsh-hero-card {
    min-height: 0;
    border-radius: var(--ah-radius-lg, 8px);
    padding: 20px 22px;
    margin: 0;
    border: 1px solid rgba(26,75,174,.20);
    box-shadow: var(--ah-shadow, var(--tsh-shadow));
    align-items: center;
}
.tsh-hero-card h2 {
    margin: 6px 0 8px;
    line-height: 1.12;
}
.tsh-hero-card p {
    max-width: 880px;
    line-height: 1.5;
}
.tsh-hero-card > * {
    position: relative;
    z-index: 1;
}
.tsh-status-grid {
    align-self: stretch;
    align-items: stretch;
}
.tsh-status-card {
    min-height: 58px;
}
.summary-card {
    min-height: 72px;
}
.tsh-metric-card {
    min-height: 72px;
}
.tsh-card > h3:first-child,
.tsh-card > h2:first-child {
    margin-top: 0;
}
.tsh-planned-card {
    min-height: 0;
    padding-top: 18px;
    padding-bottom: 18px;
}
.tsh-empty-state {
    min-height: 96px;
}
.tsh-page-loading {
    min-height: 116px;
}
@media (max-width: 1100px) {
    .tsh-hero-card { grid-template-columns: 1fr; }
    .tsh-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .tsh-hero-card { padding: 16px; }
    .tsh-status-grid { grid-template-columns: 1fr; }
}

/* Iteration 7 Hotfix 4 — dark page hero restored after static cleanup. */
.tsh-card.tsh-hero-card {
    background: linear-gradient(120deg, #122247 0%, #1a3269 100%);
    color: #fff;
    border-color: rgba(99,148,235,.20);
    border-radius: 10px;
    padding: 22px 24px;
}
.tsh-card.tsh-hero-card h1,
.tsh-card.tsh-hero-card h2,
.tsh-card.tsh-hero-card h3 { color: #fff; }
.tsh-card.tsh-hero-card p { color: #d9e6ff; }
.tsh-card.tsh-hero-card .tsh-page-kicker { color: #8db8ff; }
.tsh-card.tsh-hero-card.compact-hero { padding: 18px 20px; }
.tsh-card.tsh-hero-card .tsh-status-card { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.14); color: #fff; }
.tsh-card.tsh-hero-card .tsh-status-card:hover { background: rgba(255,255,255,.15); }
.tsh-card.tsh-hero-card .tsh-status-card span { color: #cbd7eb; }
.tsh-card.tsh-hero-card .tsh-status-card strong { color: #fff; }

/* Iteration 7 Hotfix 5 — content polish for backend-rendered pages. */
.summary-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    align-items: start;
}
.summary-card-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.summary-card {
    display: grid;
    gap: 5px;
    min-height: 82px;
    padding: 13px 14px;
    background: var(--ah-surface, #fff);
    border: 1px solid var(--ah-border, #dde4ee);
    border-radius: var(--ah-radius-lg, 8px);
    box-shadow: var(--ah-shadow, 0 3px 10px rgba(15,23,42,.07), 0 1px 3px rgba(15,23,42,.04));
    color: var(--ah-text, #0f172a);
    align-content: start;
}
.summary-card span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--ah-muted, #64748b);
    font-size: 10.5px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .065em;
}
.summary-card strong {
    display: block;
    min-width: 0;
    color: var(--ah-text, #0f172a);
    font-size: 23px;
    line-height: 1.05;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}
.summary-card small {
    display: block;
    min-width: 0;
    color: var(--ah-muted, #64748b);
    font-size: 11.5px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.summary-card .pill,
.summary-card .tsh-pill {
    width: max-content;
}
.tsh-card .summary-card-grid:first-child,
.tsh-card .smart-table-wrap:first-child {
    margin-top: 0;
}
.tsh-card .smart-table-wrap {
    margin-top: 10px;
}
.smart-table-wrap {
    width: 100%;
    min-width: 0;
    overflow: auto;
    border: 1px solid var(--line-1, var(--ah-border, #dde4ee));
    border-radius: var(--r-md, 7px);
    background: #fff;
    box-shadow: var(--shadow-xs, 0 1px 3px rgba(15,23,42,.05));
}
.smart-table {
    width: 100%;
    min-width: 680px;
}
.smart-table-configurable {
    table-layout: auto;
}
.smart-table-configurable th,
.smart-table-configurable td {
    overflow: visible;
    text-overflow: initial;
}
.smart-table th {
    height: 34px;
}
.smart-table td {
    height: 36px;
}
.smart-table-empty-cell {
    padding: 0 !important;
    border-bottom: 0 !important;
}
.smart-table-empty-cell .tsh-empty-state {
    margin: 0;
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--line-1, var(--ah-border, #dde4ee));
    min-height: 104px;
}
.tsh-page-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}
.tsh-fact-card {
    display: grid;
    gap: 4px;
    min-height: 70px;
    padding: 12px 13px;
    background: var(--ah-surface, #fff);
    border: 1px solid var(--ah-border, #dde4ee);
    border-radius: var(--ah-radius-lg, 8px);
    box-shadow: var(--ah-shadow, 0 3px 10px rgba(15,23,42,.07), 0 1px 3px rgba(15,23,42,.04));
}
.tsh-fact-card span {
    color: var(--ah-muted, #64748b);
    font-size: 10.5px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .065em;
}
.tsh-fact-card strong {
    color: var(--ah-text, #0f172a);
    font-size: 14px;
    overflow-wrap: anywhere;
}
.tsh-fact-card small {
    color: var(--ah-muted, #64748b);
    font-size: 11.5px;
    overflow-wrap: anywhere;
}
.tsh-page-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 13px;
    background: #f8fbff;
    border: 1px solid var(--ah-border, #dde4ee);
    border-radius: var(--ah-radius-lg, 8px);
    box-shadow: var(--ah-shadow, 0 3px 10px rgba(15,23,42,.07), 0 1px 3px rgba(15,23,42,.04));
}
.tsh-page-note img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-top: 1px;
    flex: 0 0 auto;
}
.tsh-page-note strong { color: var(--ah-text, #0f172a); }
.tsh-page-note p { margin: 2px 0 0; color: var(--ah-muted, #64748b); line-height: 1.45; }
.tsh-card.tsh-hero-card {
    margin-bottom: 0;
}
.tsh-core-page > * {
    min-width: 0;
}
@media (max-width: 900px) {
    .summary-card-grid.three { grid-template-columns: 1fr; }
    .smart-table { min-width: 620px; }
}

/* Iteration 5.2 recording/media hardening */
.tv-preview-audio {
  width: min(760px, 100%);
  margin: 24px auto;
  display: block;
}
.tv-preview-image {
  object-fit: contain;
  background: #05070b;
}
.tv-recording-player .tv-preview-video {
  width: 100%;
  min-height: 360px;
  background: #05070b;
  border-radius: 16px;
}
.tsh-rel-grid.checkbox-mode {
  grid-template-columns: minmax(260px, 0.9fr) minmax(340px, 1.1fr);
}
.tsh-rel-node.is-active {
  outline: 2px solid rgba(80, 160, 255, .65);
  background: rgba(80, 160, 255, .14);
}
.tsh-rel-check-row {
  display: grid;
  grid-template-columns: auto 28px 1fr;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.tsh-rel-check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent, #5aa7ff);
}
.tsh-rel-check-row.is-assigned {
  background: rgba(58, 201, 135, .12);
}
.tsh-rel-check-row.is-pending {
  opacity: .58;
  pointer-events: none;
}
