/* Web-only overrides. Kept in source so the build does not rewrite desktop CSS. */
html[data-platform="web"].web-shell-pending {
    background-color: var(--bg);
}

/* Web pages use theme colors directly instead of loading a wallpaper. */
html[data-platform="web"],
html[data-platform="web"] body {
    background-color: #FFF5F7 !important;
    background-image: none !important;
}

html[data-platform="web"][data-theme="dark"],
html[data-platform="web"][data-theme="dark"] body {
    background-color: #21191C !important;
}

html[data-platform="web"].web-shell-pending body {
    overflow: hidden;
    transition: none;
}

html[data-platform="web"] body {
    isolation: isolate;
}

html[data-platform="web"] .web-background-layer {
    display: none !important;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-color: var(--bg);
    object-fit: cover;
    object-position: center;
}

html[data-platform="web"] .web-background-layer.is-unavailable {
    visibility: hidden;
}

html[data-platform="web"] .custom-title-bar,
html[data-platform="web"] .web-app-topbar,
html[data-platform="web"] .app-container {
    position: relative;
    z-index: 1;
}

html[data-platform="web"].web-shell-pending .custom-title-bar,
html[data-platform="web"].web-shell-pending .app-container,
html[data-platform="web"].web-shell-pending .web-app-topbar {
    visibility: hidden !important;
}

html[data-platform="web"] .window-controls {
    display: none;
}

html[data-platform="web"] .web-hidden {
    display: none !important;
}

html[data-platform="web"] #load-all-btn {
    display: none !important;
}

html[data-platform="web"] #btn-toggle-followed-notification,
html[data-platform="web"] #btn-toggle-all-followed-notifications {
    display: none !important;
}

html[data-platform="web"] #web-message-controls-host {
    display: none;
}

html[data-platform="web"] .web-message-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

html[data-platform="web"] .web-message-page-header .page-title {
    margin: 0 0 5px;
}

html[data-platform="web"] .web-message-page-header p {
    margin: 0;
    color: var(--text-sub);
    font-size: 12px;
}

html[data-platform="web"] .web-message-page-header #statusMsg {
    display: block !important;
    flex: 0 0 auto;
    max-width: 42%;
    white-space: normal;
    text-align: right;
}

html[data-platform="web"] .web-message-controls-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

html[data-platform="web"] .web-message-controls-grid .sidebar-group {
    display: flex !important;
    min-width: 0;
    white-space: normal;
}

html[data-platform="web"] #view-messages {
    padding: 20px 40px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

@media (min-width: 901px) {
    html[data-platform="web"] body.web-message-page .sidebar {
        display: flex !important;
    }
}

html[data-platform="web"].web-mobile-device .media-clip-toolbar,
html[data-platform="web"].web-mobile-device [data-clip-toolbar] {
    display: none !important;
}

/* iOS Safari zooms the page when a focused editable control is below 16px. */
html[data-platform="web"].web-mobile-device input:not([type]):not([readonly]),
html[data-platform="web"].web-mobile-device input[type="text"]:not([readonly]),
html[data-platform="web"].web-mobile-device input[type="search"]:not([readonly]),
html[data-platform="web"].web-mobile-device input[type="tel"]:not([readonly]),
html[data-platform="web"].web-mobile-device input[type="email"]:not([readonly]),
html[data-platform="web"].web-mobile-device input[type="password"]:not([readonly]),
html[data-platform="web"].web-mobile-device input[type="number"]:not([readonly]),
html[data-platform="web"].web-mobile-device input[type="url"]:not([readonly]),
html[data-platform="web"].web-mobile-device input[type="date"]:not([readonly]),
html[data-platform="web"].web-mobile-device input[type="time"]:not([readonly]),
html[data-platform="web"].web-mobile-device input[type="datetime-local"]:not([readonly]),
html[data-platform="web"].web-mobile-device input[type="month"]:not([readonly]),
html[data-platform="web"].web-mobile-device input[type="week"]:not([readonly]),
html[data-platform="web"].web-mobile-device textarea,
html[data-platform="web"].web-mobile-device select {
    font-size: 16px !important;
}

html[data-platform="web"] .web-live-clip-toolbar-hidden {
    display: none !important;
}

html[data-platform="web"] [data-clip-toolbar="bilibili-live"] {
    display: none !important;
}

@media (min-width: 769px) {
    html[data-platform="web"] #player-combo-wrapper.gift-panel-expanded:has(#live-gift-panel[style*="display: block"]) #live-player-area {
        flex: 0 0 var(--live-player-expanded-height) !important;
        height: var(--live-player-expanded-height) !important;
    }

    html[data-platform="web"] #player-right-column:has(#player-combo-wrapper.gift-panel-expanded #live-gift-panel[style*="display: block"]) {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    html[data-platform="web"] #player-right-column:has(#player-combo-wrapper.gift-panel-expanded #live-gift-panel[style*="display: block"])::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    html[data-platform="web"] .media-clip-toolbar > div {
        position: relative !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 100px !important;
        grid-template-rows: 14px 38px !important;
        column-gap: 15px !important;
        row-gap: 6px !important;
        align-items: stretch !important;
        min-height: 58px !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
    }

    html[data-platform="web"] .media-clip-toolbar > div > div:first-child {
        grid-column: 1 !important;
        grid-row: 1 / 3 !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    html[data-platform="web"] .media-clip-toolbar > div > div:first-child > div > div {
        align-items: center !important;
    }

    html[data-platform="web"] .media-clip-toolbar > div > div:first-child > div > span {
        display: flex !important;
        align-items: center !important;
        height: 14px !important;
        line-height: 14px !important;
    }

    html[data-platform="web"] .media-clip-toolbar > div > div:first-child button {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 64px !important;
        width: 64px !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        line-height: 1 !important;
        margin: 0 !important;
    }

    html[data-platform="web"] .media-clip-toolbar .web-clip-status-area {
        position: static !important;
        grid-column: 2 !important;
        grid-row: 1 !important;
        display: flex !important;
        align-items: center !important;
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
        height: 14px !important;
        line-height: 14px !important;
        overflow: hidden !important;
    }

    html[data-platform="web"] .media-clip-toolbar .web-clip-action-area {
        position: static !important;
        grid-column: 2 !important;
        grid-row: 2 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
        height: 38px !important;
    }

    html[data-platform="web"] .media-clip-toolbar [data-clip-role="duration-display"] {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html[data-platform="web"] .media-clip-toolbar [data-clip-role="do-clip"] {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        line-height: 1 !important;
        margin: 0 !important;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
        box-sizing: border-box !important;
    }
}

html.web-secondary-route-boot #view-home {
    display: none !important;
    visibility: hidden !important;
}

/* Keep the real homepage hidden while a direct secondary route initializes,
   but leave the normal page background visible instead of covering it with a spinner. */
html[data-platform="web"].web-shell-pending.web-secondary-route-boot .app-container {
    visibility: visible !important;
}

html[data-platform="web"] .custom-title-bar {
    height: 54px;
    margin: 12px 16px 0;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
    backdrop-filter: blur(22px) saturate(1.15);
    -webkit-app-region: no-drag;
    z-index: 20;
}

html[data-platform="web"][data-theme="dark"] .custom-title-bar {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(16, 22, 32, 0.50);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
}

html[data-platform="web"] .title-info {
    height: 36px;
    padding-left: 0;
    gap: 10px;
    font-size: 13px;
}

html[data-platform="web"] .title-info .control-btn {
    width: 36px;
    height: 36px;
    margin-right: 0 !important;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.38);
    color: var(--text);
}

html[data-platform="web"][data-theme="dark"] .title-info .control-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

html[data-platform="web"] .title-info .control-btn:hover {
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(155, 106, 156, 0.35);
}

html[data-platform="web"][data-theme="dark"] .title-info .control-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

html[data-platform="web"] .title-logo {
    width: 22px;
    height: 22px;
    border-radius: 6px;
}

html[data-platform="web"] .title-bar-center-title {
    max-width: min(360px, calc(100vw - 380px));
    height: 30px;
    padding: 0 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 13px;
}

html[data-platform="web"][data-theme="dark"] .title-bar-center-title {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.88);
}

html[data-platform="web"] {
    --web-topbar-height: 58px;
    --web-viewport-height: 100vh;
    --web-bottom-reserve: 0px;
    --web-app-height: var(--web-viewport-height);
    --web-fixed-content-height: calc(var(--web-viewport-height) - var(--web-topbar-height));
}

html[data-platform="web"] body {
    height: var(--web-viewport-height);
    min-height: var(--web-viewport-height);
    overflow: hidden;
}

html[data-platform="web"] .app-container {
    height: calc(var(--web-viewport-height) - var(--web-topbar-height));
    min-height: 0;
    overflow: hidden;
}

html[data-platform="web"] .page-container {
    height: auto;
    min-height: 0;
}

