.qn-shorts {
    padding: clamp(30px, 4.1vw, 58px) 0;
    color: #392d26;
    background: #f7f3ed;
    scroll-margin-top: 118px;
}

.qn-shorts-header, .qn-shorts-actions, .qn-shorts-controls {
    display: flex;
    align-items: center;
}

.qn-shorts-header {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 17px;
}

.qn-shorts-header h2 {
    margin: 0;
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.2;
    letter-spacing: -.025em;
}

.qn-shorts-actions { gap: 14px; }
.qn-shorts-controls { gap: 7px; }
.qn-shorts-controls[hidden] { display: none; }

.qn-shorts-channel, .qn-shorts-watch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: #95211b;
    font-weight: 700;
    font-size: 14px;
    text-underline-offset: 3px;
}

.qn-shorts-channel:hover, .qn-shorts-watch:hover { text-decoration: underline; }

.qn-shorts-controls button, .qn-shorts-dialog button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0 0 2px;
    border: 1px solid #ddcfc0;
    border-radius: 50%;
    color: #5d3326;
    background: #fffdfa;
    font-size: 29px;
    line-height: 1;
    cursor: pointer;
}

.qn-shorts-controls button:hover { background: #f1e4da; }
.qn-shorts-controls button[aria-disabled="true"] { opacity: .45; cursor: default; }
.qn-shorts a:focus-visible, .qn-shorts button:focus-visible { outline: 2px solid #9e221b; outline-offset: 2px; }

.qn-shorts-list {
    --short-gap: 14px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(272px, calc((100% - 4 * var(--short-gap)) / 4.35));
    gap: var(--short-gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    margin: 0;
    padding: 4px 4px 12px;
    scrollbar-width: thin;
    scrollbar-color: #bcaa9b transparent;
    list-style: none;
}

.qn-shorts-list li {
    display: flex;
    min-width: 0;
    margin: 0;
    scroll-snap-align: start;
}
.qn-shorts-list li:first-child { scroll-margin-inline-start: 4px; }

.qn-shorts-card {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    color: inherit;
    background: #fffdfa;
    border: 1px solid #e8ddd1;
    border-radius: 12px;
    box-shadow: 0 2px 5px #35211612;
    text-decoration: none;
}
.qn-shorts-card:hover { color: #95211b; border-color: #ba9080; }

.qn-shorts-poster {
    display: grid;
    place-items: center;
    position: relative;
    aspect-ratio: 9 / 16;
    background: #48362e;
    overflow: hidden;
}

.qn-shorts-poster img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qn-shorts-play {
    display: grid;
    place-items: center;
    position: relative;
    width: 48px;
    height: 48px;
    border: 1px solid #ffffffb0;
    border-radius: 50%;
    background: #26160fc4;
    box-shadow: 0 2px 15px #0004;
}
.qn-shorts-play::after {
    content: "";
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 12px solid white;
    margin-left: 3px;
}
.qn-shorts-card:hover .qn-shorts-play { background: #922821; }

.qn-shorts-title {
    padding: 10px 12px 12px;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.qn-shorts-dialog {
    width: min(440px, calc(100% - 24px));
    max-height: calc(100dvh - 20px);
    padding: 12px 14px 6px;
    border: 0;
    border-radius: 14px;
    color: #392d26;
    background: #fffdfa;
    overscroll-behavior: contain;
}
.qn-shorts-dialog::backdrop { background: #1c1410dc; }
.qn-shorts-dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.qn-shorts-dialog h2 { margin: 0; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.qn-shorts-dialog [data-shorts-swipe] { touch-action: none; }
.qn-shorts-dialog form { flex: none; margin: 0; }
.qn-shorts-stage { padding: 0 8px; }
.qn-shorts-player { margin: auto; width: min(100%, max(113px, calc((100dvh - 184px) * .5625))); aspect-ratio: 9 / 16; background: #111; border-radius: 6px; overflow: hidden; }
.qn-shorts-player iframe { display: block; border: 0; width: 100%; height: 100%; }
.qn-shorts-dialog-footer { margin-top: 9px; text-align: center; }
.qn-shorts-player-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.qn-shorts-player-nav button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 6px 4px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}
.qn-shorts-player-nav button:hover { background: #f2e7dd; }
.qn-shorts-player-nav button[aria-disabled="true"] { opacity: .45; cursor: default; background: #fffdfa; }
.qn-shorts-player-nav button span { font-size: 22px; line-height: .8; }
.qn-shorts-position { color: #6e5a4f; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 1000px) {
    .qn-shorts-list { grid-auto-columns: calc((100% - 3 * var(--short-gap)) / 3.25); }
}

@media (max-width: 620px) {
    .qn-shorts { scroll-margin-top: 82px; }
    .qn-shorts-header { margin-bottom: 11px; }
    .qn-shorts-list { --short-gap: 10px; grid-auto-columns: calc((100% - 2 * var(--short-gap)) / 2.12); }
    .qn-shorts-title { font-size: 14px; padding: 9px 9px 11px; }
    .qn-shorts-controls { display: none; }
    .qn-shorts-dialog { padding: 10px 10px max(4px, env(safe-area-inset-bottom)); }
    .qn-shorts-stage { padding-inline: 10px; }
}
