/* Plugin-specific surfaces on top of the shared site palette. */
.plugin-theme {
  --plugin-raised: var(--raised);
  --plugin-selected: var(--selected);
  --plugin-control-border: var(--control-border);
}
.plugin-theme :where(h1, h2, h3, h4, .eyebrow) { letter-spacing: 0; }
.plugin-theme :where(button, .plugin-submitted-back) { color: var(--on-brand); }
.plugin-theme .header-action-button { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.plugin-theme .header-action-button:hover { background: var(--brand-dark); }
.plugin-theme button.secondary { background: var(--field); color: var(--text); border-color: var(--plugin-control-border); }
.plugin-theme button.secondary:hover { background: var(--plugin-raised); border-color: var(--brand-text); }
.plugin-theme:not([data-plugin-doc-page]) button.secondary { background: var(--raised); border-color: transparent; }
.plugin-theme:not([data-plugin-doc-page]) button.secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--raised) 78%, var(--brand)); }
.plugin-theme button.danger { background: var(--danger); color: var(--on-danger); }
.plugin-theme button.danger:hover { background: color-mix(in srgb, var(--danger) 85%, var(--text)); }
.plugin-theme :where(input, select, textarea) { border-color: var(--plugin-control-border); accent-color: var(--brand-text); }
.plugin-theme :where(button, a, input, select, textarea):focus-visible { outline: 2px solid var(--focus-color); outline-offset: 3px; }
.plugin-theme :where(.card, .plugin-device-option, .plugin-preview) { border-radius: 8px; }
.plugin-theme .plugin-page-hero { background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 0 0 20px; }
.plugin-theme :where(.plugin-detail-content, .plugin-upload-card, .plugin-submitted-card, .creator-data-note) { border: 0; border-radius: 0; background: transparent; }
.plugin-theme .plugin-detail-content { padding: 0; }
.plugin-theme .plugin-detail-section { background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.plugin-theme .plugin-detail-section:last-child { border-bottom: 0; }
.plugin-theme .creator-metrics div { border-radius: 0; border-left: 2px solid var(--border); background: transparent; }
.plugin-theme .plugin-revision-management { border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.plugin-theme .plugin-card:hover { transform: none; box-shadow: none; }
.plugin-theme .plugin-card:hover .plugin-thumb { background: var(--field); border-color: var(--brand-text); }
.plugin-theme .plugin-enable-action { border-color: var(--plugin-control-border); }
.plugin-theme .plugin-enablement-filter button[aria-pressed="true"] { background: var(--plugin-selected); border-color: var(--brand-text); color: var(--text); }
.plugin-theme .plugin-rating-star { color: var(--muted); background: transparent; }
.plugin-theme .plugin-rating-star:is(:hover, .is-selected) { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--card)); }
.plugin-theme .plugin-account-switch input { border-color: var(--plugin-control-border); background: var(--field); }
.plugin-theme .plugin-account-switch input::before { background: var(--muted); }
.plugin-theme .plugin-account-switch input:checked { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, var(--card)); }
.plugin-theme .plugin-account-switch input:checked::before { background: var(--ok); }
.plugin-theme .plugin-detail-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.plugin-theme .plugin-detail-back { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--plugin-control-border); border-radius: 6px; color: var(--text); text-decoration: none; }
.plugin-theme .plugin-detail-back:hover { background: var(--plugin-raised); border-color: var(--brand-text); }
.plugin-theme .plugin-visibility-control { margin-left: auto; text-align: right; max-width: 320px; }
.plugin-theme .plugin-visibility-control[hidden] { display: none; }
.plugin-theme .plugin-visibility-control .plugin-account-switch { min-height: 44px; gap: 12px; }
.plugin-theme .plugin-visibility-control .plugin-account-switch span { font-size: 15px; font-weight: 600; }
.plugin-theme .plugin-visibility-control input { width: 52px; min-width: 52px; height: 30px; padding: 3px; border-radius: 16px; }
.plugin-theme .plugin-visibility-control input::before { width: 22px; height: 22px; }
.plugin-theme .plugin-visibility-control input:checked::before { transform: translateX(22px); }
.plugin-theme .plugin-visibility-control input:disabled { cursor: not-allowed; }
.plugin-theme .plugin-visibility-control p { margin: 4px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.plugin-theme .plugin-visibility-dialog { width: min(460px, calc(100% - 32px)); max-height: 85dvh; overflow: auto; padding: 24px; border: 1px solid var(--plugin-control-border); border-radius: 8px; color: var(--text); background: var(--plugin-raised); }
.plugin-theme .plugin-visibility-dialog h2 { margin: 0 0 14px; font-size: 20px; }
.plugin-theme .plugin-visibility-dialog p { line-height: 1.6; overflow-wrap: anywhere; }
.plugin-theme .plugin-visibility-dialog .btn-row { justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.plugin-theme #visibilityError { color: var(--danger); }
.plugin-theme :where(.plugin-how-to-use code, code.token) { color: var(--ok); }
.plugin-theme :where(.action-menu-panel, .user-account-panel) { background: var(--plugin-raised); }
.plugin-theme .user-account-toggle { color: var(--text); border-color: var(--plugin-control-border); }
.plugin-theme .user-account-toggle:hover { background: var(--plugin-raised); }
.plugin-theme .user-account-signout { color: var(--danger); }
@media (prefers-reduced-motion: reduce) {
  .plugin-theme .plugin-visibility-control input::before { transition: none; }
  .plugin-theme :where(button, .plugin-card, .plugin-thumb, .plugin-icon, .doc-hub-card) { transition: none; }
  .plugin-theme .plugin-card:hover .plugin-icon { transform: none; }
}
