/*
    The package's styles, linked by each component through PodStyles, so a host adds nothing to its <head>.
    Every rule targets a pod- class, and the tokens are custom properties a host can override on .pod if it needs to.
*/

/* Shared by every component: the themes' tokens and the common controls. */

.pod { font-family: inherit; line-height: 1.45; }
.pod, .pod *, .pod *::before, .pod *::after { box-sizing: border-box; }

.pod-internal {
    --pod-accent: var(--rz-primary, #1151f3);
    --pod-on-accent: var(--rz-on-primary, #ffffff);
    --pod-text: var(--rz-text-color, #4f4f50);
    --pod-muted: var(--rz-text-secondary-color, #707072);
    --pod-surface: var(--rz-panel-background-color, #ffffff);
    --pod-raised: var(--rz-dialog-background-color, #ffffff);
    --pod-subtle: var(--rz-base-100, #f4f5f9);
    --pod-code: var(--rz-base-200, #e9eaed);
    --pod-border: var(--rz-base-300, #e0e1e4);
    --pod-neutral: var(--rz-base-200, #e9eaed);
    --pod-neutral-hover: var(--rz-base-300, #e0e1e4);
    --pod-radius: var(--rz-border-radius, 4px);
    --pod-shadow: var(--rz-shadow-3, 0 4px 16px rgba(0, 0, 0, 0.1));
    --pod-info: var(--rz-info, #12a4f5);
    --pod-info-tint: var(--rz-info-lighter, rgba(18, 164, 245, 0.16));
    --pod-info-text: var(--rz-info-darker, #0e7dba);
    --pod-warning: var(--rz-warning, #ffae11);
    --pod-warning-tint: var(--rz-warning-lighter, rgba(255, 174, 17, 0.16));
    --pod-warning-text: var(--rz-warning-darker, #c2840d);
    --pod-danger: var(--rz-danger, #f31155);
    --pod-danger-tint: var(--rz-danger-lighter, rgba(243, 17, 85, 0.16));
    --pod-danger-text: var(--rz-danger-darker, #b90d41);
    --pod-success: var(--rz-success, #009b51);
    --pod-on-status: #ffffff;
    --pod-badge: var(--pod-info);
    --pod-on-badge: #ffffff;
    --pod-badge-ring: transparent;
    --pod-backdrop: rgba(0, 0, 0, 0.45);
}

.pod-external {
    --pod-accent: #442e72;
    --pod-on-accent: #ffffff;
    --pod-text: #241c33;
    --pod-muted: #625a70;
    --pod-surface: #ffffff;
    --pod-raised: #ffffff;
    --pod-subtle: #f6f3fa;
    --pod-code: #efeaf5;
    --pod-border: #e2dcea;
    --pod-neutral: #e8e1f1;
    --pod-neutral-hover: #dbd2e8;
    --pod-radius: 6px;
    --pod-shadow: 0 10px 30px rgba(36, 28, 51, 0.16), 0 2px 6px rgba(36, 28, 51, 0.08);
    --pod-info: #5b3f94;
    --pod-info-tint: #efe9f8;
    --pod-info-text: #3a2763;
    --pod-warning: #c77700;
    --pod-warning-tint: #fff3dc;
    --pod-warning-text: #6b4100;
    --pod-danger: #c62828;
    --pod-danger-tint: #fdecec;
    --pod-danger-text: #8e1b1b;
    --pod-success: #2e7d32;
    --pod-on-status: #ffffff;
    --pod-badge: #ffffff;
    --pod-on-badge: #442e72;
    --pod-badge-ring: rgba(36, 28, 51, 0.18);
    --pod-backdrop: rgba(36, 28, 51, 0.5);
}

.pod-muted { color: var(--pod-muted); }
.pod-caption { display: block; font-size: 0.8rem; color: var(--pod-muted); }

.pod-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 2.25rem; margin: 0; padding: 0.45rem 1rem; border: 1px solid transparent; border-radius: var(--pod-radius); font: inherit; font-size: 0.875rem; font-weight: 600; line-height: 1.2; letter-spacing: normal; text-transform: none; cursor: pointer; transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s; }
.pod-btn:focus-visible { outline: 2px solid var(--pod-accent); outline-offset: 2px; }
.pod-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.pod-btn-primary { background: var(--pod-accent); color: var(--pod-on-accent); }
.pod-btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--pod-accent) 86%, #000000); }
.pod-btn-secondary { background: var(--pod-neutral); color: var(--pod-text); }
.pod-btn-secondary:hover:not(:disabled) { background: var(--pod-neutral-hover); }

/* In a button while what it sends is on its way, in the button's own text colour. */
.pod-spinner { display: inline-block; flex-shrink: 0; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: pod-spin 0.7s linear infinite; }
@keyframes pod-spin { to { transform: rotate(360deg); } }

.pod-trigger { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; padding: 0.25rem 0.5rem; border: 0; border-radius: var(--pod-radius); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.pod-trigger:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.pod-trigger:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* The looks of a trigger (PodTriggerLook): a large icon, a small one with the count on its corner, or a small one and a label. */

.pod-trigger-glyph { position: relative; display: inline-flex; flex-shrink: 0; }
.pod-trigger-icon { display: block; width: 28px; height: 28px; }
.pod-trigger-compact { padding: 0.4rem; }
.pod-trigger-compact .pod-trigger-icon { width: 20px; height: 20px; }
.pod-trigger-text { gap: 0.4rem; padding: 0.3rem 0.55rem; font-size: 0.875rem; font-weight: 600; line-height: 1.2; }
.pod-trigger-text .pod-trigger-icon { width: 16px; height: 16px; }
.pod-trigger-label { white-space: nowrap; }
.pod-count-dot { position: absolute; top: -0.4rem; right: -0.55rem; min-width: 1rem; height: 1rem; padding: 0 0.25rem; border-radius: 1rem; background: var(--pod-badge); color: var(--pod-on-badge); box-shadow: 0 0 0 1px var(--pod-badge-ring); font-size: 0.65rem; font-weight: 700; line-height: 1rem; text-align: center; }
.pod-count-pill { display: inline-block; min-width: 1.05rem; padding: 0 0.35rem; border-radius: 1rem; background: var(--pod-badge); color: var(--pod-on-badge); box-shadow: 0 0 0 1px var(--pod-badge-ring); font-size: 0.7rem; font-weight: 700; line-height: 1.05rem; text-align: center; }

.pod-close { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; margin: 0; padding: 0; border: 0; border-radius: var(--pod-radius); background: transparent; color: inherit; font: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.pod-close:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.pod-close:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }

.pod-textarea { display: block; width: 100%; min-height: 8rem; margin: 0; padding: 0.6rem 0.75rem; border: 1px solid var(--pod-border); border-radius: var(--pod-radius); background: var(--pod-surface); color: var(--pod-text); font: inherit; font-size: 0.9rem; line-height: 1.45; resize: vertical; }
.pod-textarea:focus { outline: none; border-color: var(--pod-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pod-accent) 22%, transparent); }

.pod-marker { display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.45rem; border-radius: 999px; color: var(--pod-on-status); font-size: 0.7rem; font-weight: 600; line-height: 1.5; vertical-align: middle; }
.pod-marker-new { background: var(--pod-info); }
.pod-marker-latest { background: var(--pod-success); }
.pod-marker-danger { background: var(--pod-danger); }

dialog.pod-dialog { width: min(40rem, calc(100vw - 2rem)); max-height: calc(100vh - 4rem); padding: 0; border: 0; border-radius: calc(var(--pod-radius) * 2); background: var(--pod-raised); color: var(--pod-text); box-shadow: var(--pod-shadow); text-align: left; }
dialog.pod-dialog[open] { display: flex; flex-direction: column; }
dialog.pod-dialog::backdrop { background: var(--pod-backdrop, rgba(0, 0, 0, 0.45)); }
.pod-dialog-inner { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.pod-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1rem 0.9rem 1.25rem; border-bottom: 1px solid var(--pod-border); }
.pod-dialog-title { margin: 0; color: inherit; font-family: inherit; font-size: 1.05rem; font-weight: 600; letter-spacing: normal; line-height: 1.3; text-transform: none; }
.pod-dialog-body { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem 1.25rem; overflow-y: auto; }
.pod-dialog-footer { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; padding: 0.75rem 1.25rem; border-top: 1px solid var(--pod-border); background: var(--pod-subtle); border-radius: 0 0 calc(var(--pod-radius) * 2) calc(var(--pod-radius) * 2); }

@media (prefers-reduced-motion: reduce) {
    .pod *, .pod *::before, .pod *::after { transition: none !important; }
    .pod-spinner { animation-duration: 2s; }
}

/* PodAlertBanner. */

.pod-alerts { display: flex; flex-direction: column; width: 100%; }
.pod-alert { display: flex; align-items: flex-start; gap: 0.6rem; width: 100%; font-size: 0.875rem; line-height: 1.45; }
.pod-alert-icon { flex-shrink: 0; width: 1.15rem; height: 1.15rem; margin-top: 0.05rem; }
.pod-alert-text { flex: 1; min-width: 0; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pod-alert-label { margin-right: 0.4rem; font-weight: 700; }
.pod-alert .pod-close { width: 1.75rem; height: 1.75rem; margin: -0.2rem -0.35rem -0.2rem 0; font-size: 1.25rem; }
.pod-alert-info { background: linear-gradient(var(--pod-info-tint), var(--pod-info-tint)), var(--pod-surface); color: var(--pod-info-text); }
.pod-alert-warning { background: linear-gradient(var(--pod-warning-tint), var(--pod-warning-tint)), var(--pod-surface); color: var(--pod-warning-text); }
.pod-alert-critical { background: linear-gradient(var(--pod-danger-tint), var(--pod-danger-tint)), var(--pod-surface); color: var(--pod-danger-text); }
.pod-alerts-bar .pod-alert { padding: 0.5rem 1rem; border-bottom: 1px solid color-mix(in srgb, currentColor 22%, transparent); }
.pod-alerts-sticky { position: sticky; top: var(--pod-alerts-offset, 0); z-index: 20; }
.pod-alerts-inline { gap: 0.5rem; }
.pod-alerts-inline .pod-alert { padding: 0.75rem 1rem; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: calc(var(--pod-radius) * 1.5); }
.pod-alerts-floating { position: fixed; top: var(--pod-alerts-offset, 1rem); right: 1rem; z-index: 1080; gap: 0.5rem; width: min(26rem, calc(100vw - 2rem)); }
.pod-alerts-floating .pod-alert { padding: 0.75rem 1rem; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-left-width: 4px; border-radius: calc(var(--pod-radius) * 1.5); box-shadow: var(--pod-shadow); }

/* PodReleasesMenu. */

.pod-menu { position: relative; display: inline-flex; align-items: center; }
.pod-menu-badge { display: inline-block; min-width: 1.4rem; padding: 0.1rem 0.45rem; border-radius: 1rem; background: var(--pod-badge); color: var(--pod-on-badge); box-shadow: 0 0 0 1px var(--pod-badge-ring); font-size: 0.75rem; font-weight: 700; line-height: 1.4; text-align: center; }
.pod-menu-chevron { transition: transform 0.15s; }
.pod-menu-chevron-open { transform: rotate(180deg); }
.pod-menu-backdrop { position: fixed; inset: 0; z-index: 1050; }
.pod-menu-panel { position: absolute; top: calc(100% + 0.5rem); right: 0; z-index: 1051; width: 28rem; max-width: calc(100vw - 2rem); max-height: 24rem; overflow-y: auto; margin: 0; padding: 0.25rem 0; border: 1px solid var(--pod-border); border-radius: calc(var(--pod-radius) * 1.5); background: var(--pod-raised); color: var(--pod-text); box-shadow: var(--pod-shadow); text-align: left; }
.pod-menu-panel:popover-open { position: fixed; inset: auto; }
.pod-menu-message { margin: 1rem; color: var(--pod-muted); text-align: center; }
.pod-menu-item { display: block; width: 100%; margin: 0; padding: 0.6rem 1rem; border: 0; border-top: 1px solid var(--pod-border); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pod-menu-item:first-child { border-top: 0; }
.pod-menu-item:hover, .pod-menu-item:focus-visible { background: var(--pod-subtle); outline: none; }
.pod-menu-heading { display: block; font-weight: 600; }
.pod-menu-section { margin: 0; padding: 0.5rem 1rem 0.25rem; color: var(--pod-muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.pod-menu-actions { position: sticky; bottom: -0.25rem; margin: 0.25rem 0 -0.25rem; padding: 0.25rem 0; border-top: 1px solid var(--pod-border); background: var(--pod-raised); }
.pod-menu-action { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; }
.pod-menu-action svg { flex-shrink: 0; color: var(--pod-muted); }
.pod-release-facts { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; }
.pod-release-notes { margin-top: 0.15rem; }

/* PodFeedbackButton. */

.pod-feedback { display: inline-flex; }
.pod-choices { display: grid; gap: 0.75rem; }
.pod-choice { display: flex; align-items: flex-start; gap: 0.85rem; width: 100%; margin: 0; padding: 0.9rem 1rem; border: 1px solid var(--pod-border); border-radius: calc(var(--pod-radius) * 1.5); background: var(--pod-surface); color: var(--pod-text); font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.pod-choice:hover, .pod-choice:focus-visible { border-color: var(--pod-accent); background: var(--pod-subtle); outline: none; }
.pod-choice-icon { flex-shrink: 0; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; }
.pod-choice-problem .pod-choice-icon { background: linear-gradient(var(--pod-danger-tint), var(--pod-danger-tint)), var(--pod-surface); color: var(--pod-danger-text); }
.pod-choice-feedback .pod-choice-icon { background: linear-gradient(var(--pod-info-tint), var(--pod-info-tint)), var(--pod-surface); color: var(--pod-info-text); }
.pod-choice-title { display: block; font-weight: 600; }
.pod-choice-text { display: block; margin-top: 0.1rem; color: var(--pod-muted); font-size: 0.85rem; }
.pod-field-label { display: block; margin: 0 0 0.35rem; font-size: 0.9rem; font-weight: 600; }
.pod-check { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.9rem; cursor: pointer; }
.pod-check input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--pod-accent); }
.pod-feedback-error { margin: 0; color: var(--pod-danger-text); font-size: 0.875rem; }
.pod-feedback-sent { display: flex; align-items: flex-start; gap: 0.75rem; margin: 0; }
.pod-feedback-sent svg { flex-shrink: 0; color: var(--pod-success); }

/* PodAppSupportErrorBoundary. */

.pod-error { max-width: 52rem; margin: 1rem 0; border: 1px solid var(--pod-border); border-radius: calc(var(--pod-radius) * 2); background: var(--pod-surface); color: var(--pod-text); }
.pod-error-section { display: flex; flex-direction: column; gap: 0.75rem; padding: 1.25rem 1.5rem; }
.pod-error-section + .pod-error-section { border-top: 1px solid var(--pod-border); }
.pod-error-head { display: flex; align-items: flex-start; gap: 1rem; }
.pod-error-icon { flex-shrink: 0; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: linear-gradient(var(--pod-danger-tint), var(--pod-danger-tint)), var(--pod-surface); color: var(--pod-danger-text); }
.pod-error-title { margin: 0; color: inherit; font-family: inherit; font-size: 1.25rem; font-weight: 600; letter-spacing: normal; line-height: 1.3; text-transform: none; }
.pod-error-subtitle { margin: 0; color: inherit; font-family: inherit; font-size: 1rem; font-weight: 600; letter-spacing: normal; line-height: 1.3; text-transform: none; }
.pod-error-text { margin: 0.3rem 0 0; font-size: 0.925rem; }
.pod-error-reference { color: var(--pod-text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 600; letter-spacing: 0.03em; white-space: nowrap; }
.pod-error-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pod-error-details { gap: 0.3rem; font-size: 0.875rem; overflow-wrap: anywhere; }
.pod-error-trace { max-height: 22rem; overflow: auto; margin: 0.4rem 0 0; padding: 0.75rem; border: 0; border-radius: var(--pod-radius); background: var(--pod-code); color: var(--pod-text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.75rem; line-height: 1.5; white-space: pre; overflow-wrap: normal; }
.pod-error-textarea { min-height: 5rem; }

/* PodReleaseNotesCard. */

.pod-card { padding: 1rem 1.25rem; border: 1px solid var(--pod-border); border-radius: calc(var(--pod-radius) * 2); background: var(--pod-surface); color: var(--pod-text); }
.pod-card-title { margin: 0 0 0.75rem; color: inherit; font-family: inherit; font-size: 1.15rem; font-weight: 600; letter-spacing: normal; line-height: 1.3; text-transform: none; }
.pod-card-message { margin: 0; color: var(--pod-muted); }
.pod-card-entry + .pod-card-entry { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--pod-border); }
.pod-card-heading { margin: 0 0 0.2rem; font-weight: 600; }
.pod-card-entry .pod-caption { margin-bottom: 0.15rem; }
.pod-card-notes { font-size: 0.875em; }
.pod-card-faded { color: var(--pod-muted); }
