/* Shared public/Forge-preview card. All paint stays local; no global tokens. */
.gka-card {
    --gka-surface: var(--clr-bg-raised);
    --gka-border: var(--clr-border-strong);
    --gka-text: var(--clr-text-primary);
    --gka-body: var(--clr-text-secondary);
    --gka-muted: var(--clr-text-muted);
    --gka-hover: var(--clr-bg-hover);
    --gka-highlight: var(--clr-brand-hover);
    --gka-action: var(--clr-brand-dark);
    --gka-action-hover: var(--clr-brand-fill-hover);
    --gka-on-action: var(--clr-on-brand, #F5F4F1);
    --gka-focus: var(--clr-focus-control, var(--focus-ring-color));
    box-sizing: border-box;
    width: min(500px, calc(100vw - 32px));
    max-width: 100%;
    padding: 0;
    border: 1px solid var(--gka-border);
    border-radius: 14px;
    background: var(--gka-surface);
    color: var(--gka-text);
    box-shadow: 0 16px 36px rgb(0 0 0 / 24%), 0 32px 80px rgb(0 0 0 / 30%);
    font-family: var(--font-body);
    font-size: 16px;
    text-align: left;
}
/* Forge retains its own root palette. Mirror only the native public roles here
   so this shared card never becomes a purple Forge panel in editing previews. */
.geekly-dashboard-body .gka-card {
    --gka-surface: var(--create-shared-tile, #242529);
    --gka-border: #5D5F68;
    --gka-text: var(--create-shared-strong, #F5F4F1);
    --gka-body: var(--create-shared-label, #D1D1D5);
    --gka-muted: #B7B8BF;
    --gka-hover: var(--create-shared-hover, #2A2B30);
    --gka-highlight: #F46B75;
    --gka-action: #C9303C;
    --gka-action-hover: #B52634;
    --gka-focus: var(--create-shared-focus, #A3A4AE);
}
:root[data-theme="light"] .geekly-dashboard-body .gka-card {
    --gka-surface: var(--create-shared-menu, #FFFFFF);
    --gka-border: #B5B4B1;
    --gka-muted: #62626B;
    --gka-highlight: #B52634;
}
:root[data-theme="light"] .gka-card,
.gka-card[data-theme="light"],
[data-theme="light"] .gka-card {
    --gka-surface: var(--clr-bg-elevated);
    /* Keep the approved red fill in both themes, not the light text-hover red. */
    --gka-action: #C9303C;
    --gka-action-hover: #B52634;
}
.gka-dialog.gka-card {
    max-width: none;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    overflow: auto;
    overscroll-behavior: contain;
}
.gka-dialog::backdrop { background: rgb(0 0 0 / 62%); }
html.gka-scroll-locked { overflow: hidden; }
.gka-card .gka-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 20px 20px 0 28px;
}
.gka-card .gka-brand { min-width: 0; }
.gka-card .gka-logo {
    display: block;
    width: 146px;
    max-width: 100%;
    min-width: 0;
    height: 40px;
    object-fit: contain;
}
.gka-card .gka-logo--light { display: none; }
:root[data-theme="light"] .gka-card .gka-logo--dark,
[data-theme="light"] .gka-card .gka-logo--dark,
.gka-card[data-theme="light"] .gka-logo--dark { display: none; }
:root[data-theme="light"] .gka-card .gka-logo--light,
[data-theme="light"] .gka-card .gka-logo--light,
.gka-card[data-theme="light"] .gka-logo--light { display: block; }
.gka-card button {
    box-sizing: border-box;
    margin: 0;
    font-family: inherit;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}
.gka-card .gka-close {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--gka-muted);
}
.gka-card .gka-close:hover,
.gka-card .gka-browse:hover { background: var(--gka-hover); color: var(--gka-text); }
.gka-card .gka-body { padding: 24px 32px 0; }
.gka-card .gka-heading {
    margin: 0;
    color: var(--gka-text);
    font-family: var(--font-display);
    font-size: clamp(40px, 5vw, 54px);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.025em;
    text-transform: none;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}
.gka-card .gka-highlight { color: var(--gka-highlight); }
.gka-card .gka-message {
    margin-top: var(--space-6);
    color: var(--gka-body);
    font-size: 16px;
    line-height: 1.65;
    overflow-wrap: anywhere;
    white-space: pre-line;
    text-wrap: pretty;
}
.gka-card .gka-message p { margin: 0; font: inherit; color: inherit; }
.gka-card .gka-message p + p { margin-top: 10px; }
.gka-card .gka-footer { display: grid; gap: var(--space-2); padding: 28px 32px 24px; }
.gka-card .gka-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--gka-action);
    color: var(--gka-on-action);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.gka-card .gka-primary > svg { flex-shrink: 0; }
.gka-card .gka-primary:hover:not(:disabled) { background: var(--gka-action-hover); }
.gka-card .gka-primary:disabled { cursor: not-allowed; opacity: 0.65; }
.gka-card .gka-browse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--gka-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}
.gka-card button:focus-visible { outline: 2px solid var(--gka-focus); outline-offset: -4px; }
.gka-card .gka-primary:focus-visible { outline-color: var(--gka-on-action); }
/* Static title receives initial reading focus, not a control-style ring. */
.gka-card .gka-heading[tabindex="-1"]:focus { outline: none; }
@media (prefers-reduced-motion: no-preference) {
    .gka-card button { transition: background-color 140ms ease-out, color 140ms ease-out; }
}
@media (max-width: 767px) {
    .gka-card .gka-header { padding: 16px 12px 0 20px; gap: var(--space-2); }
    .gka-card .gka-logo { width: 128px; }
    .gka-card .gka-body { padding: 22px 24px 0; }
    .gka-card .gka-heading { font-size: 44px; }
    .gka-card .gka-message { font-size: 15px; margin-top: var(--space-5); }
    .gka-card .gka-footer { padding: 24px 24px 16px; }
}
@media (max-width: 374px) {
    .gka-card .gka-logo { width: 116px; }
    .gka-card .gka-heading { font-size: 40px; }
    .gka-card .gka-body, .gka-card .gka-footer { padding-left: 20px; padding-right: 20px; }
}
@media (forced-colors: active) {
    .gka-card, .gka-card button { border-color: ButtonText; }
    .gka-card button:focus-visible { outline-color: Highlight; }
    .gka-card .gka-highlight { color: CanvasText; text-decoration: underline; }
}
