.dfcv {
    --dfcv-orange: #ee761e;
    --dfcv-orange-dark: #b94d08;
    --dfcv-ink: #15181c;
    --dfcv-muted: #66707a;
    --dfcv-line: #dfe3e7;
    --dfcv-panel: #f5f6f7;
    box-sizing: border-box;
    width: 100%;
    margin: 1.5rem 0;
    overflow: hidden;
    color: var(--dfcv-ink);
    background: #fff;
    border: 1px solid var(--dfcv-line);
    border-radius: 18px;
    box-shadow: 0 12px 34px rgba(17, 24, 39, 0.09);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.4;
}

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

.dfcv__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    color: #fff;
    background: linear-gradient(115deg, #bd500c 0%, var(--dfcv-orange) 62%, #ff9b42 100%);
}

.dfcv__eyebrow {
    margin: 0 0 0.12rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    opacity: 0.82;
}

.dfcv__title {
    margin: 0;
    color: inherit;
    font-size: clamp(1.15rem, 2.5vw, 1.75rem);
    line-height: 1.15;
}

.dfcv__layout {
    display: grid;
    grid-template-columns: minmax(175px, 18%) minmax(500px, 1fr) minmax(305px, 21%);
    min-height: 620px;
}

.dfcv__sidebar {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    padding: 1rem;
    background: var(--dfcv-panel);
    border-right: 1px solid var(--dfcv-line);
}

.dfcv__select-wrap {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.dfcv__select-wrap label,
.dfcv__speed {
    color: #39414a;
    font-size: 16px;
    font-weight: 750;
}

.dfcv select {
    width: 100%;
    min-height: 40px;
    margin-top: 0.28rem;
    padding: 0.42rem 2rem 0.42rem 0.6rem;
    color: var(--dfcv-ink);
    background-color: #fff;
    border: 1px solid #bbc2c9;
    border-radius: 8px;
    font: inherit;
}

.dfcv__frames {
    flex: 1;
    max-height: 535px;
    margin: 0;
    padding: 0;
    overflow: auto;
    list-style: none;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.dfcv__frames li + li {
    margin-top: 0.28rem;
}

.dfcv__frames button {
    width: 100%;
    padding: 0.62rem 0.68rem;
    overflow: hidden;
    color: #303840;
    background: transparent;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-size: 17px;
    font-weight: 620;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.dfcv__frames button:hover,
.dfcv__frames button:focus-visible {
    background: #e5e8eb;
    outline: none;
}

.dfcv__frames button.is-active {
    color: #fff;
    background: var(--dfcv-orange);
}

.dfcv__stage {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 0.55rem;
    background: #e8ebee;
}

.dfcv__canvas-wrap {
    display: flex;
    min-height: 500px;
    flex: 1;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #dfe3e6;
    border-radius: 12px;
    touch-action: pinch-zoom;
}

.dfcv__canvas {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 74vh;
    min-height: 480px;
}

.dfcv__axis-label {
    fill: #515a64;
    font-size: 0.48px;
    font-weight: 650;
    dominant-baseline: middle;
}

.dfcv__orientation-label {
    fill: #1e2630;
    font-size: 0.58px;
    font-weight: 850;
    letter-spacing: 0.06px;
    dominant-baseline: middle;
}

.dfcv__person-label {
    fill: #fff;
    font-size: 0.54px;
    font-weight: 850;
    pointer-events: none;
}

.dfcv__meta {
    display: grid;
    height: 66px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(1.35rem, 1fr);
    gap: 0.2rem 1rem;
    padding: 0.7rem 0.3rem 0;
    overflow: hidden;
}

.dfcv__frame-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dfcv__frame-counter {
    color: var(--dfcv-muted);
    font-size: 15px;
}

.dfcv__notes {
    grid-column: 1 / -1;
    margin: 0.15rem 0 0;
    color: #454e57;
    font-size: 16px;
    line-height: 1.35;
    overflow: auto;
    overscroll-behavior: contain;
}

.dfcv__positions-panel {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    padding: 1rem 0.75rem;
    background: #fff;
    border-left: 1px solid var(--dfcv-line);
}

.dfcv__positions-panel h3 {
    margin: 0 0 0.7rem;
    color: #303840;
    font-size: 18px;
}

.dfcv__positions-scroll {
    min-height: 0;
    flex: 1;
    overflow: auto;
    overscroll-behavior: contain;
}

.dfcv__positions {
    width: 100%;
    min-width: 285px;
    border-collapse: collapse;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dfcv__positions th,
.dfcv__positions td {
    padding: 0.48rem 0.36rem;
    border-bottom: 1px solid var(--dfcv-line);
    text-align: right;
}

.dfcv__positions th:first-child,
.dfcv__positions td:first-child {
    text-align: left;
}

.dfcv__positions thead th {
    position: sticky;
    z-index: 1;
    top: 0;
    color: #4b5560;
    background: #fff;
    font-size: 13px;
}

.dfcv__positions tbody tr {
    cursor: pointer;
}

.dfcv__positions tbody tr:hover,
.dfcv__positions tbody tr.is-selected {
    background: #fff1e6;
}

.dfcv__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border-top: 1px solid var(--dfcv-line);
}

.dfcv__button {
    min-height: 42px;
    padding: 0.5rem 0.75rem;
    color: #242a31;
    background: #fff;
    border: 1px solid #aeb6be;
    border-radius: 9px;
    font: inherit;
    font-size: 16px;
    font-weight: 720;
    cursor: pointer;
}

.dfcv__button:hover,
.dfcv__button:focus-visible {
    border-color: var(--dfcv-orange);
    outline: 2px solid rgba(238, 118, 30, 0.2);
    outline-offset: 1px;
}

.dfcv__play {
    min-width: 122px;
    color: #fff;
    background: var(--dfcv-orange);
    border-color: var(--dfcv-orange-dark);
}

.dfcv__fullscreen {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.56);
}

.dfcv__toggle {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.5rem;
    color: #343c45;
    font-size: 15px;
    font-weight: 650;
    white-space: nowrap;
}

.dfcv__toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--dfcv-orange);
}