html[data-platform="web"] .main-content {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

html[data-platform="web"] .sidebar {
    display: none !important;
}

html[data-platform="web"] body.web-secondary-page {
    --web-fixed-content-height: var(--web-viewport-height);
    height: var(--web-viewport-height);
    overflow: hidden;
}

html[data-platform="web"] body.web-secondary-page .web-app-topbar {
    display: none !important;
}

html[data-platform="web"] body.web-secondary-page .app-container {
    height: var(--web-fixed-content-height);
    min-height: 0;
    overflow: hidden;
}

html[data-platform="web"] body.web-secondary-page .main-content {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

html[data-platform="web"] .web-app-topbar {
    height: 58px;
    width: 100%;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.20);
    background: color-mix(in srgb, var(--sidebar-bg) 84%, transparent);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
    position: relative;
    z-index: 80;
}

html[data-platform="web"] .web-topbar-brand {
    min-width: 0;
    height: 42px;
    padding: 0 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: default;
}

html[data-platform="web"] .web-topbar-brand img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

html[data-platform="web"] .web-topbar-brand-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

html[data-platform="web"] .web-topbar-title {
    color: var(--text);
    font-size: 15px;
    font-weight: 850;
    white-space: nowrap;
}

html[data-platform="web"] .web-topbar-subtitle {
    margin-top: 2px;
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

html[data-platform="web"] .web-topbar-actions {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

html[data-platform="web"] .web-topbar-actions::-webkit-scrollbar {
    display: none;
}

html[data-platform="web"] .web-language-select {
    height: 34px;
    min-width: 66px;
    padding: 0 24px 0 10px;
    border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
    border-radius: 8px;
    color: var(--text);
    background-color: color-mix(in srgb, var(--card) 88%, transparent);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

html[data-platform="web"] .web-language-select:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent);
    outline-offset: 2px;
}

html[data-platform="web"][data-theme="dark"] .web-language-select {
    color-scheme: dark;
    background-color: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.18);
}

html[data-platform="web"] .web-language-dropdown {
    width: 124px;
    position: relative;
    flex: 0 0 auto;
}

html[data-platform="web"] .web-language-dock {
    display: none;
    position: fixed;
    left: max(16px, env(safe-area-inset-left));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 800;
    padding: 4px;
    border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

html[data-platform="web"] .web-language-dock .web-language-trigger {
    height: 34px;
    border-radius: 8px;
    background: transparent;
}

html[data-platform="web"] .web-language-dock .web-language-trigger:hover {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

html[data-platform="web"] .web-language-dock .web-language-trigger:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent);
    outline-offset: 2px;
}

html[data-platform="web"] .web-language-trigger {
    width: 100%;
    height: 34px;
    padding: 0 10px 0 12px;
    border: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text);
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

html[data-platform="web"] .web-language-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[data-platform="web"] .web-language-arrow {
    flex: 0 0 auto;
    color: var(--text-sub);
    font-size: 9px;
    transition: transform 0.16s ease;
}

html[data-platform="web"] .web-language-dropdown.is-open .web-language-arrow {
    transform: rotate(180deg);
}

html[data-platform="web"] .web-language-menu {
    width: 124px;
    left: 0;
    right: auto;
    top: auto;
    bottom: calc(100% + 8px);
    padding: 4px;
    border-radius: 8px;
    background: var(--pocket-paper, #ffffff);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    overflow: hidden;
}

html[data-platform="web"] .web-language-dropdown.is-open .web-language-menu {
    display: block;
}

html[data-platform="web"] .web-language-option {
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 5px;
    background: transparent;
    font-family: inherit;
    text-align: left;
}

html[data-platform="web"] .web-language-option.is-selected {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    font-weight: 800;
}

html[data-platform="web"] .web-language-option:hover {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, var(--card));
}

html[data-platform="web"] .web-language-option:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 50%, transparent);
    outline-offset: -2px;
}

html[data-platform="web"] .web-topbar-btn {
    height: 34px;
    padding: 0 13px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.16s ease, color 0.16s ease;
}

html[data-platform="web"] .web-topbar-btn:hover {
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--primary);
}

html[data-platform="web"] .web-pbc-btn,
html[data-platform="web"] .web-invoice-btn {
    min-width: 96px;
    color: var(--text);
    background: transparent;
}

html[data-platform="web"] .web-pbc-btn:hover,
html[data-platform="web"] .web-invoice-btn:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--text) 8%, transparent);
}

html[data-platform="web"] .web-invoice-btn:disabled,
html[data-platform="web"] .web-invoice-btn:disabled:hover {
    color: var(--text-sub);
    background: transparent;
    cursor: not-allowed;
}

html[data-platform="web"] .web-account-button {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(107, 114, 128, 0.24);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.16s ease, background 0.16s ease;
}

html[data-platform="web"] .web-account-button:hover {
    background: rgba(107, 114, 128, 0.34);
    transform: translateY(-1px);
}

html[data-platform="web"] .web-account-button:active {
    transform: translateY(0) scale(0.97);
}

html[data-platform="web"] .web-account-login-label {
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

html[data-platform="web"] .web-account-avatar {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

html[data-platform="web"] .web-account-button.is-logged-in {
    background: rgba(255, 255, 255, 0.52);
    border: 2px solid rgba(255, 255, 255, 0.82);
    box-shadow: none;
}

html[data-platform="web"] .web-account-button.is-logged-in:hover {
    background: rgba(255, 255, 255, 0.72);
}

html[data-platform="web"] .web-account-button.is-logged-in .web-account-login-label {
    display: none;
}

html[data-platform="web"] .web-account-button.is-logged-in .web-account-avatar {
    display: block;
}

html[data-platform="web"][data-theme="dark"] .web-account-button.is-logged-in {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.20);
}

html[data-platform="web"][data-theme="dark"] .web-account-button {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.88);
    box-shadow: none;
}

html[data-platform="web"][data-theme="dark"] .web-account-button:hover {
    background: rgba(255, 255, 255, 0.20);
}

html[data-platform="web"] .web-topbar-btn-primary {
    background: transparent;
    color: var(--primary);
}

html[data-platform="web"] .web-theme-toggle {
    width: 34px;
    min-width: 34px;
    padding: 0;
    font-size: 0;
}

html[data-platform="web"] .web-theme-toggle::before {
    content: "";
    width: 17px;
    height: 17px;
    display: block;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z%27/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z%27/%3E%3C/svg%3E") center / contain no-repeat;
}

html[data-platform="web"][data-theme="dark"] .web-theme-toggle::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%274%27/%3E%3Cpath d=%27M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41%27/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27black%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%274%27/%3E%3Cpath d=%27M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41%27/%3E%3C/svg%3E");
}

html[data-platform="web"][data-theme="light"] .web-app-topbar {
    background: rgba(255, 255, 255, 0.82);
    border-bottom-color: rgba(176, 187, 202, 0.68);
}

html[data-platform="web"][data-theme="light"] .web-topbar-btn {
    background: transparent;
    box-shadow: none;
}

html[data-platform="web"][data-theme="light"] .web-topbar-btn-primary {
    background: color-mix(in srgb, var(--primary) 12%, rgba(255, 255, 255, 0.92));
    color: color-mix(in srgb, var(--primary) 84%, #24303f);
}

html[data-platform="web"] .main-content.home-mode {
    padding-top: 14px;
}

html[data-platform="web"] body.web-secondary-page .custom-title-bar {
    background: rgba(255, 255, 255, 0.24);
}

html[data-platform="web"][data-theme="dark"] body.web-secondary-page .custom-title-bar {
    background: rgba(16, 22, 32, 0.58);
}

html[data-platform="web"] body.web-secondary-page .title-bar-center-title.is-visible {
    opacity: 1;
}

html[data-platform="web"] .custom-title-bar {
    display: none;
}

html[data-platform="web"] .app-container {
    height: var(--web-fixed-content-height);
    min-height: 0;
    overflow: hidden;
}

html[data-platform="web"] .main-content.home-mode {
    height: 100%;
    min-height: 0;
    padding-top: 16px;
    overflow: hidden;
}

html[data-platform="web"] #view-home {
    flex: 1 1 auto;
    height: 100% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

html[data-platform="web"] .home-shell {
    min-height: 100%;
}

html[data-platform="web"] .web-limit-notice {
    margin: auto 8px 0;
    padding: 10px 20px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-sub);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    box-shadow: none;
    backdrop-filter: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    min-height: 72px;
}

html[data-platform="web"] .home-footer-credit {
    margin-top: 0;
}

html[data-platform="web"] .web-limit-copy {
    line-height: 1.5;
}

html[data-platform="web"] .web-download-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

html[data-platform="web"] .web-desktop-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 118px;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 8px;
    background: rgba(18, 24, 34, 0.58);
    color: var(--text);
    border: 1px solid color-mix(in srgb, var(--border) 82%, var(--primary));
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

html[data-platform="web"] .web-platform-icon {
    font-size: 18px;
    line-height: 1;
    color: color-mix(in srgb, var(--text) 72%, var(--text-sub));
}

