/*
 * Site header (resources/views/livewire/components/navbar.blade.php).
 *
 * Plain CSS on purpose: the site ships a prebuilt Tailwind bundle, so the header cannot rely on
 * utility classes that were never compiled into it. Everything is scoped under .ycn.
 *
 * The bar itself stays dark in both themes (as the old header did); the account menu and the
 * mobile drawer are surfaces that follow the light/dark theme.
 */

.ycn {
    --ycn-h: 64px;
    --ycn-fg: #ffffff;
    --ycn-fg-muted: rgba(255, 255, 255, 0.74);
    --ycn-fg-subtle: rgba(255, 255, 255, 0.52);
    --ycn-hover: rgba(255, 255, 255, 0.08);
    --ycn-active: rgba(255, 255, 255, 0.11);
    --ycn-line: rgba(255, 255, 255, 0.09);
    --ycn-teal: #2d8bad;
    --ycn-teal-strong: #1f7898;
    --ycn-teal-light: #6ccbe8;
    --ycn-gold: #f5b942;
    --ycn-ring: #6ccbe8;
    --ycn-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

    --ycn-surface: #ffffff;
    --ycn-surface-2: #f3f5f8;
    --ycn-surface-fg: #0f172a;
    --ycn-surface-muted: #5b6676;
    --ycn-surface-line: #e4e8ee;
    --ycn-surface-hover: #f1f4f8;
    --ycn-surface-current: rgba(45, 139, 173, 0.1);
    --ycn-surface-accent: #186580;
    --ycn-surface-ring: #1f7898;
    --ycn-danger: #c81e1e;
    --ycn-danger-bg: rgba(220, 38, 38, 0.08);
    --ycn-premium-fg: #8a5a00;
    --ycn-premium-bg: #fff3d6;
    --ycn-shadow: 0 24px 48px -16px rgba(15, 23, 42, 0.3), 0 6px 16px -6px rgba(15, 23, 42, 0.14);

    position: sticky;
    top: 0;
    z-index: 40;
    color: var(--ycn-fg);
    font-family: inherit;
    line-height: 1.25;
}

[data-theme="dark"] .ycn {
    --ycn-surface: #161c24;
    --ycn-surface-2: #1d2530;
    --ycn-surface-fg: #e8edf3;
    --ycn-surface-muted: #9ba7b5;
    --ycn-surface-line: #273140;
    --ycn-surface-hover: #1f2833;
    --ycn-surface-current: rgba(108, 203, 232, 0.12);
    --ycn-surface-accent: #6ccbe8;
    --ycn-surface-ring: #6ccbe8;
    --ycn-danger: #f87171;
    --ycn-danger-bg: rgba(248, 113, 113, 0.1);
    --ycn-premium-fg: #f5c45e;
    --ycn-premium-bg: rgba(245, 185, 66, 0.14);
    --ycn-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.7), 0 6px 16px -6px rgba(0, 0, 0, 0.45);
}

/* While the drawer or account menu is open (or closing) the header must sit above the fixed
   audio player (z-50). */
.ycn.is-drawer-open,
.ycn.is-menu-open,
.ycn:has(.ycn-drawer-leave, .ycn-pop-leave) {
    z-index: 70;
}

/* Admin "view as user" banner is fixed to the top; --ycn-top is its measured height. */
.ycn--viewas {
    top: var(--ycn-top, 2.75rem);
    margin-top: calc(var(--ycn-top, 2.75rem) - 2.75rem);
}

/* The header is sticky: keep scrollIntoView({ block: 'start' }) targets (playlist "load more")
   clear of it, and don't ring the whole page when the skip link focuses the content. */
html {
    scroll-padding-top: 76px;
}

#main-content:focus {
    outline: none;
}

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

.ycn p {
    margin: 0;
}

.ycn ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ycn .ycn-icon {
    display: block;
    flex: none;
    width: 18px;
    height: 18px;
}

.ycn-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus rings: keyboard only. */
.ycn a:focus-visible,
.ycn button:focus-visible {
    outline: 2px solid var(--ycn-ring);
    outline-offset: 2px;
}

.ycn-menu a:focus-visible,
.ycn-menu button:focus-visible,
.ycn-drawer__panel a:focus-visible,
.ycn-drawer__panel button:focus-visible {
    outline-color: var(--ycn-surface-ring);
    outline-offset: -2px;
}

.ycn-drawer__panel .ycn-fbtn--primary:focus-visible {
    outline-offset: 2px;
}

/* ---------- Skip link ---------- */

