/* The HighK portal release polish: accessible actions, help center, and tour. */

.dashboard-card-link {
    color: inherit;
    display: block;
    height: 100%;
    text-decoration: none;
}

.dashboard-card-link .dashboard-card {
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dashboard-card-link:hover .dashboard-card,
.dashboard-card-link:focus-visible .dashboard-card {
    border-color: var(--hk-green, #2f9e5b);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
    transform: translateY(-2px);
}

.dashboard-card-link:focus-visible {
    border-radius: 1rem;
    outline: 3px solid #f0c94c;
    outline-offset: 3px;
}

.dashboard-card-action {
    align-items: center;
    display: flex;
    font-size: 0.82rem;
    font-weight: 700;
    gap: 0.35rem;
    margin-top: 1rem;
}

.activity-compact-list {
    border-top: 1px solid var(--bs-border-color);
}

.activity-compact-row {
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0;
}

.activity-compact-row > summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    list-style: none;
    padding: 0.9rem 0;
}

.activity-compact-row > summary::-webkit-details-marker {
    display: none;
}

.activity-compact-row > summary span:first-child {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.activity-compact-row > summary small {
    color: var(--bs-secondary-color);
    overflow-wrap: anywhere;
}

.activity-compact-time {
    color: var(--bs-secondary-color);
    flex: 0 0 auto;
    font-size: 0.82rem;
    text-align: right;
}

.activity-compact-details {
    padding: 0 0 1rem;
}

.activity-compact-details p {
    margin-bottom: 0.5rem;
}

.buddie-tip {
    background: rgba(240, 201, 76, 0.16);
    border-left: 4px solid #f0c94c;
    border-radius: 0.45rem;
    color: inherit;
    font-size: 0.86rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
}

.buddie-tip strong {
    display: block;
    margin-bottom: 0.25rem;
}

.help-action-grid {
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.support-request-form {
    margin-top: 1.25rem;
}

.field-error {
    color: #b42318;
    font-size: 0.86rem;
    font-weight: 700;
    margin-top: 0.35rem;
}

.help-library {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    margin-top: 1.5rem;
    padding: clamp(1rem, 2vw, 1.5rem);
}

.help-search-label {
    display: grid;
    font-size: 0.82rem;
    font-weight: 700;
    gap: 0.35rem;
    min-width: min(100%, 280px);
}

.sop-list {
    display: grid;
    gap: 0.75rem;
}

.sop-card {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
}

.sop-card summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    list-style: none;
    padding: 1rem;
}

.sop-card summary::-webkit-details-marker {
    display: none;
}

.sop-card summary span {
    display: grid;
    gap: 0.2rem;
}

.sop-card summary small {
    color: var(--bs-secondary-color);
}

.sop-card[open] summary i {
    transform: rotate(180deg);
}

.sop-card ol,
.sop-card ul {
    margin: 0;
    padding: 0 2.25rem 1.25rem 3rem;
}

.sop-card li + li {
    margin-top: 0.55rem;
}

.portal-tour-dialog {
    background: transparent;
    border: 0;
    max-height: 92vh;
    max-width: min(92vw, 720px);
    padding: 0;
    width: 100%;
}

.portal-tour-dialog::backdrop {
    background: rgba(0, 12, 7, 0.78);
    backdrop-filter: blur(3px);
}

.portal-tour-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    color: var(--bs-body-color);
    max-height: 92vh;
    overflow: auto;
    padding: clamp(1.25rem, 3vw, 2rem);
    position: relative;
}

.portal-tour-close {
    align-items: center;
    background: transparent;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.55rem;
    color: inherit;
    display: flex;
    height: 2.35rem;
    justify-content: center;
    position: absolute;
    right: 1rem;
    top: 1rem;
    width: 2.35rem;
}

.portal-tour-intro {
    color: var(--bs-secondary-color);
    max-width: 58ch;
}

.portal-tour-step {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.8rem;
    display: none;
    margin-top: 1.25rem;
    min-height: 170px;
    padding: 1.25rem;
}

.portal-tour-step.active {
    display: block;
}

.portal-tour-step-number {
    align-items: center;
    background: #f0c94c;
    border-radius: 50%;
    color: #15241a;
    display: flex;
    font-weight: 800;
    height: 2rem;
    justify-content: center;
    margin-bottom: 0.8rem;
    width: 2rem;
}

.portal-tour-controls {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: auto 1fr auto;
    margin-top: 1rem;
}

.portal-tour-progress {
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
    text-align: center;
}

.portal-tour-skip {
    background: transparent;
    border: 0;
    color: inherit;
    margin-top: 0.75rem;
    padding: 0;
    text-decoration: underline;
}

.tour-highlight {
    box-shadow: 0 0 0 3px #f0c94c;
    position: relative;
    z-index: 3;
}

.product-totals {
    align-items: center;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(260px, 1fr) repeat(2, minmax(180px, auto));
    margin-top: 1.25rem;
    padding: 1.25rem;
}

.product-totals h3,
.product-totals p {
    margin-bottom: 0.25rem;
}

.product-total-metric {
    border-left: 1px solid var(--bs-border-color);
    display: grid;
    gap: 0.25rem;
    padding-left: 1.25rem;
}

.product-total-metric span {
    color: var(--bs-secondary-color);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.product-total-metric strong {
    font-size: 1.25rem;
}

.portal-secondary-action {
    border-color: currentColor;
    color: var(--bs-body-color);
}

.portal-secondary-action:hover,
.portal-secondary-action:focus-visible {
    background: var(--bs-body-color);
    border-color: var(--bs-body-color);
    color: var(--bs-body-bg);
}

/* Make warnings readable in both appearance modes. */
.alert-warning,
[data-theme="dark"] .alert-warning {
    background: #f7df85 !important;
    border-color: #d2a912 !important;
    color: #182319 !important;
}

.alert-warning a,
.alert-warning strong,
[data-theme="dark"] .alert-warning a,
[data-theme="dark"] .alert-warning strong {
    color: #182319 !important;
}

[data-theme="dark"] .btn-outline-dark {
    border-color: #b9c9bd;
    color: #e8f0e9;
}

[data-theme="dark"] .btn-outline-dark:hover,
[data-theme="dark"] .btn-outline-dark:focus-visible {
    background: #d9e6dc;
    border-color: #d9e6dc;
    color: #132019;
}

.btn:disabled,
.btn.disabled,
fieldset:disabled .btn {
    opacity: 0.62;
}

[data-theme="dark"] .btn:disabled,
[data-theme="dark"] .btn.disabled,
[data-theme="dark"] fieldset:disabled .btn {
    border-color: #738478;
    color: #aebbb1;
}

@media (max-width: 900px) {
    .help-action-grid {
        grid-template-columns: 1fr;
    }

    .activity-compact-row > summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .activity-compact-time {
        text-align: left;
    }

    .product-totals {
        grid-template-columns: 1fr;
    }

    .product-total-metric {
        border-left: 0;
        border-top: 1px solid var(--bs-border-color);
        padding-left: 0;
        padding-top: 1rem;
    }
}