html[data-platform="web"] .web-desktop-download-btn:hover {
    background: color-mix(in srgb, var(--primary) 8%, var(--card));
    border-color: color-mix(in srgb, var(--primary) 36%, var(--border));
    transform: translateY(-1px);
}

html[data-platform="web"][data-theme="light"] .web-limit-notice {
    border-color: transparent;
    background: transparent;
    color: #64748b;
    box-shadow: none;
}

html[data-platform="web"][data-theme="light"] .web-desktop-download-btn {
    background: rgba(255, 255, 255, 0.82);
    color: #24303f;
    border-color: rgba(171, 182, 196, 0.9);
    box-shadow: 0 8px 18px rgba(60, 82, 116, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

html[data-platform="web"][data-theme="light"] .web-desktop-download-btn:hover {
    background: rgba(255, 255, 255, 0.96);
    border-color: color-mix(in srgb, var(--primary) 32%, rgba(171, 182, 196, 0.9));
    box-shadow: 0 10px 20px rgba(60, 82, 116, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-platform="web"][data-theme="dark"] .web-limit-notice {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

html[data-platform="web"] .home-panel {
    background: color-mix(in srgb, var(--card) 54%, rgba(12, 16, 24, 0.22)) !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

html[data-platform="web"][data-theme="dark"] .home-panel {
    background: linear-gradient(135deg, rgba(18, 24, 34, 0.54), rgba(11, 15, 23, 0.46)) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16) !important;
}

html[data-platform="web"][data-theme="light"] .home-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(247, 250, 253, 0.52)) !important;
    border-color: rgba(176, 187, 202, 0.52) !important;
    box-shadow: 0 10px 24px rgba(58, 78, 109, 0.08) !important;
}

html[data-platform="web"] .home-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)), rgba(14, 23, 38, 0.54) !important;
    border-color: rgba(148, 163, 184, 0.20) !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10) !important;
}

html[data-platform="web"][data-theme="dark"] .home-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)), rgba(14, 23, 38, 0.52) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
}

html[data-platform="web"][data-theme="light"] .home-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.70), rgba(245, 248, 252, 0.60)), rgba(255, 255, 255, 0.48) !important;
    border-color: rgba(171, 182, 196, 0.58) !important;
}

html[data-platform="web"] .home-card.web-home-card-disabled,
html[data-platform="web"] .home-card.web-home-card-disabled:hover {
    color: var(--text-sub);
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    transform: none;
    cursor: not-allowed;
}

html[data-platform="web"] .home-card.web-home-card-disabled::after {
    display: none;
}

html[data-platform="web"],
html[data-platform="web"] body {
    min-width: 0;
    overflow-x: hidden;
    touch-action: manipulation;
}

html[data-platform="web"] .app-container,
html[data-platform="web"] .main-content,
html[data-platform="web"] [id^="view-"] {
    min-width: 0;
}

html[data-platform="web"] body {
    -webkit-text-size-adjust: 100%;
}

html[data-platform="web"] *,
html[data-platform="web"] *::before,
html[data-platform="web"] *::after {
    box-sizing: border-box;
}

html[data-platform="web"] .official-site-music-table {
    min-width: 0;
}

html[data-platform="web"] .official-site-music-table-head,
html[data-platform="web"] .official-site-music-card {
    grid-template-columns: 64px minmax(0, 1.2fr) minmax(180px, 0.64fr) 116px 132px 82px;
    gap: 12px;
}

html[data-platform="web"] .official-site-music-date-cell {
    font-variant-numeric: tabular-nums;
}

html[data-platform="web"] .official-site-music-group-cell {
    display: block !important;
    text-align: left;
}

html[data-platform="web"] .official-site-music-player {
    justify-content: center;
}

@supports (height: 100dvh) {
    html[data-platform="web"] {
        --web-viewport-height: 100dvh;
    }

}

@supports (height: 100svh) {
    @media (max-width: 768px) {
        html[data-platform="web"] {
            --web-viewport-height: 100svh;
        }
    }
}

@media (max-width: 768px) {
    html[data-platform="web"] {
        --web-app-height: var(--web-viewport-height);
        --web-bottom-reserve: var(--web-mobile-bottom-reserve, 104px);
    }

    html[data-platform="web"] .web-app-topbar {
        flex: 0 0 auto;
    }

    html[data-platform="web"] .app-container {
        height: calc(var(--web-viewport-height) - var(--web-topbar-height));
        min-height: 0;
        overflow: hidden;
    }

    html[data-platform="web"] .main-content {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }
}

@media (max-width: 900px) {
    html[data-platform="web"] #web-message-controls-host {
        display: block;
        margin-bottom: 18px;
    }

    html[data-platform="web"] #view-messages {
        padding: 12px !important;
    }

    html[data-platform="web"] .web-message-controls-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[data-platform="web"] .main-content.home-mode {
        padding: 12px;
    }

    html[data-platform="web"] .home-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    html[data-platform="web"] .home-panel {
        border-radius: 12px;
        padding: 12px;
    }

    html[data-platform="web"] .home-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    html[data-platform="web"] .home-card {
        width: 100%;
        min-height: 68px;
        aspect-ratio: auto;
    }

    html[data-platform="web"] .home-panel-subtitle {
        white-space: normal;
    }

    html[data-platform="web"] .web-limit-notice {
        display: none;
    }

    html[data-platform="web"] .home-footer-credit {
        margin-top: 0;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    html[data-platform="web"] #view-media,
    html[data-platform="web"] .media-playback-page,
    html[data-platform="web"] #view-database,
    html[data-platform="web"] #view-login,
    html[data-platform="web"] #view-fetch,
    html[data-platform="web"] #view-video-library,
    html[data-platform="web"] #view-flip,
    html[data-platform="web"] #view-open-live,
    html[data-platform="web"] #view-profile,
    html[data-platform="web"] #view-photos,
    html[data-platform="web"] #view-melee-rank,
    html[data-platform="web"] #view-send-flip,
    html[data-platform="web"] #view-trip,
    html[data-platform="web"] #view-room-album,
    html[data-platform="web"] #view-member-dynamic,
    html[data-platform="web"] #view-settings,
    html[data-platform="web"] #view-pbc,
    html[data-platform="web"] #view-audio-programs,
    html[data-platform="web"] #view-music-library,
    html[data-platform="web"] #view-official-site-music,
    html[data-platform="web"] #view-private-messages,
    html[data-platform="web"] #view-followed-rooms {
        padding: 12px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        scrollbar-gutter: auto;
    }

    html[data-platform="web"] .list-container {
        width: 100%;
        max-width: none;
        box-sizing: border-box;
    }

    html[data-platform="web"] .home-shell,
    html[data-platform="web"] .home-view,
    html[data-platform="web"] .home-grid,
    html[data-platform="web"] .home-panel,
    html[data-platform="web"] .Box-row {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    html[data-platform="web"] .page-header {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px;
    }

    html[data-platform="web"] .page-title {
        font-size: 18px;
        white-space: normal;
    }

    html[data-platform="web"] .btn,
    html[data-platform="web"] .input-control {
        min-height: 40px;
        font-size: 14px;
    }

    html[data-platform="web"] input,
    html[data-platform="web"] textarea,
    html[data-platform="web"] select {
        max-width: 100%;
    }

    html[data-platform="web"] .Box-row > div[style*="display: flex"],
    html[data-platform="web"] .page-header > div,
    html[data-platform="web"] #panel-login div[style*="display: flex"],
    html[data-platform="web"] .private-message-detail-actions > div {
        flex-wrap: wrap;
    }

    html[data-platform="web"] #live-list-controls,
    html[data-platform="web"] #media-list-controls > div {
        gap: 10px !important;
    }

    html[data-platform="web"] #live-list-controls > div,
    html[data-platform="web"] #media-list-controls > div > div {
        min-width: min(100%, 160px) !important;
    }

    html[data-platform="web"] #vod-group-wrapper,
    html[data-platform="web"] #vod-type-wrapper,
    html[data-platform="web"] #live-group-wrapper,
    html[data-platform="web"] #live-type-wrapper,
    html[data-platform="web"] #followed-sort-wrapper {
        width: 100% !important;
    }

    html[data-platform="web"] #live-list-controls > div:has(input[type="text"]),
    html[data-platform="web"] #media-list-controls > div > div:has(#vod-member-filter) {
        flex-basis: 100% !important;
        min-width: 0 !important;
    }

    html[data-platform="web"] #live-list-controls button,
    html[data-platform="web"] #media-list-controls button {
        flex: 1 1 calc(50% - 5px);
        min-width: 120px;
    }

    html[data-platform="web"] #panel-login {
        padding: 14px !important;
    }