.ycn-skip {
    position: absolute;
    top: 10px;
    left: 12px;
    z-index: 3;
    padding: 10px 16px;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    transform: translateY(-160%);
    transition: transform 0.18s var(--ycn-ease);
}

.ycn-skip:focus {
    transform: translateY(0);
}

/* ---------- Bar ---------- */

.ycn-bar {
    position: relative;
    background: linear-gradient(90deg, #080b0f 0%, #10151b 52%, #1b222a 100%);
    border-bottom: 1px solid var(--ycn-line);
    transition: box-shadow 0.25s ease;
}

.ycn.is-scrolled .ycn-bar {
    box-shadow: 0 12px 28px -18px rgba(0, 0, 0, 0.9);
}

.ycn-container {
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--ycn-h);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px 0 16px;
}

@media (min-width: 640px) {
    .ycn-container {
        padding: 0 24px;
    }
}

/* ---------- Brand ---------- */

.ycn-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
    margin-left: -5px;
    padding: 5px;
    border-radius: 12px;
    color: var(--ycn-fg);
    text-decoration: none;
}

.ycn-brand__mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #ffffff;
    background: linear-gradient(140deg, #4cbde0 0%, #2d8bad 52%, #1b6a88 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 16px -6px rgba(45, 139, 173, 0.85);
    transition: transform 0.3s var(--ycn-ease), box-shadow 0.3s ease;
}

.ycn-brand__mark svg {
    display: block;
    width: 20px;
    height: 20px;
}

.ycn-brand:hover .ycn-brand__mark {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 20px -6px rgba(45, 139, 173, 1);
}

.ycn-brand__name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
}

.ycn-brand__accent {
    color: var(--ycn-teal-light);
}

.ycn-brand--surface {
    color: var(--ycn-surface-fg);
}

.ycn-brand--surface .ycn-brand__accent {
    color: var(--ycn-surface-accent);
}

/* ---------- Desktop links ---------- */

.ycn-primary {
    display: none;
    margin-left: 18px;
}

.ycn-primary__list {
    display: flex;
    align-items: center;
    gap: 2px;
}

.ycn-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 13px;
    border-radius: 10px;
    color: var(--ycn-fg-muted);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.ycn-link .ycn-icon {
    color: var(--ycn-fg-subtle);
    transition: color 0.15s ease, transform 0.2s var(--ycn-ease);
}

.ycn-link:hover {
    color: var(--ycn-fg);
    background: var(--ycn-hover);
}

.ycn-link:hover .ycn-icon {
    color: var(--ycn-teal-light);
}

.ycn-link[aria-current="page"] {
    color: var(--ycn-fg);
    background: var(--ycn-active);
}

.ycn-link[aria-current="page"] .ycn-icon {
    color: var(--ycn-teal-light);
}

/* Tab-style indicator resting on the bar's bottom edge. */
.ycn-link[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -12px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--ycn-teal-light);
}

/* ---------- Right-hand actions ---------- */

.ycn-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.ycn-iconbtn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--ycn-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--ycn-fg-muted);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.ycn-iconbtn:hover {
    color: var(--ycn-fg);
    background: var(--ycn-hover);
    border-color: rgba(255, 255, 255, 0.18);
}

.ycn-iconbtn .ycn-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.35s var(--ycn-ease);
}

/* Below 1024px the theme switch lives in the drawer's Appearance section instead. */
.ycn-actions .ycn-theme {
    display: none;
}

.ycn .ycn-theme__sun {
    display: none;
    color: #fcd34d;
}

[data-theme="dark"] .ycn .ycn-theme__sun {
    display: block;
}

[data-theme="dark"] .ycn .ycn-theme__moon {
    display: none;
}

.ycn-btn {
    display: none;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 15px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.2s ease, transform 0.2s var(--ycn-ease);
}

.ycn-btn--ghost {
    color: var(--ycn-fg-muted);
}

.ycn-btn--ghost .ycn-icon {
    color: var(--ycn-fg-subtle);
    transition: color 0.15s ease;
}

.ycn-btn--ghost:hover {
    color: var(--ycn-fg);
    background: var(--ycn-hover);
}

.ycn-btn--ghost:hover .ycn-icon {
    color: var(--ycn-teal-light);
}