.dfcv__speed {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    margin-left: auto;
    white-space: nowrap;
}

.dfcv__speed select {
    width: auto;
    min-height: 40px;
    margin: 0;
}

.dfcv:fullscreen,
.dfcv.dfcv--fullscreen {
    display: grid;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr) auto;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
}

.dfcv:fullscreen .dfcv__layout,
.dfcv.dfcv--fullscreen .dfcv__layout {
    height: auto;
    min-height: 0;
    overflow: hidden;
    grid-template-columns: minmax(185px, 18%) minmax(0, 1fr) minmax(315px, 21%);
}

.dfcv:fullscreen .dfcv__sidebar,
.dfcv.dfcv--fullscreen .dfcv__sidebar,
.dfcv:fullscreen .dfcv__stage,
.dfcv.dfcv--fullscreen .dfcv__stage,
.dfcv:fullscreen .dfcv__positions-panel,
.dfcv.dfcv--fullscreen .dfcv__positions-panel {
    min-height: 0;
    overflow: hidden;
}

.dfcv:fullscreen .dfcv__frames,
.dfcv.dfcv--fullscreen .dfcv__frames {
    max-height: none;
}

.dfcv:fullscreen .dfcv__canvas-wrap,
.dfcv.dfcv--fullscreen .dfcv__canvas-wrap {
    min-height: 0;
}

.dfcv:fullscreen .dfcv__canvas,
.dfcv.dfcv--fullscreen .dfcv__canvas {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
}

.dfcv-message,
.dfcv--error {
    padding: 1rem;
    color: #7a2600;
    background: #fff4ed;
    border: 1px solid #ffc9a8;
    border-radius: 8px;
}

@media (max-width: 1100px) {
    .dfcv__layout {
        grid-template-columns: minmax(170px, 24%) minmax(0, 1fr);
    }

    .dfcv__positions-panel {
        grid-column: 1 / -1;
        max-height: 260px;
        border-top: 1px solid var(--dfcv-line);
        border-left: 0;
    }
}

@media (max-width: 760px) {
    .dfcv {
        border-radius: 12px;
    }

    .dfcv__layout {
        display: flex;
        min-height: 0;
        flex-direction: column;
    }

    .dfcv__sidebar {
        display: block;
        padding: 0.7rem;
        border-right: 0;
        border-bottom: 1px solid var(--dfcv-line);
    }

    .dfcv__select-wrap {
        margin: 0 0 0.55rem;
    }

    .dfcv__frames {
        display: flex;
        max-height: none;
        gap: 0.35rem;
        overflow-x: auto;
        scroll-snap-type: x proximity;
    }

    .dfcv__frames li,
    .dfcv__frames li + li {
        min-width: max-content;
        margin: 0;
        scroll-snap-align: start;
    }

    .dfcv__frames button {
        max-width: 190px;
        padding: 0.55rem 0.72rem;
        background: #fff;
        border: 1px solid #d4d9de;
    }

    .dfcv__stage {
        padding: 0.55rem;
    }

    .dfcv__canvas-wrap {
        min-height: min(68vh, 520px);
    }

    .dfcv__canvas {
        min-height: min(66vh, 500px);
        max-height: 66vh;
    }

    .dfcv__controls {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0.7rem;
    }

    .dfcv__button {
        min-height: 44px;
    }

    .dfcv__first,
    .dfcv__last {
        display: none;
    }

    .dfcv__toggle {
        margin-left: 0;
    }

    .dfcv__speed {
        margin-left: 0;
    }

    .dfcv__positions-panel {
        max-height: 240px;
        padding: 0.75rem;
    }
}

@media (max-width: 430px) {
    .dfcv__header {
        padding: 0.8rem;
    }

    .dfcv__fullscreen {
        padding-inline: 0.55rem;
    }

    .dfcv__canvas-wrap {
        min-height: 430px;
    }

    .dfcv__canvas {
        min-height: 420px;
    }

    .dfcv__play {
        min-width: 112px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dfcv * {
        scroll-behavior: auto !important;
    }
}

@media (min-width: 761px) {
    .dfcv:fullscreen .dfcv__positions-panel,
    .dfcv.dfcv--fullscreen .dfcv__positions-panel {
        grid-column: auto;
        max-height: none;
        border-top: 0;
        border-left: 1px solid var(--dfcv-line);
    }
}