html[data-platform="web"] #login-forms-container {
    min-height: 0 !important;
}

    html[data-platform="web"] .official-site-music-player {
        align-items: center;
        text-align: center;
    }

    html[data-platform="web"] .official-site-music-disc {
        margin-left: auto;
        margin-right: auto;
    }

    html[data-platform="web"] .official-site-music-player-info {
        width: 100%;
        flex: none;
        align-items: center;
    }

    html[data-platform="web"] .official-site-music-subline {
        justify-content: center;
    }

    html[data-platform="web"] .live-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
        padding: 0;
    }

    html[data-platform="web"] .vod-card-row {
        align-items: flex-start;
        gap: 10px;
    }

    html[data-platform="web"] .vod-row-cover-container {
        width: 96px;
        height: 54px;
        margin-right: 0;
    }

    html[data-platform="web"] .vod-row-info {
        height: auto;
        min-height: 54px;
    }

    html[data-platform="web"] .vod-row-name,
    html[data-platform="web"] .vod-row-title,
    html[data-platform="web"] .vod-row-time {
        min-width: 0;
    }

    html[data-platform="web"] #live-player-view {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    html[data-platform="web"] #live-player-view > div:first-child {
        margin: 0 0 12px 0 !important;
        padding: 12px !important;
    }

    html[data-platform="web"] #player-split-layout {
        flex: 0 0 auto !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 0 0 12px 0 !important;
        gap: 12px !important;
    }

    html[data-platform="web"] #player-right-column {
        order: 1;
        width: 100%;
        height: auto !important;
        overflow: visible !important;
        padding-right: 0 !important;
    }

    html[data-platform="web"] #danmu-timeline-wrapper {
        order: 2;
        flex: 0 0 auto !important;
        width: 100%;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        --col-seq: 0px !important;
    }

    html[data-platform="web"] #danmu-timeline-wrapper > div:nth-child(2) > div:nth-child(2),
    html[data-platform="web"] #danmu-list-body .danmu-row > div:nth-child(2) {
        margin-left: 0 !important;
    }

    html[data-platform="web"] #player-combo-wrapper {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    html[data-platform="web"] #live-player-area {
        flex: 0 0 auto !important;
        width: 100% !important;
        height: min(68vh, 720px) !important;
        height: min(68svh, 720px) !important;
        max-height: none !important;
        min-height: 0 !important;
        aspect-ratio: auto !important;
        background: #000 !important;
    }

    html[data-platform="web"] #view-followed-rooms > div {
        flex-direction: column;
        height: auto !important;
        min-height: calc(var(--web-fixed-content-height) - 24px);
        overflow: hidden;
    }

    html[data-platform="web"] #view-followed-rooms > div > div:first-child {
        width: 100% !important;
        max-height: 42vh;
        border-right: none !important;
        border-bottom: 1px solid var(--border);
    }

    html[data-platform="web"] #view-followed-rooms > div > div:last-child {
        min-height: 420px;
    }

    html[data-platform="web"] #followed-chat-header {
        padding: 10px 12px !important;
        gap: 10px;
        flex-wrap: wrap;
    }

    html[data-platform="web"] #followed-chat-messages {
        padding: 12px !important;
    }

    html[data-platform="web"] .private-messages-shell {
        height: auto;
        min-height: calc(var(--web-fixed-content-height) - 24px);
        flex-direction: column;
    }

    html[data-platform="web"] .private-messages-sidebar {
        width: 100%;
        max-height: 42vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    html[data-platform="web"] .private-messages-sidebar-header {
        padding: 12px;
        flex-wrap: wrap;
    }

    html[data-platform="web"] .private-messages-panel {
        min-height: 420px;
    }

    html[data-platform="web"] .private-message-detail-body {
        padding: 12px;
    }

    html[data-platform="web"] .private-message-item {
        max-width: min(86%, 420px);
    }

    html[data-platform="web"] .private-message-detail-actions {
        padding: 10px 12px 12px;
    }

    html[data-platform="web"] .photo-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    html[data-platform="web"] #view-room-album .Box-row > div:first-child {
        flex-direction: column;
        gap: 10px !important;
    }

    html[data-platform="web"] #view-room-album .Box-row > div:first-child > div {
        width: 100%;
        flex: none !important;
    }

    html[data-platform="web"] .modal-content {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(var(--web-fixed-content-height) - 24px) !important;
    }
}

/* Keep compact desktop windows dense without falling back to the phone layout. */
@media (min-width: 701px) and (max-width: 960px) {
    html[data-platform="web"] .official-site-music-header {
        gap: 10px !important;
        margin-bottom: 10px !important;
    }

    html[data-platform="web"] .official-site-music-header-tools {
        display: grid !important;
        grid-template-columns: 116px minmax(190px, 1fr) !important;
        grid-template-areas:
            "toolbar toolbar"
            "grouping search";
        align-items: center !important;
        gap: 8px !important;
    }

    html[data-platform="web"] .official-site-music-toolbar {
        grid-area: toolbar;
        display: grid !important;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        max-width: 100%;
        gap: 6px !important;
        overflow: visible;
    }

    html[data-platform="web"] .official-site-music-filter {
        width: 100%;
        min-width: 0 !important;
        min-height: 38px !important;
        padding: 0 6px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }

    html[data-platform="web"] .official-site-music-grouping-filter {
        grid-area: grouping;
        width: 116px !important;
        min-width: 116px !important;
        height: 38px !important;
    }

    html[data-platform="web"] .official-site-music-search {
        grid-area: search;
        width: min(320px, 100%) !important;
        min-width: 0 !important;
        height: 38px !important;
    }

    html[data-platform="web"] .official-site-music-player-wrap {
        --official-site-music-queue-bottom: 96px;
        padding-top: 10px !important;
        padding-bottom: 12px !important;
    }

    html[data-platform="web"] .official-site-music-player {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        min-height: 82px !important;
        padding: 14px 18px 12px !important;
        gap: 14px !important;
        text-align: left !important;
    }

    html[data-platform="web"] .official-site-music-disc {
        flex: 0 0 48px !important;
        width: 48px !important;
        height: 48px !important;
        margin: 0 !important;
    }

    html[data-platform="web"] .official-site-music-player-info {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 150px !important;
        align-items: flex-start !important;
    }

    html[data-platform="web"] .official-site-music-subline {
        justify-content: flex-start !important;
    }

    html[data-platform="web"] .official-site-music-player-controls {
        flex: 0 0 auto !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end !important;
        width: auto !important;
        gap: 10px !important;
    }

    html[data-platform="web"] .official-site-music-center-controls {
        position: static !important;
        transform: none !important;
        width: auto !important;
        gap: 8px !important;
    }

    html[data-platform="web"] .official-site-music-right-controls {
        width: auto !important;
        margin-left: 0 !important;
        gap: 8px !important;
    }

    html[data-platform="web"] #official-site-music-player-queue {
        bottom: 96px !important;
    }

    html[data-platform="web"] .official-site-music-card > .official-site-music-group-cell {
        display: none !important;
    }
}

@media (min-width: 521px) and (max-width: 700px) {
    html[data-platform="web"] .official-site-music-header-tools {
        display: grid !important;
        grid-template-columns: 112px minmax(0, 1fr) !important;
        grid-template-areas:
            "toolbar toolbar"
            "grouping search";
        align-items: center !important;
        gap: 8px !important;
    }

    html[data-platform="web"] .official-site-music-toolbar {
        grid-area: toolbar;
        display: grid !important;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        max-width: 100%;
        gap: 7px !important;
        overflow: visible;
    }

    html[data-platform="web"] .official-site-music-filter {
        width: 100%;
        min-width: 0 !important;
        padding: 0 6px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }

    html[data-platform="web"] .official-site-music-grouping-filter {
        grid-area: grouping;
        width: 112px !important;
        min-width: 112px !important;
    }

    html[data-platform="web"] .official-site-music-search {
        grid-area: search;
        width: 100% !important;
        min-width: 0 !important;
    }

    html[data-platform="web"] .official-site-music-player {
        display: grid !important;
        grid-template-columns: 48px minmax(0, 1fr) !important;
        align-items: center !important;
        width: 100% !important;
        min-height: 126px !important;
        padding: 14px 14px 12px !important;
        gap: 10px 12px !important;
        text-align: left !important;
    }

    html[data-platform="web"] .official-site-music-disc {
        width: 48px !important;
        height: 48px !important;
        margin: 0 !important;
    }

    html[data-platform="web"] .official-site-music-player-info {
        width: auto !important;
        min-width: 0 !important;
        align-items: flex-start !important;
    }

    html[data-platform="web"] .official-site-music-subline {
        justify-content: flex-start !important;
    }

    html[data-platform="web"] .official-site-music-player-controls {
        grid-column: 1 / -1;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        width: 100% !important;
        gap: 8px !important;
    }

    html[data-platform="web"] .official-site-music-center-controls {
        position: static !important;
        transform: none !important;
        width: auto !important;
        gap: 8px !important;
    }

    html[data-platform="web"] .official-site-music-right-controls {
        width: auto !important;
        margin-left: 0 !important;
        gap: 8px !important;
    }

    html[data-platform="web"] .official-site-music-card > .official-site-music-group-cell {
        display: none !important;
    }
}

