/**
 * Hardware acceleration hint — compact panel beside nav island.
 */

.kinma-hw-accel-blur {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99990;
    pointer-events: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(0, 0, 0, 0.06);
}

.kinma-hw-accel-blur.active {
    display: block;
}

body.dark-mode .kinma-hw-accel-blur {
    background: rgba(0, 0, 0, 0.22);
}

body.kinma-hw-accel-popup-open .left-nav-cluster {
    z-index: 99992;
}

/* Popup panel */
.kinma-hw-accel-popup {
    display: none;
    position: fixed;
    left: calc(24px + 3.75em + 12px);
    bottom: 24px;
    z-index: 99991;
    width: min(340px, calc(100vw - 24px - 3.75em - 48px));
    pointer-events: auto;
}

.kinma-hw-accel-popup.active {
    display: block;
}

.kinma-hw-accel-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--gallery-island-surface, #ffffff);
    border: var(--gallery-island-border, 1px solid rgba(0, 0, 0, 0.06));
    border-radius: 16px;
    box-shadow: var(
        --gallery-island-shadow,
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.05)
    );
}

.kinma-hw-accel-card-header {
    display: grid;
    grid-template-columns: 40px 1fr 28px;
    align-items: center;
    gap: 10px;
}

.kinma-hw-accel-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #c62828;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kinma-hw-accel-warn-icon {
    display: block;
    flex-shrink: 0;
}

.kinma-hw-accel-card-icon .kinma-hw-accel-warn-icon {
    width: 22px;
    height: 22px;
}

.left-nav-cluster .kinma-hw-accel-nav-btn.nav-item svg.kinma-hw-accel-warn-icon,
.kinma-hw-accel-card-icon svg.kinma-hw-accel-warn-icon {
    stroke: none !important;
    stroke-width: 0 !important;
}

.left-nav-cluster .kinma-hw-accel-warn-icon rect,
.left-nav-cluster .kinma-hw-accel-warn-icon circle,
.kinma-hw-accel-card-icon .kinma-hw-accel-warn-icon rect,
.kinma-hw-accel-card-icon .kinma-hw-accel-warn-icon circle {
    fill: #ffffff !important;
}

.kinma-hw-accel-card-header h2 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
}

.kinma-hw-accel-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #737373;
    cursor: pointer;
    padding: 0;
    justify-self: end;
}

.kinma-hw-accel-close:hover,
.kinma-hw-accel-close:focus-visible {
    background: rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
}

.kinma-hw-accel-card-text {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #525252;
}

.kinma-hw-accel-guide {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kinma-hw-accel-url-row {
    display: flex;
    gap: 8px;
}

.kinma-hw-accel-url-row[hidden] {
    display: none !important;
}

.kinma-hw-accel-url-input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 8px 10px;
    font: 0.75rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: rgba(0, 0, 0, 0.03);
    color: #1a1a1a;
}

.kinma-hw-accel-copy-btn {
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: #ffffff;
    color: #1a1a1a;
}

.kinma-hw-accel-copy-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.kinma-hw-accel-steps {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #525252;
}

.kinma-hw-accel-steps li + li {
    margin-top: 6px;
}

.kinma-hw-accel-toggle-hint {
    margin: 0;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.75rem;
    line-height: 1.4;
    color: #1a1a1a;
}

.kinma-hw-accel-toggle-hint[hidden] {
    display: none !important;
}

.kinma-hw-accel-external-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.kinma-hw-accel-external-link[hidden] {
    display: none !important;
}

.kinma-hw-accel-card-status {
    margin: -4px 0 0;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #737373;
}

.kinma-hw-accel-card-status.is-ok {
    color: #15803d;
}

.kinma-hw-accel-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    font-family: inherit;
    cursor: pointer;
    background: #1a1a1a;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
}

.kinma-hw-accel-btn:hover {
    background: #333333;
}

.kinma-hw-accel-btn:focus-visible {
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
}

