.kg-tools-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000500;
    width: min(360px, calc(100vw - 18px));
    height: 100dvh;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 14px calc(16px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    transform: translateX(104%);
    transition: transform 0.24s ease;
    border-left: 1px solid rgba(73, 96, 125, 0.78);
    background: linear-gradient(180deg, rgba(31, 45, 63, 0.98), rgba(13, 22, 35, 0.98));
    color: #fff;
    box-shadow: -24px 0 70px rgba(0, 0, 0, 0.42);
}

.kg-tools-panel.is-open {
    transform: translateX(0);
}

.kg-tools-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kg-tools-panel__head h3 {
    margin: 0;
    font-size: 1.25rem;
}

.kg-tools-panel__close,
.kg-share-modal__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #343c63;
    color: #fff;
    font-size: 1.35rem;
}

.kg-tools-panel__body {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.kg-tool-card {
    display: grid;
    gap: 6px;
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(111, 139, 174, 0.34);
    border-radius: 18px;
    background: rgba(12, 21, 34, 0.68);
    color: #fff;
    text-align: left;
}

.kg-tool-card span {
    font-size: 1rem;
    font-weight: 900;
}

.kg-tool-card small {
    color: rgba(220, 231, 247, 0.72);
}

.kg-tool-card:disabled {
    cursor: wait;
    opacity: 0.78;
}

.kg-tool-card.is-pending {
    border-color: rgba(142, 85, 255, 0.78);
    background: linear-gradient(135deg, rgba(87, 49, 160, 0.72), rgba(33, 47, 76, 0.94));
    box-shadow: 0 0 0 1px rgba(185, 140, 255, 0.16), 0 12px 30px rgba(36, 18, 73, 0.28);
}

.kg-tools-open-btn {
    position: fixed;
    right: 0;
    top: calc(50% + 62px);
    z-index: 100450;
    width: 42px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(73, 96, 125, 0.9);
    border-right: 0;
    border-radius: 16px 0 0 16px;
    background: rgba(52, 60, 99, 0.92);
    color: #fff;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
    transform: translateY(-50%);
    transition: transform 0.18s ease, background 0.18s ease;
}

.kg-tools-open-btn:hover {
    background: rgba(70, 82, 132, 0.96);
    transform: translateY(-50%) translateX(-3px);
}

.kg-tools-panel-open .kg-tools-open-btn {
    transform: translateY(-50%) translateX(100%);
    pointer-events: none;
}

.kg-share-modal {
    position: fixed;
    inset: 0;
    z-index: 1004000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(5, 8, 14, 0.66);
}

.kg-share-modal.hidden {
    display: none;
}

.kg-share-intro.hidden,
.kg-share-actions.hidden {
    display: none;
}

.kg-share-modal__sheet {
    width: min(480px, 100%);
    max-height: min(760px, calc(100dvh - 36px));
    overflow: auto;
    padding: 18px;
    border: 1px solid rgba(73, 96, 125, 0.9);
    border-radius: 22px;
    background: rgba(22, 32, 46, 0.98);
    color: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.kg-share-modal__sheet::-webkit-scrollbar {
    width: 7px;
}

.kg-share-modal__sheet::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(139, 116, 255, 0.7);
}

.kg-share-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.kg-share-modal__head h3 {
    margin: 0;
    font-size: 1.2rem;
}

.kg-share-modal__body {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.kg-share-intro {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(12, 21, 34, 0.72);
}

.kg-share-intro span,
.kg-share-result p,
.kg-share-status {
    color: rgba(220, 231, 247, 0.76);
}

.kg-share-actions {
    display: grid;
    gap: 10px;
}

.kg-share-actions button,
.kg-share-send-self-btn,
.kg-share-stop-btn {
    display: grid;
    gap: 5px;
    width: 100%;
    padding: 13px;
    border: 0;
    border-radius: 16px;
    background: #343c63;
    color: #fff;
    text-align: left;
    min-width: 0;
    box-sizing: border-box;
}

.kg-share-actions button b,
.kg-share-actions button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kg-share-actions button span {
    color: rgba(220, 231, 247, 0.72);
    white-space: nowrap;
}

.kg-share-url-text {
    display: block;
    max-width: 100%;
}

.kg-share-send-self-btn {
    text-align: center;
    background: linear-gradient(135deg, #343c63, #46528a);
    font-weight: 900;
}

.kg-share-status {
    padding: 12px;
    border-radius: 16px;
    background: rgba(12, 21, 34, 0.72);
}

.kg-share-status--error {
    color: #ffd3d3;
    background: rgba(92, 34, 48, 0.68);
}

.kg-share-result {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border-radius: 18px;
    background: rgba(12, 21, 34, 0.72);
}

.kg-share-result__badge {
    width: max-content;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 10px;
    border: 1px solid rgba(118, 226, 155, 0.36);
    border-radius: 999px;
    background: rgba(65, 194, 112, 0.12);
    color: #a9ffc3;
    font-weight: 900;
}

.kg-share-link {
    overflow: hidden;
    padding: 12px;
    border: 1px solid rgba(111, 139, 174, 0.34);
    border-radius: 14px;
    background: rgba(52, 60, 99, 0.72);
    color: #fff;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kg-share-alt-links {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: rgba(220, 231, 247, 0.68);
    font-size: 0.82rem;
}

.kg-share-alt-links span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kg-screen-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    min-width: 0;
}

.kg-screen-actions .kg-share-send-self-btn,
.kg-screen-actions .kg-share-stop-btn,
.kg-screen-actions .kg-screen-download-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    text-align: center;
    text-decoration: none;
}

.kg-screen-actions .kg-screen-action {
    min-height: 54px;
    gap: 9px;
    border: 1px solid transparent;
    transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease;
}

.kg-screen-actions .kg-screen-action:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.kg-screen-action i {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    font-style: normal;
    font-size: 1rem;
}

.kg-screen-action > span {
    color: #fff;
}

.kg-screen-actions .kg-screen-action--copy {
    background: linear-gradient(135deg, #33445f, #465a78);
    border-color: rgba(157, 184, 221, 0.3);
}

.kg-screen-actions .kg-screen-action--send {
    background: linear-gradient(135deg, #28527a, #3477a8);
    border-color: rgba(93, 190, 255, 0.34);
}

.kg-screen-actions .kg-screen-action--control {
    background: linear-gradient(135deg, #55348a, #7448b8);
    border-color: rgba(190, 137, 255, 0.36);
}

.kg-screen-actions .kg-screen-action--stop {
    background: linear-gradient(135deg, #672d3d, #8d3d50);
    border-color: rgba(255, 126, 151, 0.35);
}

.kg-bond-panel {
    display: grid;
    gap: 10px;
}

.kg-bond-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(111, 139, 174, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.kg-bond-top b,
.kg-bond-top span,
.kg-bond-top strong {
    display: block;
    min-width: 0;
}

.kg-bond-top b {
    color: #fff;
    font-size: 1.08rem;
}

.kg-bond-top span {
    margin-top: 3px;
    color: rgba(220, 231, 247, 0.68);
    font-size: 0.84rem;
}

.kg-bond-top strong {
    min-width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    line-height: 42px;
    text-align: center;
}

.kg-bond-top.is-good {
    border-color: rgba(118, 226, 155, 0.46);
    background: rgba(65, 194, 112, 0.13);
}

.kg-bond-top.is-wait {
    border-color: rgba(245, 183, 96, 0.42);
    background: rgba(245, 183, 96, 0.12);
}

.kg-bond-top.is-bad {
    border-color: rgba(255, 126, 151, 0.45);
    background: rgba(141, 61, 80, 0.16);
}

.kg-bond-status {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid rgba(111, 139, 174, 0.24);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.32);
}

.kg-bond-status b,
.kg-bond-status span,
.kg-bond-status small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.kg-bond-status b {
    color: #fff;
    font-size: 0.96rem;
}

.kg-bond-status span {
    color: rgba(220, 231, 247, 0.78);
    font-size: 0.86rem;
    line-height: 1.35;
}

.kg-bond-status small {
    color: rgba(220, 231, 247, 0.58);
    font-size: 0.76rem;
    line-height: 1.35;
}

.kg-bond-status.is-good {
    border-color: rgba(118, 226, 155, 0.32);
    background: rgba(65, 194, 112, 0.1);
}

.kg-bond-status.is-wait {
    border-color: rgba(245, 183, 96, 0.34);
    background: rgba(245, 183, 96, 0.1);
}

.kg-bond-status.is-bad {
    border-color: rgba(255, 126, 151, 0.36);
    background: rgba(141, 61, 80, 0.13);
}

.kg-bond-mini {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.kg-bond-mini span {
    min-width: 0;
    padding: 8px 10px;
    overflow: hidden;
    border: 1px solid rgba(111, 139, 174, 0.2);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.28);
    color: rgba(220, 231, 247, 0.78);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kg-bond-segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
    border: 1px solid rgba(111, 139, 174, 0.22);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.34);
}

.kg-bond-segmented button {
    min-width: 0;
    padding: 9px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(220, 231, 247, 0.72);
    font-weight: 800;
    cursor: pointer;
}

.kg-bond-segmented button.is-active {
    background: rgba(96, 165, 250, 0.22);
    color: #fff;
}

.kg-bond-segmented button:disabled {
    cursor: default;
    opacity: 0.75;
}

.kg-bond-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.kg-bond-stats span {
    min-width: 0;
    padding: 10px;
    overflow: hidden;
    border: 1px solid rgba(111, 139, 174, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(220, 231, 247, 0.86);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kg-bond-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(111, 139, 174, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(220, 231, 247, 0.92);
    font-weight: 800;
}

.kg-bond-option input {
    width: 18px;
    height: 18px;
    accent-color: #60a5fa;
}

.kg-bond-option input:disabled {
    opacity: 0.55;
}

.kg-bond-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.kg-bond-metrics span {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(111, 139, 174, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.kg-bond-metrics b,
.kg-bond-metrics small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kg-bond-metrics b {
    color: #fff;
    font-size: 1rem;
}

.kg-bond-metrics small {
    margin-top: 3px;
    color: rgba(220, 231, 247, 0.58);
    font-size: 0.72rem;
}

.kg-bond-lines {
    display: grid;
    gap: 8px;
}

.kg-bond-line {
    display: grid;
    grid-template-columns: 10px minmax(80px, 0.8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(111, 139, 174, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.kg-bond-line i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.7);
}

.kg-bond-line.is-active i {
    background: #76e29b;
    box-shadow: 0 0 0 4px rgba(118, 226, 155, 0.12);
}

.kg-bond-line.is-wait i {
    background: #f5b760;
    box-shadow: 0 0 0 4px rgba(245, 183, 96, 0.12);
}

.kg-bond-line.is-bad i {
    background: #ff7e97;
    box-shadow: 0 0 0 4px rgba(255, 126, 151, 0.12);
}

.kg-bond-line b,
.kg-bond-line span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kg-bond-line b {
    color: #fff;
}

.kg-bond-line span {
    color: rgba(220, 231, 247, 0.68);
    text-align: right;
}

@media (max-width: 560px) {
    .kg-bond-mini,
    .kg-bond-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kg-bond-line {
        grid-template-columns: 10px minmax(0, 1fr);
    }

    .kg-bond-line span {
        grid-column: 2;
        text-align: left;
    }
}

.kg-bond-peers {
    display: grid;
    gap: 8px;
}

.kg-bond-peer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(111, 139, 174, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.kg-bond-peer.is-connected {
    border-color: rgba(118, 226, 155, 0.44);
    background: rgba(65, 194, 112, 0.12);
}

.kg-bond-peer b,
.kg-bond-peer span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kg-bond-peer span {
    color: rgba(220, 231, 247, 0.7);
    font-size: 0.78rem;
}

.kg-screen-profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
}

.kg-screen-profile {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(111, 139, 174, 0.34);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    text-align: left;
}

.kg-screen-profile.is-active {
    border-color: rgba(118, 226, 155, 0.62);
    background: rgba(65, 194, 112, 0.16);
}

.kg-screen-profile b,
.kg-screen-profile span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kg-screen-profile b {
    font-size: 0.92rem;
}

.kg-screen-profile span {
    color: rgba(220, 231, 247, 0.68);
    font-size: 0.78rem;
}

.kg-endoscope-preview {
    display: grid;
    width: 100%;
    min-height: 220px;
    max-height: min(58vh, 620px);
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(111, 139, 174, 0.28);
    border-radius: 16px;
    background: #020409;
    aspect-ratio: 4 / 3;
}

.kg-endoscope-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #020409;
}

.kg-share-files {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.kg-share-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.kg-share-file strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kg-share-file span {
    flex: 0 0 auto;
    color: rgba(220, 231, 247, 0.68);
    font-size: 0.82rem;
}

.kg-share-nearby-actions {
    margin-top: 2px;
}

.kg-share-nearby-list,
.kg-share-transfer-list {
    display: grid;
    gap: 9px;
    min-width: 0;
}

.kg-share-nearby-device {
    display: grid;
    gap: 4px;
    width: 100%;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(118, 226, 155, 0.28);
    border-radius: 15px;
    background: rgba(42, 68, 58, 0.45);
    color: #fff;
    text-align: left;
}

.kg-share-nearby-device b,
.kg-share-nearby-device span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kg-share-nearby-device span {
    color: rgba(220, 231, 247, 0.72);
}

.kg-share-transfer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
    min-width: 0;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
}

.kg-share-transfer span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kg-share-transfer small {
    color: rgba(220, 231, 247, 0.72);
}

.kg-share-transfer__bar {
    grid-column: 1 / -1;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.kg-share-transfer__bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #76e29b, #7aa8ff);
    transition: width 0.18s ease;
}

.kg-speed-modal__sheet {
    width: min(520px, 100%);
}

.kg-speed-hero {
    position: relative;
    display: grid;
    gap: 5px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(118, 226, 155, 0.26);
    border-radius: 20px;
    background:
        radial-gradient(circle at 20% 15%, var(--kg-speed-glow, transparent), transparent 34%),
        linear-gradient(135deg, var(--kg-speed-from, rgba(24, 34, 49, 0.92)), var(--kg-speed-to, rgba(13, 22, 35, 0.92)));
    transition: border-color 0.25s ease, background 0.25s ease;
}

.kg-speed-hero[data-tone="idle"] {
    --kg-speed-glow: transparent;
    --kg-speed-from: rgba(24, 34, 49, 0.86);
    --kg-speed-to: rgba(13, 22, 35, 0.92);
    border-color: rgba(111, 139, 174, 0.24);
}

.kg-speed-hero[data-tone="critical"] {
    --kg-speed-glow: rgba(255, 78, 105, 0.3);
    --kg-speed-from: rgba(74, 31, 45, 0.94);
    --kg-speed-to: rgba(23, 18, 28, 0.94);
    border-color: rgba(255, 112, 133, 0.36);
}

.kg-speed-hero[data-tone="weak"] {
    --kg-speed-glow: rgba(255, 168, 79, 0.28);
    --kg-speed-from: rgba(76, 50, 28, 0.94);
    --kg-speed-to: rgba(23, 22, 30, 0.94);
    border-color: rgba(255, 184, 93, 0.38);
}

.kg-speed-hero[data-tone="normal"] {
    --kg-speed-glow: rgba(255, 216, 91, 0.24);
    --kg-speed-from: rgba(70, 65, 32, 0.94);
    --kg-speed-to: rgba(22, 28, 35, 0.94);
    border-color: rgba(255, 221, 101, 0.34);
}

.kg-speed-hero[data-tone="good"] {
    --kg-speed-glow: rgba(118, 226, 155, 0.26);
    --kg-speed-from: rgba(32, 57, 72, 0.92);
    --kg-speed-to: rgba(13, 22, 35, 0.92);
    border-color: rgba(118, 226, 155, 0.36);
}

.kg-speed-hero[data-tone="great"] {
    --kg-speed-glow: rgba(112, 177, 255, 0.3);
    --kg-speed-from: rgba(34, 61, 96, 0.94);
    --kg-speed-to: rgba(12, 28, 48, 0.94);
    border-color: rgba(126, 184, 255, 0.4);
}

.kg-speed-hero__label {
    color: rgba(220, 231, 247, 0.68);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.kg-speed-hero strong {
    font-size: clamp(2rem, 8vw, 3.4rem);
    line-height: 1;
}

.kg-speed-hero small {
    color: rgba(220, 231, 247, 0.76);
}

.kg-speed-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.kg-speed-grid div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(111, 139, 174, 0.28);
    border-radius: 16px;
    background: rgba(12, 21, 34, 0.68);
}

.kg-speed-grid span {
    color: rgba(220, 231, 247, 0.62);
    font-size: 0.78rem;
}

.kg-speed-grid b {
    overflow: hidden;
    color: #fff;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kg-speed-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.kg-speed-progress i {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #76e29b, #79a9ff);
    transition: width 0.22s ease;
}

.kg-speed-result {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-height: 46px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(12, 21, 34, 0.62);
    color: rgba(220, 231, 247, 0.74);
}

.kg-speed-result span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kg-speed-result b {
    color: #fff;
}

.kg-speed-result small {
    grid-column: 1 / -1;
    color: rgba(220, 231, 247, 0.56);
}

.kg-speed-start-btn {
    width: 100%;
    padding: 13px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #343c63, #46528a);
    color: #fff;
    font-weight: 900;
}

.kg-speed-start-btn:disabled {
    opacity: 0.7;
}

.kg-pc-screen-viewer {
    z-index: 2147483600;
    position: fixed;
    inset: 0;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    background: rgba(2, 5, 12, 0.94);
}

.kg-pc-screen-viewer__stage {
    display: flex;
    flex-direction: column;
    width: min(100vw, 1280px);
    height: 100dvh;
    margin: 0 auto;
    overflow: hidden;
    background: #02050c;
}

.kg-pc-screen-viewer__bar {
    display: flex;
    flex: 0 0 50px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    border-bottom: 1px solid rgba(115, 143, 178, 0.28);
    background: rgba(16, 25, 39, 0.94);
    color: #fff;
}

.kg-pc-screen-viewer__bar button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #343c63, #46528a);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 900;
}

.kg-pc-screen-viewer__bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kg-pc-screen-viewer__stage img {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    object-fit: contain;
    background: #000;
}

.kg-pc-screen-viewer__video {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    object-fit: contain;
    background: #000;
}

.kg-pc-screen-viewer__stage:fullscreen,
.kg-pc-screen-viewer__video:fullscreen {
    width: 100vw;
    height: 100vh;
    background: #000;
}

.kg-pc-screen-viewer__status {
    position: fixed;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    max-width: min(92vw, 520px);
    transform: translateX(-50%);
    padding: 10px 14px;
    border: 1px solid rgba(115, 143, 178, 0.32);
    border-radius: 999px;
    background: rgba(16, 25, 39, 0.78);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 800;
    text-align: center;
    transition: opacity 0.2s ease;
}

.kg-pc-screen-viewer__status.is-hidden {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 1000px) {
    .kg-tools-open-btn {
        display: none;
    }

    .kg-share-modal {
        align-items: end;
        padding: 10px;
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    .kg-share-modal__sheet {
        max-height: calc(100dvh - 110px);
        border-radius: 22px;
    }

    .kg-speed-result {
        grid-template-columns: 1fr;
    }
}