@media (max-width: 640px) {
    html[data-platform="web"] #view-flip {
        padding: 10px 10px calc(max(28px, env(safe-area-inset-bottom)) + var(--web-bottom-reserve, 0px)) !important;
        scroll-padding-block: 12px calc(20px + var(--web-bottom-reserve, 0px));
    }

    html[data-platform="web"] #view-flip .flip-toolbar-header {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
        margin-bottom: 12px;
        padding-bottom: 0;
        border-bottom: 0;
    }

    html[data-platform="web"] #view-flip .flip-toolbar-header .page-header-left {
        display: block;
        grid-column: 1 / 2;
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    html[data-platform="web"] #view-flip .flip-toolbar-header .page-title {
        display: none !important;
    }

    html[data-platform="web"] #view-flip #flip-status-text,
    html[data-platform="web"] #view-flip #flip-status-text .btn {
        display: block;
        width: 100%;
    }

    html[data-platform="web"] #view-flip .flip-toolbar-controls {
        display: contents;
    }

    html[data-platform="web"] #view-flip .flip-toolbar-field,
    html[data-platform="web"] #view-flip .flip-toolbar-field > .input-control,
    html[data-platform="web"] #view-flip .flip-toolbar-search,
    html[data-platform="web"] #view-flip .flip-toolbar-refresh {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    html[data-platform="web"] #view-flip .flip-date-trigger {
        width: 100%;
        gap: 7px;
    }

    html[data-platform="web"] #view-flip .flip-date-trigger::after {
        content: "日期";
        font-size: 14px;
    }

    html[data-platform="web"] #view-flip #flipSearchInput {
        grid-column: 1 / 2;
        font-size: 16px !important;
    }

    html[data-platform="web"] #view-flip .flip-toolbar-refresh {
        grid-column: 2 / 3;
    }

    html[data-platform="web"] #view-flip .flip-toolbar-field > .input-control {
        font-size: 16px !important;
    }

    html[data-platform="web"] #view-flip .flip-date-dropdown {
        position: fixed;
        top: max(calc(var(--web-topbar-height) + 8px), env(safe-area-inset-top));
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        max-height: calc(var(--web-viewport-height) - var(--web-topbar-height) - 20px);
        overflow-y: auto;
    }

    html[data-platform="web"] #view-flip .flip-history-card {
        padding: 14px !important;
        overflow: hidden;
    }

    html[data-platform="web"] #view-flip .flip-history-card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 9px;
    }

    html[data-platform="web"] #view-flip .flip-history-card-time {
        width: 100%;
        font-size: 15px !important;
        overflow-wrap: anywhere;
    }

    html[data-platform="web"] #view-flip .flip-history-card-tags {
        width: 100%;
        justify-content: flex-start !important;
        gap: 6px !important;
    }

    html[data-platform="web"] #view-flip .flip-history-card-tags > .btn-text-danger,
    html[data-platform="web"] #view-flip .flip-history-card-tags > .btn-text-gray {
        flex: 0 0 auto;
        margin-left: auto;
    }

    html[data-platform="web"] #view-flip .flip-history-card-divider {
        display: none;
    }

    html[data-platform="web"] #view-flip .flip-question-title,
    html[data-platform="web"] #view-flip .flip-answer-title {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    html[data-platform="web"] #view-flip .custom-audio-player {
        width: 100%;
        max-width: 100%;
    }

    html[data-platform="web"] #view-send-flip {
        padding: 10px 10px calc(max(28px, env(safe-area-inset-bottom)) + var(--web-bottom-reserve, 0px)) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        scroll-padding-block: 12px calc(20px + var(--web-bottom-reserve, 0px));
        scrollbar-gutter: auto !important;
    }

    html[data-platform="web"] .send-flip-page {
        width: 100%;
        max-width: none;
        margin: 0;
    }

    html[data-platform="web"] .send-flip-page .Box-row {
        padding: 14px !important;
        margin-bottom: 10px !important;
        border-radius: 12px;
    }

    html[data-platform="web"] #view-send-flip.send-flip-editor-active .send-flip-member-card,
    html[data-platform="web"] #view-send-flip.send-flip-editor-active .send-flip-config-card {
        display: none !important;
    }

    html[data-platform="web"] #view-send-flip.send-flip-editor-active .send-flip-question-card {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        border-color: color-mix(in srgb, var(--primary) 56%, var(--border));
    }

    html[data-platform="web"] #view-send-flip input:not([type="hidden"]),
    html[data-platform="web"] #view-send-flip textarea,
    html[data-platform="web"] #view-send-flip select {
        font-size: 16px !important;
    }

    html[data-platform="web"] .send-flip-config-card .flip-config-heading {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    html[data-platform="web"] .send-flip-config-card .flip-default-settings-button {
        width: auto;
        min-width: auto;
        height: 36px;
        flex: 0 0 auto;
        padding: 0 12px;
    }

    html[data-platform="web"] .flip-config-fields {
        flex-direction: column !important;
        gap: 14px !important;
    }

    html[data-platform="web"] .flip-config-field {
        width: 100%;
        min-width: 0;
        flex: 0 0 auto !important;
    }

    html[data-platform="web"] .flip-cost-summary {
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 10px;
        margin-top: 14px !important;
        padding-top: 12px !important;
    }

    html[data-platform="web"] .flip-balance-line,
    html[data-platform="web"] .flip-cost-line {
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
    }

    html[data-platform="web"] #flip-cost-input {
        width: 80px !important;
        min-width: 80px;
        height: 34px;
    }

    html[data-platform="web"] .send-flip-textarea {
        height: 132px !important;
        min-height: 132px;
        box-sizing: border-box;
        padding: 12px 12px 30px !important;
    }

    html[data-platform="web"] .send-flip-submit {
        margin-top: 14px !important;
    }
}