.ycn-btn--primary {
    color: #ffffff;
    background: var(--ycn-teal-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 20px -10px rgba(45, 139, 173, 0.95);
}

.ycn-btn--primary:hover {
    background: #1a6b88;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 24px -10px rgba(45, 139, 173, 1);
}

.ycn-btn--primary:active {
    transform: translateY(0);
}

.ycn-btn__arrow {
    width: 16px !important;
    height: 16px !important;
    transition: transform 0.2s var(--ycn-ease);
}

.ycn-btn--primary:hover .ycn-btn__arrow {
    transform: translateX(3px);
}

/* ---------- Account button + menu (desktop) ---------- */

.ycn-user {
    position: relative;
    display: none;
}

.ycn-user__button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    max-width: 260px;
    padding: 0 12px 0 4px;
    border: 1px solid var(--ycn-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--ycn-fg);
    font: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ycn-user__button:hover,
.ycn-user__button[aria-expanded="true"] {
    background: var(--ycn-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.ycn-user__button.is-current {
    border-color: rgba(108, 203, 232, 0.55);
}

.ycn-user__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
}

.ycn .ycn-user__chevron {
    width: 16px;
    height: 16px;
    color: var(--ycn-fg-subtle);
    transition: transform 0.2s var(--ycn-ease);
}

.ycn-user__button[aria-expanded="true"] .ycn-user__chevron {
    transform: rotate(180deg);
}

.ycn-avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: linear-gradient(140deg, #1f7898 0%, #1a6b88 55%, #155a73 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    user-select: none;
}

.ycn-avatar--sm {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.ycn-avatar--lg {
    width: 44px;
    height: 44px;
    font-size: 15px;
}

/* Premium accounts get a gold ring. */
.ycn-avatar--premium {
    box-shadow: 0 0 0 2px #0e1318, 0 0 0 4px var(--ycn-gold);
}

.ycn-menu .ycn-avatar--premium,
.ycn-card .ycn-avatar--premium {
    box-shadow: 0 0 0 2px var(--ycn-surface), 0 0 0 4px var(--ycn-gold);
}

.ycn-menu {
    position: absolute;
    top: calc(100% + 19px);
    right: 0;
    width: 316px;
    padding: 8px;
    border: 1px solid var(--ycn-surface-line);
    border-radius: 16px;
    background: var(--ycn-surface);
    color: var(--ycn-surface-fg);
    box-shadow: var(--ycn-shadow);
    transform-origin: top right;
}

.ycn-menu__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 10px 12px;
}

.ycn-menu__who {
    min-width: 0;
    flex: 1;
}

.ycn-menu__name,
.ycn-card__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 700;
}

.ycn-menu__email,
.ycn-card__email {
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ycn-surface-muted);
    font-size: 13px;
}

.ycn-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px !important;
}

.ycn-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--ycn-surface-2);
    color: var(--ycn-surface-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.ycn .ycn-badge .ycn-icon {
    width: 13px;
    height: 13px;
}

.ycn-badge--premium {
    background: var(--ycn-premium-bg);
    color: var(--ycn-premium-fg);
}

.ycn-badge--admin {
    background: var(--ycn-surface-current);
    color: var(--ycn-surface-accent);
}

.ycn-upgrade {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 6px;
    padding: 10px 12px;
    border: 1px solid rgba(245, 185, 66, 0.35);
    border-radius: 12px;
    background: linear-gradient(120deg, rgba(245, 185, 66, 0.14), rgba(245, 185, 66, 0.04));
    color: var(--ycn-surface-fg);
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ycn-upgrade:hover {
    border-color: rgba(245, 185, 66, 0.7);
}

.ycn-upgrade__icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 9px;
    background: var(--ycn-premium-bg);
    color: var(--ycn-premium-fg);
}

.ycn-upgrade__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    font-size: 14px;
}

.ycn-upgrade__text span {
    color: var(--ycn-surface-muted);
    font-size: 12.5px;
}

.ycn .ycn-upgrade__arrow {
    width: 16px;
    height: 16px;
    color: var(--ycn-premium-fg);
    transition: transform 0.2s var(--ycn-ease);
}

.ycn-upgrade:hover .ycn-upgrade__arrow {
    transform: translateX(3px);
}

