/* Plant resilience figures: still + canvas + play bar (wrong-way chrome). */

.tc-resilience-demo {
    position: relative;
    margin: 2.75rem 0 1.75rem;
    max-width: 795px;
}

.tc-resilience-frame {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
}

.tc-resilience-stage {
    position: relative;
    aspect-ratio: 795 / 447;
    background: #f8fafc;
    cursor: pointer;
}

.tc-resilience-still {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    border: 0;
    vertical-align: top;
}

.tc-resilience-stage canvas.tc-resilience-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.tc-resilience-demo.is-live canvas.tc-resilience-canvas {
    opacity: 1;
}

.tc-resilience-play-hint {
    position: absolute;
    top: -2.15rem;
    right: 0.55rem;
    z-index: 4;
    margin: 0;
    padding: 0.32rem 0.7rem 0.36rem;
    border: 2px solid #22c55e;
    border-radius: 8px;
    background: #86efac;
    color: #052e16;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.01em;
    pointer-events: none;
    user-select: none;
}

.tc-resilience-play-hint::before,
.tc-resilience-play-hint::after {
    content: "";
    position: absolute;
    top: 100%;
    border-style: solid;
    border-color: transparent;
}

.tc-resilience-play-hint::before {
    right: 0.8rem;
    border-width: 10px;
    border-top-color: #22c55e;
}

.tc-resilience-play-hint::after {
    right: 0.95rem;
    border-width: 8px;
    border-top-color: #86efac;
}

.tc-resilience-demo.has-played .tc-resilience-play-hint {
    display: none;
}

.tc-resilience-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.55rem;
    padding: 0.55rem 0.7rem 0.65rem;
    background: #1e293b;
    border-top: 1px solid #334155;
}

.tc-resilience-bar button {
    appearance: none;
    border: 1px solid #64748b;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 6px;
    padding: 0.28rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.tc-resilience-bar button:hover {
    background: #334155;
}

.tc-resilience-bar button[aria-pressed="true"] {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #e2e8f0;
}

.tc-resilience-seek {
    flex: 1 1 8rem;
    min-width: 7rem;
    accent-color: #2563eb;
}

.tc-resilience-demo > figcaption {
    margin: 0.55rem 0.1rem 0;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.55;
}

/* Region tabs: hash #receive-us etc. H2 ids stay with TOC. */
.tc-region-tabs {
    margin: 1.4rem 0 1.75rem;
}

.tc-region-tabs__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: #f1f5f9;
    overflow: hidden;
}

.tc-region-tabs__list [role="tab"] {
    appearance: none;
    flex: 1 1 6.5rem;
    margin: 0;
    padding: 0.55rem 0.7rem;
    border: 0;
    border-right: 1px solid #cbd5e1;
    background: transparent;
    color: #334155;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    scroll-margin-top: 80px;
}

.tc-region-tabs__list [role="tab"]:last-child {
    border-right: 0;
}

.tc-region-tabs__list [role="tab"]:hover {
    background: #e2e8f0;
}

.tc-region-tabs__list [role="tab"][aria-selected="true"] {
    background: #fff;
    color: #0f172a;
    box-shadow: inset 0 -3px 0 #2563eb;
}

.tc-region-tabs [role="tabpanel"] {
    margin: 0;
    padding: 1rem 0.15rem 0.15rem;
    border: 1px solid #cbd5e1;
    border-radius: 0 0 8px 8px;
    background: #fff;
}

.tc-region-tabs [role="tabpanel"] > :first-child {
    margin-top: 0;
}

.tc-region-tabs.is-ready [role="tabpanel"][hidden] {
    display: none;
}

.tc-region-tabs:not(.is-ready) [role="tabpanel"] {
    display: block;
    border-radius: 0;
    margin-bottom: 0.75rem;
}

.tc-region-tabs:not(.is-ready) [role="tabpanel"]:last-child {
    border-radius: 0 0 8px 8px;
    margin-bottom: 0;
}