@media (max-width: 520px) {
    html[data-platform="web"] #view-messages {
        padding: 10px !important;
    }

    html[data-platform="web"] .web-message-page-header {
        display: block;
    }

    html[data-platform="web"] .web-message-page-header #statusMsg {
        max-width: none;
        margin-top: 8px;
        text-align: left;
    }

    html[data-platform="web"] .web-message-controls-grid {
        grid-template-columns: 1fr;
    }

    html[data-platform="web"] .main-content.home-mode {
        padding: 10px;
    }

    html[data-platform="web"] .home-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    html[data-platform="web"] .home-card {
        min-height: 64px;
        padding: 8px 6px;
    }

    html[data-platform="web"] .home-card-title {
        font-size: 13px;
    }

    html[data-platform="web"] #view-media,
    html[data-platform="web"] .media-playback-page,
    html[data-platform="web"] #view-database,
    html[data-platform="web"] #view-login,
    html[data-platform="web"] #view-fetch,
    html[data-platform="web"] #view-video-library,
    html[data-platform="web"] #view-flip,
    html[data-platform="web"] #view-open-live,
    html[data-platform="web"] #view-profile,
    html[data-platform="web"] #view-photos,
    html[data-platform="web"] #view-melee-rank,
    html[data-platform="web"] #view-send-flip,
    html[data-platform="web"] #view-trip,
    html[data-platform="web"] #view-room-album,
    html[data-platform="web"] #view-member-dynamic,
    html[data-platform="web"] #view-settings,
    html[data-platform="web"] #view-pbc,
    html[data-platform="web"] #view-audio-programs,
    html[data-platform="web"] #view-music-library,
    html[data-platform="web"] #view-official-site-music,
    html[data-platform="web"] #view-private-messages,
    html[data-platform="web"] #view-followed-rooms {
        padding: 10px !important;
    }

    html[data-platform="web"] .Box-row {
        padding: 12px;
    }

    html[data-platform="web"] .official-site-music-table-head,
    html[data-platform="web"] .official-site-music-card {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.75fr) 58px;
        gap: 6px;
    }

    html[data-platform="web"] .official-site-music-table-head {
        padding: 0 10px;
    }

    html[data-platform="web"] .official-site-music-card {
        padding: 9px 10px;
    }

    html[data-platform="web"] .official-site-music-table-head .official-site-music-sort:nth-child(1),
    html[data-platform="web"] .official-site-music-table-head .official-site-music-sort:nth-child(4),
    html[data-platform="web"] .official-site-music-table-head .official-site-music-sort:nth-child(5),
    html[data-platform="web"] .official-site-music-card > .official-site-music-row-index,
    html[data-platform="web"] .official-site-music-card > .official-site-music-grouping-cell,
    html[data-platform="web"] .official-site-music-card > .official-site-music-date-cell {
        display: none !important;
    }

    html[data-platform="web"] .official-site-music-table-head .official-site-music-sort:nth-child(3),
    html[data-platform="web"] .official-site-music-table-head .official-site-music-sort:nth-child(6) {
        display: inline-flex !important;
    }

    html[data-platform="web"] .official-site-music-card > .official-site-music-album-cell,
    html[data-platform="web"] .official-site-music-card > .official-site-music-group-cell {
        display: block !important;
    }

    html[data-platform="web"] #view-official-site-music {
        gap: 8px !important;
        padding: 8px !important;
    }

    html[data-platform="web"] .official-site-music-header {
        gap: 8px !important;
        margin-bottom: 8px !important;
    }

    html[data-platform="web"] .official-site-music-header-tools {
        display: grid !important;
        grid-template-columns: 112px minmax(0, 1fr) !important;
        grid-template-areas:
            "grouping search"
            "toolbar toolbar";
        align-items: center !important;
        gap: 8px !important;
    }

    html[data-platform="web"] .official-site-music-toolbar {
        grid-area: toolbar;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        max-width: 100%;
        gap: 7px !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    html[data-platform="web"] .official-site-music-toolbar::-webkit-scrollbar {
        display: none;
    }

    html[data-platform="web"] .official-site-music-filter {
        flex: 0 0 auto !important;
        min-width: max-content !important;
        min-height: 38px !important;
        padding: 0 12px !important;
        font-size: 13px !important;
    }

    html[data-platform="web"] .official-site-music-grouping-filter {
        grid-area: grouping;
        min-width: 112px !important;
        width: 112px !important;
        height: 38px !important;
    }

    html[data-platform="web"] .official-site-music-grouping-trigger {
        border-color: rgba(148, 163, 184, 0.24) !important;
        background: rgba(18, 24, 34, 0.46) !important;
        color: color-mix(in srgb, var(--text-sub) 90%, var(--text)) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        backdrop-filter: blur(10px) !important;
    }

    html[data-platform="web"] .official-site-music-grouping-trigger:hover,
    html[data-platform="web"] .official-site-music-grouping-filter.is-open .official-site-music-grouping-trigger {
        border-color: color-mix(in srgb, var(--primary) 54%, rgba(148, 163, 184, 0.24)) !important;
        background: rgba(22, 30, 43, 0.68) !important;
        color: var(--primary) !important;
    }

    html[data-platform="web"] .official-site-music-grouping-menu {
        border-color: rgba(148, 163, 184, 0.24) !important;
        background: rgba(18, 24, 34, 0.9) !important;
    }

    html[data-platform="web"][data-theme="light"] .official-site-music-grouping-trigger {
        border-color: rgba(171, 182, 196, 0.78) !important;
        background: rgba(255, 255, 255, 0.76) !important;
        color: var(--text-sub) !important;
        box-shadow: 0 8px 18px rgba(60, 82, 116, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.84) !important;
    }

    html[data-platform="web"][data-theme="light"] .official-site-music-grouping-trigger:hover,
    html[data-platform="web"][data-theme="light"] .official-site-music-grouping-filter.is-open .official-site-music-grouping-trigger {
        border-color: color-mix(in srgb, var(--primary) 46%, rgba(171, 182, 196, 0.78)) !important;
        background: rgba(255, 255, 255, 0.94) !important;
        color: var(--primary) !important;
    }

    html[data-platform="web"][data-theme="light"] .official-site-music-grouping-menu {
        border-color: rgba(171, 182, 196, 0.76) !important;
        background: rgba(255, 255, 255, 0.92) !important;
        box-shadow: 0 18px 44px rgba(60, 82, 116, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    }

    html[data-platform="web"] .official-site-music-search {
        grid-area: search;
        min-width: 0 !important;
        width: 100% !important;
        height: 38px !important;
        border-radius: 8px !important;
        border: 1px solid rgba(148, 163, 184, 0.24) !important;
        background: rgba(18, 24, 34, 0.46) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        backdrop-filter: blur(10px) !important;
        overflow: hidden !important;
        transform: none !important;
    }

    html[data-platform="web"] .official-site-music-search:hover {
        transform: none !important;
        border-color: color-mix(in srgb, var(--primary) 28%, rgba(148, 163, 184, 0.24)) !important;
        background: rgba(20, 28, 40, 0.56) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    }

    html[data-platform="web"] .official-site-music-search:focus-within {
        border-color: color-mix(in srgb, var(--primary) 54%, rgba(148, 163, 184, 0.24)) !important;
        background: rgba(22, 30, 43, 0.68) !important;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    }

    html[data-platform="web"] .official-site-music-search::after {
        display: none !important;
    }

    html[data-platform="web"] .official-site-music-search .media-search-icon {
        left: 13px !important;
        width: 16px !important;
        height: 16px !important;
        color: color-mix(in srgb, var(--text-sub) 82%, var(--text)) !important;
        transform: translateY(-50%) !important;
    }

    html[data-platform="web"] .official-site-music-search:focus-within .media-search-icon {
        color: var(--primary) !important;
        transform: translateY(-50%) !important;
    }

    html[data-platform="web"] .official-site-music-search .input-control {
        min-height: 38px !important;
        height: 38px !important;
        padding: 0 14px 0 38px !important;
        color: var(--text) !important;
        font-size: 13px !important;
        font-weight: 650 !important;
        letter-spacing: 0 !important;
    }

    html[data-platform="web"] .official-site-music-search .input-control::placeholder {
        color: color-mix(in srgb, var(--text-sub) 78%, transparent) !important;
    }

    html[data-platform="web"][data-theme="light"] .official-site-music-search {
        border-color: rgba(171, 182, 196, 0.78) !important;
        background: rgba(255, 255, 255, 0.76) !important;
        box-shadow: 0 8px 18px rgba(60, 82, 116, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.84) !important;
    }

    html[data-platform="web"][data-theme="light"] .official-site-music-search:hover {
        border-color: color-mix(in srgb, var(--primary) 32%, rgba(171, 182, 196, 0.78)) !important;
        background: rgba(255, 255, 255, 0.92) !important;
    }

    html[data-platform="web"][data-theme="light"] .official-site-music-search:focus-within {
        background: rgba(255, 255, 255, 0.96) !important;
    }

    html[data-platform="web"] .official-site-music-table-head {
        min-height: 38px !important;
    }

    html[data-platform="web"] .official-site-music-card {
        min-height: 56px !important;
        padding-top: 7px !important;
        padding-bottom: 7px !important;
    }

    html[data-platform="web"] .official-site-music-index {
        width: 38px !important;
        height: 38px !important;
    }

    html[data-platform="web"] .official-site-music-grid {
        padding-bottom: 8px !important;
    }

    html[data-platform="web"] .official-site-music-player-wrap {
        --official-site-music-queue-bottom: 94px;
        padding-top: 8px !important;
        padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
    }

    html[data-platform="web"] .official-site-music-player {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        width: 100% !important;
        min-height: 78px !important;
        padding: 14px 12px 12px !important;
        border-radius: 14px !important;
        text-align: left !important;
    }

    html[data-platform="web"] .official-site-music-disc {
        flex: 0 0 44px !important;
        width: 44px !important;
        height: 44px !important;
        margin: 0 !important;
    }

    html[data-platform="web"] .official-site-music-player-info {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        align-items: flex-start !important;
    }

    html[data-platform="web"] .official-site-music-subline {
        justify-content: flex-start !important;
    }

    html[data-platform="web"] .official-site-music-player-controls {
        flex: 0 0 auto !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end !important;
        width: auto !important;
        gap: 6px !important;
    }

    html[data-platform="web"] .official-site-music-center-controls {
        position: static !important;
        transform: none !important;
        width: auto !important;
        gap: 0 !important;
    }

    html[data-platform="web"] .official-site-music-center-controls .player-step-btn,
    html[data-platform="web"] #official-site-music-favorite-btn,
    html[data-platform="web"] #official-site-music-playlist-btn,
    html[data-platform="web"] .official-site-music-volume {
        display: none !important;
    }

    html[data-platform="web"] .official-site-music-right-controls {
        display: flex !important;
        width: auto !important;
        margin-left: 0 !important;
        gap: 6px !important;
    }

    html[data-platform="web"] .official-site-music-right-controls .player-mini-btn {
        width: 34px !important;
        height: 34px !important;
    }

    html[data-platform="web"] #official-site-music-player-queue {
        bottom: 94px !important;
        max-height: min(420px, calc(var(--web-fixed-content-height) - 130px)) !important;
    }

    html[data-platform="web"] .Box-row > div[style*="display: flex"] > *,
    html[data-platform="web"] .page-header > div > *,
    html[data-platform="web"] #panel-login div[style*="display: flex"] > * {
        min-width: 0;
    }

    html[data-platform="web"] #live-list-controls > div,
    html[data-platform="web"] #media-list-controls > div > div {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    html[data-platform="web"] #live-list-controls button,
    html[data-platform="web"] #media-list-controls button {
        flex: 1 1 100%;
        width: 100%;
    }

    html[data-platform="web"] .live-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    html[data-platform="web"] .vod-card-row {
        padding: 10px;
        flex-direction: column;
    }

    html[data-platform="web"] .vod-row-cover-container {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    html[data-platform="web"] .vod-row-info {
        width: 100%;
    }

    html[data-platform="web"] .vod-row-name {
        font-size: 13px;
        gap: 6px;
    }

    html[data-platform="web"] .vod-row-title {
        font-size: 12px;
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    html[data-platform="web"] .vod-row-time {
        font-size: 11px;
        flex-wrap: wrap;
    }

    html[data-platform="web"] #live-player-area {
        min-height: 0 !important;
    }

    html[data-platform="web"] #danmu-timeline-wrapper {
        flex: 0 0 auto !important;
        height: auto !important;
        min-height: 0 !important;
    }

    html[data-platform="web"] #danmu-timeline-wrapper > div:first-child {
        flex-wrap: wrap;
    }

    html[data-platform="web"] #danmu-search-input {
        flex-basis: 100%;
        margin-left: 0 !important;
    }

    html[data-platform="web"] .private-message-detail-actions > div:last-child {
        flex-direction: column;
    }

    html[data-platform="web"] #btn-send-private-message {
        width: 100% !important;
        height: 42px !important;
    }

    html[data-platform="web"] .photo-card-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 380px) {
    html[data-platform="web"] .main-content.home-mode {
        padding: 8px;
    }

    html[data-platform="web"] .home-panel {
        padding: 10px;
    }

    html[data-platform="web"] .home-card-grid,
    html[data-platform="web"] .live-card-grid,
    html[data-platform="web"] .photo-card-grid {
        grid-template-columns: 1fr;
    }

    html[data-platform="web"] .home-card {
        min-height: 58px;
    }

    html[data-platform="web"] .web-limit-notice {
        padding: 12px 10px max(12px, env(safe-area-inset-bottom));
        font-size: 12px;
    }

    html[data-platform="web"] #view-media,
    html[data-platform="web"] .media-playback-page,
    html[data-platform="web"] #view-database,
    html[data-platform="web"] #view-login,
    html[data-platform="web"] #view-fetch,
    html[data-platform="web"] #view-video-library,
    html[data-platform="web"] #view-flip,
    html[data-platform="web"] #view-open-live,
    html[data-platform="web"] #view-profile,
    html[data-platform="web"] #view-photos,
    html[data-platform="web"] #view-trip,
    html[data-platform="web"] #view-room-album,
    html[data-platform="web"] #view-member-dynamic,
    html[data-platform="web"] #view-settings,
    html[data-platform="web"] #view-pbc,
    html[data-platform="web"] #view-audio-programs,
    html[data-platform="web"] #view-music-library,
    html[data-platform="web"] #view-official-site-music,
    html[data-platform="web"] #view-private-messages,
    html[data-platform="web"] #view-followed-rooms {
        padding: 8px !important;
    }

    html[data-platform="web"] .Box-row {
        padding: 10px;
    }

    html[data-platform="web"] .private-message-item {
        max-width: 92%;
    }

    html[data-platform="web"] #view-private-messages {
        height: auto !important;
        min-height: var(--web-fixed-content-height) !important;
        overflow: hidden !important;
    }

    html[data-platform="web"] #view-private-messages .private-messages-shell {
        height: var(--web-secondary-shell-height, calc(var(--web-fixed-content-height) - 16px));
        max-height: var(--web-secondary-shell-height, calc(var(--web-fixed-content-height) - 16px));
        min-height: 0;
        border-radius: 10px;
        flex-direction: column;
    }

    html[data-platform="web"] #view-private-messages .private-messages-sidebar {
        width: 100%;
        max-height: none;
        flex: 1 1 auto;
        min-height: 0;
        border-right: none;
        border-bottom: none;
        overflow: hidden;
    }

    html[data-platform="web"] #view-private-messages:not(.is-detail-open) .private-messages-panel {
        display: none;
    }

    html[data-platform="web"] #view-private-messages.is-detail-open .private-messages-sidebar {
        display: none;
    }

    html[data-platform="web"] #view-private-messages.is-detail-open .private-messages-panel {
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
    }

    html[data-platform="web"] #view-private-messages .private-messages-sidebar-header {
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
    }

    html[data-platform="web"] #view-private-messages .private-messages-sidebar-header > div:first-child {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px !important;
        width: 100%;
    }

    html[data-platform="web"] #view-private-messages .private-messages-toolbar-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    html[data-platform="web"] #view-private-messages .private-messages-toolbar-actions .btn {
        width: 100%;
        height: 38px;
        font-size: 13px;
    }

    html[data-platform="web"] #view-private-messages .private-message-list {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        padding: 8px 0 calc(8px + var(--web-bottom-reserve));
        scroll-padding-bottom: var(--web-bottom-reserve);
    }

    html[data-platform="web"] #view-private-messages .private-message-list::after {
        content: "";
        display: block;
        flex: 0 0 var(--web-bottom-reserve);
        min-height: var(--web-bottom-reserve);
    }

    html[data-platform="web"] #view-private-messages .private-message-list-item {
        padding: 12px;
        gap: 12px;
    }

    html[data-platform="web"] #view-private-messages .private-messages-panel-header {
        min-height: 58px;
        padding: 9px 12px;
    }

    html[data-platform="web"] #view-private-messages .private-message-mobile-back {
        height: 34px;
        padding: 0 10px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--input-bg);
        color: var(--primary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        font-size: 13px;
        font-weight: 800;
    }

    html[data-platform="web"] #view-private-messages .private-message-detail-body {
        padding: 12px;
        gap: 12px;
    }

    html[data-platform="web"] #view-private-messages .private-message-item {
        max-width: 88%;
    }

    html[data-platform="web"] #view-private-messages .private-message-bubble {
        padding: 7px 11px 8px;
        line-height: 1.38;
        font-size: 14px;
    }

    html[data-platform="web"] #view-private-messages .private-message-detail-actions {
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom) + var(--web-bottom-reserve));
    }

    html[data-platform="web"] #view-private-messages .private-message-detail-actions > div:last-child {
        gap: 8px !important;
        margin-bottom: 0 !important;
    }

    html[data-platform="web"] #private-message-reply-input {
        height: 56px !important;
        min-height: 56px;
        padding: 8px 10px 22px !important;
    }

    html[data-platform="web"] #btn-send-private-message {
        width: 68px !important;
        height: 56px !important;
    }

    html[data-platform="web"] #private-message-new-messages {
        bottom: 82px !important;
    }

    html[data-platform="web"] #view-followed-rooms {
        height: auto !important;
        min-height: var(--web-fixed-content-height) !important;
        overflow: hidden !important;
    }

    html[data-platform="web"] #view-followed-rooms > div {
        height: var(--web-secondary-shell-height, calc(var(--web-fixed-content-height) - 16px)) !important;
        max-height: var(--web-secondary-shell-height, calc(var(--web-fixed-content-height) - 16px)) !important;
        min-height: 0 !important;
        border-radius: 10px !important;
        flex-direction: column !important;
    }

    html[data-platform="web"] #view-followed-rooms > div > div:first-child {
        width: 100% !important;
        max-height: none !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        border-right: none !important;
        border-bottom: none !important;
        overflow: hidden !important;
    }

    html[data-platform="web"] #view-followed-rooms:not(.is-chat-open) > div > div:last-child {
        display: none !important;
    }

    html[data-platform="web"] #view-followed-rooms.is-chat-open > div > div:first-child {
        display: none !important;
    }

    html[data-platform="web"] #view-followed-rooms.is-chat-open > div > div:last-child {
        display: flex !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }

    html[data-platform="web"] #view-followed-rooms > div > div:first-child > div:first-child {
        padding: 12px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    html[data-platform="web"] #view-followed-rooms > div > div:first-child > div:first-child > div {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px !important;
    }

    html[data-platform="web"] #followed-sort-wrapper {
        width: 100% !important;
    }

    html[data-platform="web"] #followed-rooms-container {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        padding: 8px 0 calc(8px + var(--web-bottom-reserve)) !important;
        scroll-padding-bottom: var(--web-bottom-reserve);
    }

    html[data-platform="web"] #followed-rooms-container::after {
        content: "";
        display: block;
        min-height: var(--web-bottom-reserve);
    }

    html[data-platform="web"] #view-followed-rooms .session-card {
        margin: 2px 8px 6px !important;
        padding: 12px !important;
    }

    html[data-platform="web"] #view-followed-rooms > div > div:first-child > div:last-child {
        padding: 10px !important;
    }

    html[data-platform="web"] #followed-chat-header {
        min-height: 58px;
        padding: 9px 12px !important;
        gap: 8px !important;
        flex-wrap: nowrap !important;
    }

    html[data-platform="web"] #followed-chat-header > div:first-child {
        margin-right: 0 !important;
        gap: 10px !important;
    }

    html[data-platform="web"] .followed-chat-mobile-back {
        height: 34px;
        padding: 0 10px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--input-bg);
        color: var(--primary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        font-size: 13px;
        font-weight: 800;
    }

    html[data-platform="web"] #followed-chat-avatar {
        width: 36px !important;
        height: 36px !important;
    }

    html[data-platform="web"] #followed-chat-header > div:last-child {
        gap: 6px !important;
    }

    html[data-platform="web"] #btn-toggle-room-type {
        height: 30px !important;
        padding: 0 8px !important;
    }

    html[data-platform="web"] #btn-toggle-followed-mode {
        width: 72px !important;
        height: 30px !important;
    }

    html[data-platform="web"] #followed-chat-messages {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        padding: 12px 12px calc(12px + var(--web-bottom-reserve)) !important;
        scroll-padding-bottom: var(--web-bottom-reserve);
    }

    html[data-platform="web"] #followed-chat-messages::after {
        content: "";
        display: block;
        flex: 0 0 var(--web-bottom-reserve);
        min-height: var(--web-bottom-reserve);
    }

    html[data-platform="web"] #live-player-area {
        min-height: 170px !important;
    }

    html[data-platform="web"] #live-player-view,
    html[data-platform="web"] #player-split-layout,
    html[data-platform="web"] #player-right-column,
    html[data-platform="web"] #player-combo-wrapper,
    html[data-platform="web"] #danmu-timeline-wrapper,
    html[data-platform="web"] .media-clip-toolbar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    html[data-platform="web"] #live-player-view {
        min-height: 0 !important;
        gap: 12px !important;
    }

    html[data-platform="web"] #live-player-view > div:first-child {
        margin: 10px 0 2px !important;
        padding: 12px !important;
        border-radius: 10px !important;
    }

    html[data-platform="web"] #live-player-view > div:first-child > div:first-child {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center !important;
        gap: 12px !important;
    }

    html[data-platform="web"] #live-player-view > div:first-child > div:first-child > div:first-child {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 14px 18px !important;
        min-width: 0 !important;
    }

    html[data-platform="web"] #current-live-author,
    html[data-platform="web"] #current-live-title,
    html[data-platform="web"] #current-live-date,
    html[data-platform="web"] #current-live-time {
        display: block !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    html[data-platform="web"] #player-split-layout {
        flex: none !important;
        height: auto !important;
        overflow: visible !important;
    }

    html[data-platform="web"] #player-right-column {
        margin: 0 !important;
        padding: 0 !important;
    }

    html[data-platform="web"] #player-combo-wrapper {
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 8px !important;
    }

    html[data-platform="web"] #live-player-area {
        width: 100% !important;
        height: min(68vh, 720px) !important;
        height: min(68svh, 720px) !important;
        max-height: none !important;
        min-height: 0 !important;
        aspect-ratio: auto !important;
        background: #000 !important;
    }

    html[data-platform="web"] .media-clip-toolbar {
        padding: 12px !important;
        border-radius: 10px !important;
    }

    html[data-platform="web"] .media-clip-toolbar > div {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    html[data-platform="web"] .media-clip-toolbar > div > div:first-child {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px !important;
    }

    html[data-platform="web"] .media-clip-toolbar [data-clip-role="start-display"],
    html[data-platform="web"] .media-clip-toolbar [data-clip-role="end-display"] {
        min-width: 0 !important;
        padding: 0 8px !important;
        font-size: 13px !important;
    }

    html[data-platform="web"] .media-clip-toolbar > div > div:last-child {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
    }

    html[data-platform="web"] .media-clip-toolbar [data-clip-role="duration-display"] {
        width: auto !important;
        text-align: left !important;
        white-space: nowrap !important;
    }

    html[data-platform="web"] .media-clip-toolbar [data-clip-role="do-clip"] {
        width: 132px !important;
        max-width: 45% !important;
    }

    html[data-platform="web"] #danmu-timeline-wrapper {
        flex: 0 0 auto !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        --col-seq: 0px !important;
        --col-time: 112px !important;
        --col-name: 90px !important;
        --col-act: 72px !important;
    }

    html[data-platform="web"] #danmu-timeline-wrapper > div:nth-child(2) > div:nth-child(2),
    html[data-platform="web"] #danmu-list-body .danmu-row > div:nth-child(2) {
        margin-left: 0 !important;
    }

    html[data-platform="web"] #danmu-list-body {
        flex: 0 1 auto !important;
        height: auto !important;
        max-height: min(42dvh, 420px) !important;
        overflow-y: auto !important;
    }
}
html[data-platform="web"] #window-close-settings-card {
    display: none !important;
}