.ycn-menu__label {
    padding: 10px 10px 4px;
    color: var(--ycn-surface-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ycn-menu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--ycn-surface-fg);
    font: inherit;
    font-size: 14.5px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.ycn-menu__item .ycn-icon {
    color: var(--ycn-surface-muted);
    transition: color 0.12s ease;
}

.ycn-menu__item:hover {
    background: var(--ycn-surface-hover);
}

.ycn-menu__item:hover .ycn-icon {
    color: var(--ycn-surface-accent);
}

.ycn-menu__item[aria-current="page"] {
    background: var(--ycn-surface-current);
    color: var(--ycn-surface-accent);
    font-weight: 600;
}

.ycn-menu__item[aria-current="page"] .ycn-icon {
    color: var(--ycn-surface-accent);
}

.ycn-menu__item--danger:hover {
    background: var(--ycn-danger-bg);
    color: var(--ycn-danger);
}

.ycn-menu__item--danger:hover .ycn-icon {
    color: var(--ycn-danger);
}

.ycn-menu__item[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.ycn-menu__sep {
    height: 1px;
    margin: 6px 4px;
    background: var(--ycn-surface-line);
}

.ycn-pop-enter {
    transition: opacity 0.16s ease-out, transform 0.18s var(--ycn-ease);
}

.ycn-pop-leave {
    transition: opacity 0.12s ease-in, transform 0.12s ease-in;
}

.ycn-pop-from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
}

.ycn-pop-to {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ---------- Menu button (mobile) ---------- */

.ycn-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    min-width: 44px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: none;
    color: var(--ycn-fg);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ycn-burger:hover {
    background: var(--ycn-hover);
}

.ycn-burger--account {
    padding: 0 5px 0 12px;
    border-color: var(--ycn-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.ycn-burger__lines {
    display: grid;
    gap: 4px;
    width: 20px;
}

.ycn-burger__lines span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s var(--ycn-ease);
}

.ycn-burger__lines span:nth-child(2) {
    width: 14px;
    justify-self: end;
}

.ycn-burger:hover .ycn-burger__lines span:nth-child(2) {
    transform: scaleX(1.43);
    transform-origin: right;
}

/* ---------- Drawer (mobile) ---------- */

.ycn-drawer {
    position: fixed;
    inset: 0;
}

.ycn--viewas .ycn-drawer {
    top: var(--ycn-top, 2.75rem);
}

.ycn-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 12, 0.56);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.ycn-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(88vw, 380px);
    background: var(--ycn-surface);
    color: var(--ycn-surface-fg);
    box-shadow: -24px 0 60px -20px rgba(0, 0, 0, 0.55);
}

.ycn-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: none;
    height: var(--ycn-h);
    padding: 0 10px 0 16px;
    border-bottom: 1px solid var(--ycn-surface-line);
}

.ycn-close {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--ycn-surface-muted);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.25s var(--ycn-ease);
}

.ycn-close:hover {
    background: var(--ycn-surface-hover);
    color: var(--ycn-surface-fg);
}

.ycn .ycn-close .ycn-icon {
    width: 22px;
    height: 22px;
}

.ycn-drawer__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 12px 18px;
}

.ycn-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 12px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--ycn-surface-line);
    border-radius: 16px;
    background: var(--ycn-surface-2);
}

.ycn-card__who {
    min-width: 0;
}

.ycn-card__badges {
    grid-column: 1 / -1;
    margin-top: 12px !important;
}

.ycn-card .ycn-badge:not(.ycn-badge--premium):not(.ycn-badge--admin) {
    background: var(--ycn-surface);
    box-shadow: inset 0 0 0 1px var(--ycn-surface-line);
}

.ycn-dsection + .ycn-dsection {
    margin-top: 16px;
}

.ycn-dsection__label {
    padding: 0 10px 6px;
    color: var(--ycn-surface-muted);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ycn-drow {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 52px;
    padding: 6px 10px;
    border: 0;
    border-radius: 14px;
    background: none;
    color: var(--ycn-surface-fg);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.ycn-drow:hover,
.ycn-drow:active {
    background: var(--ycn-surface-hover);
}

.ycn-drow__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--ycn-surface-2);
    color: var(--ycn-surface-muted);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ycn .ycn-drow__icon .ycn-icon {
    width: 20px;
    height: 20px;
}

.ycn-drow:hover .ycn-drow__icon {
    background: var(--ycn-surface-current);
    color: var(--ycn-surface-accent);
}

.ycn-drow__label {
    flex: 1;
    min-width: 0;
}

.ycn .ycn-drow__chevron {
    width: 16px;
    height: 16px;
    color: var(--ycn-surface-muted);
    opacity: 0.55;
    transition: transform 0.2s var(--ycn-ease), opacity 0.15s ease;
}

.ycn-drow:hover .ycn-drow__chevron {
    opacity: 1;
}

.ycn-drow[aria-current="page"] {
    background: var(--ycn-surface-current);
    color: var(--ycn-surface-accent);
}

.ycn-drow[aria-current="page"] .ycn-drow__icon {
    background: var(--ycn-teal-strong);
    color: #ffffff;
}

[data-theme="dark"] .ycn-drow[aria-current="page"] .ycn-drow__icon {
    background: var(--ycn-teal-light);
    color: #0b1a22;
}

/* Dark-mode switch row. */
.ycn-switch {
    position: relative;
    flex: none;
    width: 46px;
    height: 28px;
    border-radius: 999px;
    background: #7d8a9b;
    transition: background-color 0.2s ease;
}

.ycn-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.22s var(--ycn-ease);
}