body.dark-mode .kinma-hw-accel-card {
    background: var(--gallery-island-surface, #1a1a1a);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(
        --gallery-island-shadow,
        0 8px 32px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.08)
    );
}

body.dark-mode .kinma-hw-accel-card-header h2 {
    color: #fafafa;
}

body.dark-mode .kinma-hw-accel-card-text,
body.dark-mode .kinma-hw-accel-card-status,
body.dark-mode .kinma-hw-accel-steps {
    color: #a3a3a3;
}

body.dark-mode .kinma-hw-accel-url-input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fafafa;
}

body.dark-mode .kinma-hw-accel-copy-btn {
    background: #252525;
    border-color: rgba(255, 255, 255, 0.14);
    color: #fafafa;
}

body.dark-mode .kinma-hw-accel-copy-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .kinma-hw-accel-toggle-hint,
body.dark-mode .kinma-hw-accel-external-link {
    color: #fafafa;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .kinma-hw-accel-card-status.is-ok {
    color: #4ade80;
}

body.dark-mode .kinma-hw-accel-close {
    color: #a3a3a3;
}

body.dark-mode .kinma-hw-accel-close:hover,
body.dark-mode .kinma-hw-accel-close:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #fafafa;
}

body.dark-mode .kinma-hw-accel-btn {
    background: #fafafa;
    color: #1a1a1a;
}

body.dark-mode .kinma-hw-accel-btn:hover {
    background: #e5e5e5;
}

body.dark-mode .kinma-hw-accel-btn:focus-visible {
    outline-color: #fafafa;
}

/* Nav: red circle with white ! */
.left-nav-cluster .kinma-hw-accel-nav-island {
    flex-shrink: 0;
    width: 3.75em;
    height: 3.75em;
    min-width: 3.75em;
    max-width: 3.75em;
    min-height: 3.75em;
    padding: 0 !important;
    box-sizing: border-box;
    border-radius: 50% !important;
    background: #c62828 !important;
    border: var(--gallery-island-border, 1px solid rgba(0, 0, 0, 0.06)) !important;
    box-shadow: var(
        --gallery-island-shadow,
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.05)
    ) !important;
    pointer-events: auto;
    overflow: visible;
    gap: 0 !important;
}

.left-nav-cluster .kinma-hw-accel-nav-island:not([hidden]) {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.left-nav-cluster .kinma-hw-accel-nav-island[hidden] {
    display: none !important;
}

.left-nav-cluster .kinma-hw-accel-nav-island .nav-item-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.left-nav-cluster .kinma-hw-accel-nav-btn.nav-item {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    background: transparent !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
}

.left-nav-cluster .kinma-hw-accel-nav-btn.nav-item:hover,
.left-nav-cluster .kinma-hw-accel-nav-btn.nav-item:focus-visible,
.left-nav-cluster .kinma-hw-accel-nav-btn.nav-item.active,
.left-nav-cluster .kinma-hw-accel-nav-btn.nav-item.active:hover {
    background: rgba(0, 0, 0, 0.12) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.left-nav-cluster .kinma-hw-accel-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.35em;
    height: 2.35em;
    flex-shrink: 0;
}

.left-nav-cluster .kinma-hw-accel-nav-btn.nav-item svg.kinma-hw-accel-warn-icon,
.left-nav-cluster .kinma-hw-accel-nav-icon .kinma-hw-accel-warn-icon {
    display: block;
    width: 2.35em !important;
    height: 2.35em !important;
    max-width: none !important;
    max-height: none !important;
}

body.dark-mode .left-nav-cluster .kinma-hw-accel-nav-island {
    background: #c62828 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: var(
        --gallery-island-shadow,
        0 8px 32px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.08)
    ) !important;
}

@media (min-width: 1025px) {
    .left-nav-cluster .kinma-hw-accel-nav-btn .nav-label {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .kinma-hw-accel-blur,
    .kinma-hw-accel-popup,
    .kinma-hw-accel-nav-island {
        display: none !important;
    }
}
