.header-return-link[hidden] {
    display: none !important;
}

.tutorial-video-toggle {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ed6821;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgb(237 104 33 / 25%);
    align-items: center;
}

.tutorial-video-toggle:hover,
.tutorial-video-toggle:focus-visible {
    background: #d85816;
}

.tutorial-header-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.tutorial-video-panel[hidden] {
    display: none !important;
}

.tutorial-video-panel {
    position: fixed;
    z-index: 10000;
    top: 18px;
    right: 18px;
    display: flex;
    flex-direction: column;
    width: min(440px, calc(100vw - 36px));
    height: min(296px, calc(100vh - 36px));
    min-width: min(280px, calc(100vw - 20px));
    min-height: min(210px, calc(100vh - 20px));
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 36px);
    overflow: hidden;
    padding-bottom: 20px;
    border: 1px solid #dce2eb;
    border-radius: 14px;
    background: #111827;
    box-shadow: 0 16px 48px rgb(18 33 62 / 28%);
}

.tutorial-video-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 16px;
    background: #ed6821;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: move;
    touch-action: none;
    user-select: none;
}

.tutorial-video-panel-header button {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: rgb(255 255 255 / 18%);
    color: inherit;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.tutorial-video-panel-header button:hover,
.tutorial-video-panel-header button:focus-visible {
    background: rgb(255 255 255 / 32%);
}

.tutorial-video-panel video {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    height: 0;
    min-height: 0;
    background: #111827;
    object-fit: contain;
}

.tutorial-video-status[hidden],
.tutorial-video-status button[hidden] {
    display: none;
}

.tutorial-video-status {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 12px 16px;
    border-radius: 8px;
    background: rgb(17 24 39 / 88%);
    color: #fff;
    font-size: 13px;
    text-align: center;
    transform: translate(-50%, -50%);
}

.tutorial-video-status button {
    padding: 6px 12px;
    border: 0;
    border-radius: 6px;
    background: #ed6821;
    color: #fff;
    cursor: pointer;
}

.tutorial-video-resize {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 27px;
    height: 20px;
    cursor: nesw-resize;
    touch-action: none;
    background: #ed6821;
    clip-path: polygon(0 0, 0 100%, 100% 100%);
}

.tutorial-video-resize::after {
    content: '↙';
    position: absolute;
    left: 1px;
    bottom: 0;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
}

@media (max-width: 600px) {
    .tutorial-video-panel {
        top: max(10px, env(safe-area-inset-top));
        right: 10px;
        width: calc(100vw - 20px);
        height: min(260px, calc(100vh - 20px));
    }
}