[data-theme="dark"] .ycn-switch {
    background: var(--ycn-teal);
}

[data-theme="dark"] .ycn-switch::after {
    transform: translateX(18px);
}

.ycn-drawer__foot {
    flex: none;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--ycn-surface-line);
}

.ycn-foot-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ycn-fbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ycn-fbtn--outline {
    border-color: var(--ycn-surface-line);
    background: var(--ycn-surface);
    color: var(--ycn-surface-fg);
}

.ycn-fbtn--outline:hover {
    background: var(--ycn-surface-hover);
}

.ycn-fbtn--primary {
    background: var(--ycn-teal-strong);
    color: #ffffff;
}

.ycn-fbtn--primary:hover {
    background: #1a6b88;
}

.ycn-fbtn--danger {
    border-color: var(--ycn-surface-line);
    background: var(--ycn-surface);
    color: var(--ycn-danger);
}

.ycn-fbtn--danger:hover {
    border-color: transparent;
    background: var(--ycn-danger-bg);
}

.ycn-fbtn[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.ycn-legal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px !important;
    color: var(--ycn-surface-muted);
    font-size: 13px;
}

.ycn-legal a {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    color: var(--ycn-surface-muted);
    text-decoration: none;
}

.ycn-legal a:hover {
    color: var(--ycn-surface-fg);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Drawer enter/leave (classes applied by x-transition on .ycn-drawer). */
.ycn-drawer-enter,
.ycn-drawer-leave {
    transition: opacity 0.3s var(--ycn-ease);
}

.ycn-drawer-enter .ycn-drawer__backdrop,
.ycn-drawer-leave .ycn-drawer__backdrop {
    transition: opacity 0.3s ease;
}

.ycn-drawer-enter .ycn-drawer__panel,
.ycn-drawer-leave .ycn-drawer__panel {
    transition: transform 0.3s var(--ycn-ease);
}

.ycn-drawer-from .ycn-drawer__backdrop {
    opacity: 0;
}

.ycn-drawer-from .ycn-drawer__panel {
    transform: translateX(100%);
}

.ycn-drawer-to .ycn-drawer__backdrop {
    opacity: 1;
}

.ycn-drawer-to .ycn-drawer__panel {
    transform: translateX(0);
}

/* ---------- Breakpoints ---------- */

@media (min-width: 1024px) {
    /* Logo left, links centred on the bar, actions right. */
    .ycn-container {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
    }

    .ycn-brand {
        justify-self: start;
    }

    .ycn-primary {
        display: block;
        margin-left: 0;
    }

    .ycn-actions {
        justify-self: end;
        margin-left: 0;
    }

    .ycn-btn {
        display: inline-flex;
    }

    .ycn-user {
        display: block;
    }

    .ycn-burger {
        display: none;
    }

    .ycn-actions .ycn-theme {
        display: inline-grid;
    }

    .ycn-drawer {
        display: none !important;
    }
}

@media (min-width: 1024px) and (max-width: 1199px) {
    .ycn-user__name {
        max-width: 120px;
    }
}

/* Movement on hover only where a real pointer hovers; touch browsers keep :hover after a tap. */
@media (hover: hover) and (pointer: fine) {
    .ycn-brand:hover .ycn-brand__mark {
        transform: rotate(-8deg) scale(1.06);
    }

    .ycn-link:hover .ycn-icon {
        transform: translateY(-1px) scale(1.08);
    }

    .ycn-theme:hover .ycn-icon {
        transform: rotate(-18deg);
    }

    .ycn-close:hover {
        transform: rotate(90deg);
    }

    .ycn-drow:hover .ycn-drow__chevron {
        transform: translateX(3px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ycn *,
    .ycn *::before,
    .ycn *::after {
        transition-duration: 0s !important;
        animation: none !important;
    }
}

@media (forced-colors: active) {
    .ycn-burger__lines span {
        background: ButtonText;
    }

    .ycn-switch {
        border: 2px solid ButtonText;
    }

    .ycn-switch::after {
        top: 1px;
        left: 1px;
        background: ButtonText;
    }

    .ycn-link[aria-current="page"]::after {
        background: Highlight;
    }

    .ycn-drow[aria-current="page"],
    .ycn-menu__item[aria-current="page"] {
        border-left: 4px solid Highlight;
    }
}

@media print {
    .ycn {
        position: static;
    }

    .ycn-actions,
    .ycn-primary,
    .ycn-drawer,
    .ycn-skip {
        display: none !important;
    }
}
