:root {
    color-scheme: dark;
    --tp-bg: #050505;
    --tp-panel: #101113;
    --tp-panel-strong: #16181c;
    --tp-line: #2b2e34;
    --tp-line-strong: #41454d;
    --tp-text: #f5f7fa;
    --tp-soft: #9197a3;
    --tp-red: #ff3b30;
    --tp-red-glow: rgba(255, 69, 58, 0.2);
    --tp-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
    --tp-radius: 1.5rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at top, rgba(255, 69, 58, 0.12), transparent 28rem),
        linear-gradient(180deg, #090909 0%, #050505 100%);
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

input,
select,
textarea {
    min-height: 3.25rem;
    width: 100%;
    border: 1px solid var(--tp-line);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--tp-text);
    padding: 0.9rem 1rem;
    box-shadow: none;
}

input::placeholder,
textarea::placeholder {
    color: #767d88;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(255, 69, 58, 0.72);
    box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.12);
}

textarea {
    min-height: 8rem;
    resize: vertical;
}

.tp-shell {
    min-height: 100vh;
    width: 100%;
}

.tp-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(20rem, calc(100vw - 2rem));
    transform: translateX(-110%);
    transition: transform 0.28s ease;
}

.tp-sidebar.is-open {
    transform: translateX(0);
}

.tp-sidebar-panel {
    display: flex;
    height: 100%;
    flex-direction: column;
    gap: 1.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 16rem),
        linear-gradient(180deg, rgba(10, 14, 20, 0.98), rgba(8, 11, 16, 0.98));
    padding: 1.1rem;
    backdrop-filter: blur(18px);
    box-shadow: var(--tp-shadow);
}

.tp-main-wrap {
    min-height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tp-main {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
}

.tp-main-standalone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.tp-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--tp-radius);
    background: linear-gradient(180deg, rgba(24, 144, 255, 0.12), rgba(255, 255, 255, 0.04));
    padding: 0.9rem;
}

.tp-brand-logo {
    display: grid;
    height: 4rem;
    width: 4rem;
    flex-shrink: 0;
    place-items: center;
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.55rem;
}

.tp-brand-kicker,
.tp-kicker,
.tp-topbar-eyebrow,
.tp-modal-kicker,
.tp-card-label,
.tp-sidebar-card-label {
    margin: 0;
    color: var(--tp-red);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.tp-brand-title,
.tp-topbar-title,
.tp-section-title,
.tp-panel-title,
.tp-modal-title {
    margin: 0.1rem 0 0;
    font-family: "Arial Black", Impact, sans-serif;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.tp-nav {
    display: grid;
    gap: 0.35rem;
}

.tp-nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border: 1px solid transparent;
    border-radius: 1.1rem;
    color: var(--tp-text);
    min-height: 3.45rem;
    padding: 0.9rem 1rem;
    text-decoration: none;
    transition: 0.2s ease;
}

.tp-nav-link:hover,
.tp-nav-link.is-active {
    border-color: rgba(255, 69, 58, 0.38);
    background: rgba(255, 69, 58, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 69, 58, 0.18);
}

.tp-nav-icon,
.tp-nav-chevron {
    color: var(--tp-red);
}

.tp-nav-chevron {
    margin-left: auto;
    opacity: 0.7;
}

.tp-sidebar-card,
.tp-card,
.tp-panel,
.tp-hero-card {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--tp-radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
    box-shadow: var(--tp-shadow);
}

.tp-sidebar-card {
    margin-top: auto;
    padding: 1rem;
}

.tp-sidebar-card-value,
.tp-card-value {
    margin: 0.4rem 0;
    font-family: "Arial Black", Impact, sans-serif;
    font-size: clamp(1.6rem, 4vw, 2.25rem);
}

.tp-sidebar-card-copy,
.tp-card-copy,
.tp-section-copy,
.tp-note-copy,
.tp-timeline-copy,
.tp-helper-copy {
    margin: 0;
    color: var(--tp-soft);
    line-height: 1.55;
}

.tp-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 1rem 1rem 0;
    backdrop-filter: blur(18px);
    background: linear-gradient(180deg, rgba(5, 5, 5, 0.94), rgba(5, 5, 5, 0.54));
}