/* Keep room routes on an internal scroll container across common phone widths.
   The broader tablet rule uses height:auto, which otherwise lets the message
   list expand with its contents between 381px and 768px and repeatedly trips
   the "load older messages" threshold at scrollTop 0. */
@media (max-width: 768px) {
    html[data-platform="web"] #live-announcement-bar {
        padding: 5px 12px !important;
    }

    html[data-platform="web"] #view-followed-rooms > div > div:first-child > div:first-child {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
    }

    html[data-platform="web"] #view-followed-rooms > div > div:first-child > div:first-child > div {
        display: flex !important;
        width: min(220px, calc(100% - 72px)) !important;
        margin-left: auto;
    }

    html[data-platform="web"] #followed-sort-wrapper {
        width: 100% !important;
    }

    html[data-platform="web"] .official-site-music-song-cell {
        overflow: hidden;
    }

    html[data-platform="web"] .official-site-music-index {
        flex: 0 0 auto;
    }

    html[data-platform="web"] .official-site-music-card-body {
        flex: 1 1 auto;
        width: 0;
        min-width: 0;
    }

    html[data-platform="web"] .official-site-music-title {
        display: block;
        max-width: 100%;
    }

    html[data-platform="web"] #view-followed-rooms {
        height: auto !important;
        min-height: var(--web-fixed-content-height) !important;
        padding: 8px !important;
        overflow: hidden !important;
    }

    html[data-platform="web"] #view-followed-rooms > div {
        height: var(--web-secondary-shell-height, calc(var(--web-fixed-content-height) - 16px)) !important;
        max-height: var(--web-secondary-shell-height, calc(var(--web-fixed-content-height) - 16px)) !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    html[data-platform="web"] #view-followed-rooms.is-chat-open > div > div:last-child {
        display: flex !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    html[data-platform="web"] #followed-chat-header {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "identity icons"
            "modes modes";
        align-items: center !important;
        gap: 8px 10px !important;
        min-height: 0;
        padding: 9px 12px 10px !important;
    }

    html[data-platform="web"] #followed-chat-header > div:first-child {
        grid-area: identity;
        min-width: 0;
        margin-right: 0 !important;
        gap: 8px !important;
    }

    html[data-platform="web"] .followed-chat-header-actions {
        display: contents !important;
    }

    html[data-platform="web"] .followed-chat-icon-actions {
        grid-area: icons;
        display: flex !important;
        align-items: center;
        gap: 2px !important;
    }

    html[data-platform="web"] .followed-chat-mode-actions {
        grid-area: modes;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px !important;
        width: 100%;
    }

    html[data-platform="web"] .followed-chat-mobile-back {
        width: 36px;
        min-width: 36px;
        padding: 0 !important;
        overflow: hidden;
        color: transparent !important;
        font-size: 0 !important;
    }

    html[data-platform="web"] .followed-chat-mobile-back::before {
        content: "‹";
        color: var(--primary);
        font-size: 24px;
        line-height: 1;
    }

    html[data-platform="web"] .followed-chat-icon-actions .followed-notification-toggle {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    html[data-platform="web"] .followed-chat-mode-actions > .btn,
    html[data-platform="web"] #btn-toggle-room-type,
    html[data-platform="web"] #btn-toggle-followed-mode {
        width: 100% !important;
        height: 38px !important;
        padding: 0 12px !important;
        border-radius: 9px !important;
    }

    html[data-platform="web"] #followed-chat-subtitle {
        font-size: 0 !important;
        white-space: nowrap;
    }

    html[data-platform="web"] #followed-chat-subtitle::before {
        content: "#" attr(data-channel-id);
        color: var(--text-sub);
        font-size: 11px;
    }

    html[data-platform="web"] #followed-chat-messages {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        padding: 12px 12px calc(12px + var(--web-bottom-reserve)) !important;
        scroll-padding-bottom: var(--web-bottom-reserve);
    }

    html[data-platform="web"] #followed-chat-messages::after {
        content: "";
        display: block;
        min-height: var(--web-bottom-reserve);
    }

    html[data-platform="web"] #view-private-messages .private-message-detail-actions > div:last-child {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 56px;
        gap: 8px !important;
        align-items: stretch !important;
    }

    html[data-platform="web"] #view-private-messages .private-message-reply-wrap {
        grid-column: 1;
        grid-row: 1;
    }

    html[data-platform="web"] #btn-send-private-message-image {
        grid-column: 2;
        grid-row: 1;
        width: 56px !important;
        height: 56px !important;
    }

    html[data-platform="web"] #btn-send-private-message {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100% !important;
        height: 42px !important;
    }
}
html.web-i18n-pending body {
    visibility: hidden;
}