.tp-topbar-row {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.5rem;
    background: rgba(16, 21, 30, 0.82);
    padding: 1rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.tp-topbar-actions {
    display: grid;
    gap: 0.75rem;
}

.tp-icon-button,
.tp-primary-button,
.tp-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 3.25rem;
    border-radius: 1rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tp-icon-button:hover,
.tp-primary-button:hover,
.tp-secondary-button:hover {
    transform: translateY(-1px);
}

.tp-icon-button {
    width: 3.25rem;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
    color: var(--tp-text);
}

.tp-primary-button {
    padding: 0 1.15rem;
    background: linear-gradient(135deg, #ff2d20, #ff5c4d);
    color: white;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(255, 69, 58, 0.28);
}

.tp-secondary-button {
    padding: 0 1.15rem;
    border-color: rgba(255, 69, 58, 0.35);
    background: rgba(255, 69, 58, 0.08);
    color: white;
    font-weight: 700;
}

.tp-search {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    border: 1px solid var(--tp-line);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0 1rem;
}

.tp-search input {
    min-height: 3.1rem;
    border: 0;
    background: transparent;
    padding: 0;
}

.tp-search input:focus {
    box-shadow: none;
}

.tp-flash-stack,
.tp-mini-flash-stack,
.tp-content-stack,
.tp-aside-stack {
    display: grid;
    gap: 1rem;
}

.tp-flash {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tp-flash-success {
    background: rgba(55, 214, 122, 0.12);
    border-color: rgba(55, 214, 122, 0.32);
}

.tp-flash-warning {
    background: rgba(255, 174, 0, 0.12);
    border-color: rgba(255, 174, 0, 0.28);
}

.tp-flash-danger {
    background: rgba(255, 69, 58, 0.12);
    border-color: rgba(255, 69, 58, 0.3);
}

.tp-flash-info {
    background: rgba(108, 122, 255, 0.12);
    border-color: rgba(108, 122, 255, 0.3);
}

.tp-flash-title,
.tp-note-title,
.tp-helper-title,
.tp-timeline-title {
    margin: 0;
    font-weight: 800;
}

.tp-flash-message {
    margin: 0.15rem 0 0;
    color: #dee2ea;
}

.tp-page-grid,
.tp-stats-grid,
.tp-split-grid,
.tp-form-grid,
.tp-helper-grid {
    display: grid;
    gap: 1rem;
}

.tp-hero-card,
.tp-panel,
.tp-card {
    padding: 1rem;
}

.tp-hero-card {
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(255, 69, 58, 0.18), transparent 18rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
}

.tp-hero-actions,
.tp-panel-header,
.tp-badge-row,
.tp-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tp-panel-header {
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.tp-field {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.tp-field-full {
    grid-column: 1 / -1;
}

.tp-label {
    font-size: 0.86rem;
    font-weight: 700;
    color: #e9edf5;
}

.tp-badge {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0.35rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.tp-badge-success {
    border-color: rgba(55, 214, 122, 0.35);
    background: rgba(55, 214, 122, 0.13);
    color: #8ff0b5;
}

.tp-badge-warning {
    border-color: rgba(255, 174, 0, 0.35);
    background: rgba(255, 174, 0, 0.13);
    color: #ffd37a;
}

.tp-badge-danger {
    border-color: rgba(255, 69, 58, 0.35);
    background: rgba(255, 69, 58, 0.14);
    color: #ff8b82;
}

.tp-badge-neutral {
    border-color: rgba(145, 151, 163, 0.34);
    background: rgba(145, 151, 163, 0.12);
    color: #d0d5dd;
}

.tp-note-block {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 1rem;
    padding-top: 1rem;
}

.tp-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.tp-table {
    width: 100%;
    min-width: 42rem;
    border-collapse: collapse;
}

.tp-table th,
.tp-table td {
    padding: 0.95rem 1rem;
    text-align: left;
}

.tp-table thead th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--tp-soft);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tp-table tbody tr + tr td {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tp-timeline {
    display: grid;
    gap: 1rem;
}

.tp-timeline-item {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
}

.tp-timeline-time {
    margin: 0;
    color: var(--tp-red);
    font-weight: 800;
}

.tp-modal-root {
    position: fixed;
    inset: 0;
    z-index: 60;
}

.tp-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
}

.tp-modal-panel {
    position: relative;
    z-index: 1;
    margin: auto;
    width: min(40rem, calc(100vw - 1.5rem));
    max-height: calc(100vh - 1.5rem);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    background: linear-gradient(180deg, #131417, #0c0d0f);
    padding: 1rem;
    box-shadow: var(--tp-shadow);
}

.tp-modal-root:not([hidden]) {
    display: grid;
    place-items: center;
    padding: 0.75rem;
}

.tp-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tp-helper-card {
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
}

body.tp-modal-open {
    overflow: hidden;
}

@media (min-width: 768px) {
    .tp-main,
    .tp-topbar {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .tp-topbar-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .tp-topbar-actions {
        min-width: min(34rem, 55vw);
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
    }

    .tp-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tp-form-grid,
    .tp-helper-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .tp-shell {
        display: grid;
        grid-template-columns: 18.5rem minmax(0, 1fr);
        align-items: start;
    }

    .tp-sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        height: 100vh;
        transform: none;
    }

    .tp-main-wrap {
        min-width: 0;
        padding: 0 1rem 1rem 0;
    }

    .tp-sidebar-panel {
        padding: 1.35rem 1rem 1.25rem;
    }

    .tp-page-grid {
        grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 0.72fr);
        align-items: start;
    }

    .tp-split-grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
    }

    .tp-main {
        padding: 1.25rem 0 0;
    }

    .tp-topbar {
        padding: 1.25rem 0 0;
    }
}
