/* Atea Copilot Prompt Library - Official Atea Design System */

/* Keep native hidden semantics even on components with stronger layout rules. */
[hidden] {
  display: none !important;
}

/* Governed Lab app management */
.app-management .modal__dialog {
  width: min(44rem, calc(100vw - 2rem));
  max-height: min(90vh, 52rem);
  overflow: auto;
}

.app-management hr {
  border: 0;
  border-top: 1px solid var(--border, #d7dcda);
  margin: 1.5rem 0;
}

.app-management [readonly] {
  color: var(--text-muted, #52605c);
  background: var(--surface-muted, #f4f6f5);
}

.app-management [data-app-management-status]:empty,
.app-management [data-app-promotion-copy]:empty {
  display: none;
}

:root {
  /* Brand palette (semantic, constant across themes). White-label seam: these
     hold the only brand-color literals; everything else routes through them.
     Values are byte-identical to the legacy Atea palette they replace. */
  --brand-primary: #008a00;
  --brand-primary-hover: #007500;
  --brand-primary-light: rgba(0, 138, 0, 0.1);
  --brand-teal: #097288;
  --brand-teal-light: rgba(9, 114, 136, 0.1);
  --brand-neutral: #4d5459;
  --brand-blue: #0965b1;
  --brand-blue-light: rgba(9, 101, 177, 0.1);
  --brand-red: #d62429;
  --brand-red-light: rgba(214, 36, 41, 0.1);
  --brand-yellow: #f5b800;
  --brand-yellow-light: rgba(245, 184, 0, 0.1);
  --brand-orange: #ec7a2e;
  --brand-orange-light: rgba(236, 122, 46, 0.1);
  /* Refined-shell green shades (centralized here so one edit rebrands the whole
     green family across legacy + refined shells; byte-identical to prior values). */
  --brand-primary-strong: #007300;
  --brand-primary-on-dark: #4fc24f;

  /* Text colours: brand, danger and information text on the page surfaces. Brand text is the lightest
     darkening of the brand green that keeps 4.5:1 on every light text surface (white, page, rail, chip and
     the soft green tint); buttons keep --brand-primary. The dark-theme block lightens them for dark surfaces. */
  --brand-text: color-mix(in srgb, var(--brand-primary) 91%, #000);
  --brand-text-hover: var(--brand-primary-hover);
  --danger-text: #9b2c2c;
  --info-text: #175c9e;

  /* U3: agent-badge TEXT colors, derived from the brand tokens via color-mix
     rather than new literals -- an overlay that redefines --brand-orange/
     -red/-primary still gets an automatically-darkened, WCAG-AA-compliant
     badge text shade for free, no second value to keep in sync. Only the
     three hues that measured below 4.5:1 against their own X%-light tinted
     badge background needed darkening (blue/teal/neutral already clear
     4.5:1 as-is); the dark-theme block below overrides all six with a
     LIGHTENING mix instead, since --brand-*-light composited against the
     dark --bg-card produces a dark tint that plain (or darkened) brand
     text can't clear. Values tuned with headroom above the 4.5:1 floor,
     not the exact minimum. */
  --agent-text-orange: color-mix(in srgb, var(--brand-orange) 65%, black);
  --agent-text-red: color-mix(in srgb, var(--brand-red) 90%, black);
  --agent-text-green: color-mix(in srgb, var(--brand-primary) 85%, black);
  --agent-text-blue: var(--brand-blue);
  --agent-text-teal: var(--brand-teal);
  --agent-text-neutral: var(--brand-neutral);
  --placeholder-unfilled-bg: color-mix(in srgb, var(--brand-orange) 12%, var(--bg-card));
  --placeholder-unfilled-text: color-mix(in srgb, var(--brand-orange) 58%, black);
  --placeholder-filled-bg: color-mix(in srgb, var(--brand-primary) 12%, var(--bg-card));
  --placeholder-filled-text: color-mix(in srgb, var(--brand-primary) 82%, black);

  /* About classification guidance. Color is reinforced by icon + label. */
  --about-info-bg: #eff6fc;
  --about-info-border: #0078d4;
  --about-info-text: #0f548c;
  --about-warning-bg: #fff4ce;
  --about-warning-border: #d29200;
  --about-warning-text: #6a4300;
  --about-non-business-bg: #f3f4f6;
  --about-non-business-border: #9ca3af;
  --about-non-business-text: #4b5563;
  --about-public-bg: #e8f5e9;
  --about-public-border: #4caf63;
  --about-public-text: #237a3b;
  --about-internal-bg: #e6f2ff;
  --about-internal-border: #4a9bd5;
  --about-internal-text: #005a9e;
  --about-confidential-bg: #fff4ce;
  --about-confidential-border: #d29200;
  --about-confidential-text: #8a5700;
  --about-strict-bg: #fde7e9;
  --about-strict-border: #d13438;
  --about-strict-text: #a4262c;

  /* Legacy --atea-* aliases — every internal rule in this file now
     references --brand-* directly (swept in full, see backlog item A3).
     These definitions are retained only as a compatibility surface for any
     external/overlay CSS that may still reference --atea-* by name. Do not
     add new --atea-* references. */
  --atea-green: var(--brand-primary);
  --atea-green-hover: var(--brand-primary-hover);
  --atea-green-light: var(--brand-primary-light);
  --atea-teal: var(--brand-teal);
  --atea-teal-light: var(--brand-teal-light);
  --atea-grey: var(--brand-neutral);
  --atea-blue: var(--brand-blue);
  --atea-blue-light: var(--brand-blue-light);
  --atea-red: var(--brand-red);
  --atea-red-light: var(--brand-red-light);
  --atea-yellow: var(--brand-yellow);
  --atea-yellow-light: var(--brand-yellow-light);
  --atea-orange: var(--brand-orange);
  --atea-orange-light: var(--brand-orange-light);

  /* Light Theme (default) */
  --bg-page: #f7f7f7;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --bg-input: #ffffff;
  --bg-input-focus: #ffffff;

  --text-primary: #1a1a1a;
  --text-secondary: #4d5459;
  --text-muted: #6b7280;
  --text-on-primary: #ffffff;

  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  --border-focus: var(--brand-primary);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);

  --focus-ring: 0 0 0 3px rgba(0, 138, 0, 0.3);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Satoshi", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --transition: 150ms ease;

  /* Elevation shadows */
  --shadow-elevation-1: 0 1px 2px rgba(0,0,0,0.04), 0 1px 4px rgba(0,0,0,0.03);
  --shadow-elevation-2: 0 2px 8px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-elevation-3: 0 8px 24px rgba(0,0,0,0.08), 0 16px 48px rgba(0,0,0,0.06);

  /* Subtle surface */
  --bg-subtle: color-mix(in srgb, var(--bg-card) 50%, var(--bg-page));

  /* Transition tokens */
  --transition-fast: 120ms ease;
  --transition-base: 180ms ease;
  --transition-slow: 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme */
[data-theme="dark"],
[data-theme="midnight"],
[data-theme="carbon"],
[data-theme="cyberpunk"],
[data-theme="neon"],
[data-theme="sunset"] {
  --bg-page: #1a1c1e;
  --bg-card: #2a2d31;
  --bg-card-hover: #32363b;
  --bg-input: #1f2225;
  --bg-input-focus: #25282c;

  --text-primary: #f0f0f0;
  --text-secondary: #b0b5ba;
  --text-muted: #8a9199;

  --border-light: #3a3d42;
  --border-medium: #4a4d52;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.15);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);

  --focus-ring: 0 0 0 3px rgba(0, 138, 0, 0.4);

  --shadow-elevation-1: 0 1px 2px rgba(0,0,0,0.15), 0 1px 4px rgba(0,0,0,0.12);
  --shadow-elevation-2: 0 2px 8px rgba(0,0,0,0.2), 0 4px 16px rgba(0,0,0,0.15);
  --shadow-elevation-3: 0 8px 24px rgba(0,0,0,0.25), 0 16px 48px rgba(0,0,0,0.2);
  --bg-subtle: color-mix(in srgb, var(--bg-card) 50%, var(--bg-page));

  /* U3: all 6 agent-badge text colors failed WCAG AA here PRE-EXISTING
     (1.70:1-4.22:1 measured against their own tinted badge background --
     --brand-*-light composited over the dark --bg-card yields a dark
     tint that even the plain brand hue can't clear). Lightening mix
     (not darkening, unlike the :root block above) since dark mode needs
     the opposite direction. */
  /* Brand, danger and information text: 5.1:1 or more on every dark surface and tinted panel. */
  --brand-text: var(--brand-primary-on-dark);
  /* Hovered link text: lighter than --brand-text, so hover still shows, and 4.5:1 or more on dark surfaces
     (the shared --brand-primary-hover green is 3.1:1 there). */
  --brand-text-hover: color-mix(in srgb, var(--brand-primary-on-dark) 70%, white);
  --danger-text: #ff8a80;
  --info-text: #5b9bf0;

  --agent-text-orange: color-mix(in srgb, var(--brand-orange) 85%, white);
  --agent-text-red: color-mix(in srgb, var(--brand-red) 55%, white);
  --agent-text-green: color-mix(in srgb, var(--brand-primary) 60%, white);
  --agent-text-blue: color-mix(in srgb, var(--brand-blue) 55%, white);
  --agent-text-teal: color-mix(in srgb, var(--brand-teal) 55%, white);
  --agent-text-neutral: color-mix(in srgb, var(--brand-neutral) 50%, white);
  --placeholder-unfilled-bg: color-mix(in srgb, var(--brand-orange) 18%, var(--bg-card));
  --placeholder-unfilled-text: color-mix(in srgb, var(--brand-orange) 65%, white);
  --placeholder-filled-bg: color-mix(in srgb, var(--brand-primary) 18%, var(--bg-card));
  --placeholder-filled-text: color-mix(in srgb, var(--brand-primary) 60%, white);

  --about-info-bg: #102a3d;
  --about-info-border: #4a9bd5;
  --about-info-text: #c7e8fa;
  --about-warning-bg: #352a0d;
  --about-warning-border: #f3c74f;
  --about-warning-text: #ffe8a3;
  --about-non-business-bg: #292c30;
  --about-non-business-border: #9ca3af;
  --about-non-business-text: #d1d5db;
  --about-public-bg: #14331e;
  --about-public-border: #4caf63;
  --about-public-text: #86d993;
  --about-internal-bg: #102a3d;
  --about-internal-border: #4a9bd5;
  --about-internal-text: #75b6e7;
  --about-confidential-bg: #352a0d;
  --about-confidential-border: #d29200;
  --about-confidential-text: #f3c74f;
  --about-strict-bg: #3a171a;
  --about-strict-border: #d13438;
  --about-strict-text: #f1707b;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.5;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.agent-access-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.agent-access-card__request {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.agent-access-card__request:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

.agent-access-dialog {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.agent-access-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.agent-access-dialog__panel {
  position: relative;
  width: min(36rem, 100%);
  max-height: min(90vh, 48rem);
  overflow: auto;
  padding: 1.25rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  box-shadow: var(--shadow-elevation-3);
}

.agent-access-dialog__header,
.agent-access-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.agent-access-dialog__panel h2 { margin: 0; }

.agent-access-dialog__field {
  display: grid;
  gap: 0.375rem;
  margin: 1rem 0;
  font-weight: 600;
}

.agent-access-dialog__field textarea,
.agent-access-dialog__field select {
  width: 100%;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.625rem;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
}

.agent-access-dialog__status { min-height: 1.5rem; }
.agent-access-dialog__status--error { color: var(--brand-red); }

@media (max-width: 480px) {
  .agent-access-dialog { align-items: end; padding: 0; }
  .agent-access-dialog__panel { width: 100%; max-height: 92vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .agent-access-dialog__actions { align-items: stretch; flex-direction: column; }
  .agent-access-dialog__actions > * { width: 100%; text-align: center; }
}

body.auth-required:not(.is-authenticated) .hub-nav,
body.auth-required:not(.is-authenticated) .hub-header__submit,
body.auth-required:not(.is-authenticated) .hub-header__settings,
body.auth-required:not(.is-authenticated) main {
  display: none;
}

body.is-authenticated .auth-gate {
  display: none;
}

.auth-gate {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: clamp(32px, 8vw, 96px) 20px;
  background:
    linear-gradient(135deg, rgba(0, 138, 0, 0.08), transparent 42%),
    linear-gradient(315deg, rgba(9, 101, 177, 0.08), transparent 38%),
    var(--bg-page);
}

.auth-gate__inner {
  width: min(100%, 560px);
  padding: clamp(28px, 5vw, 44px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-elevation-2);
}

.auth-gate__eyebrow {
  margin: 0 0 10px;
  color: var(--brand-text);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-gate__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 0.98;
}

.auth-gate__copy {
  margin: 18px 0 26px;
  color: var(--text-secondary);
  font-size: 1rem;
}

.auth-gate__button[hidden] {
  display: none;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--transition);
  z-index: 10000;
}

.skip-link:focus {
  transform: translateY(0);
}

a {
  color: var(--brand-text);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--brand-text-hover);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Layout */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

main.detail-view-active .list-view-only {
  display: none;
}

/* Explore Layout (Dashboard-like) */
.library-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.library-sidebar {
  position: sticky;
  top: calc(24px + env(safe-area-inset-top));
  align-self: start;
  max-height: calc(100vh - 48px - env(safe-area-inset-top));
  overflow: auto;
  border-top: 2px solid var(--brand-primary);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-advanced {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-advanced__summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
}

.sidebar-advanced__summary::-webkit-details-marker {
  display: none;
}

.sidebar-advanced__title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


.sidebar-advanced__content {
  padding-top: 12px;
}

.sidebar-advanced__content .sidebar-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.sidebar-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.sidebar-search.hero-search {
  margin-bottom: 16px;
}

.pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  appearance: none;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 7px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.filter-chip:hover {
  background: color-mix(in srgb, var(--brand-primary) 6%, var(--bg-card));
  border-color: color-mix(in srgb, var(--brand-primary) 30%, var(--border-medium));
  color: var(--text-primary);
  transform: translateY(-1px);
}

.filter-chip.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-on-primary);
  box-shadow: 0 2px 8px rgba(0, 138, 0, 0.2);
}

.tag-input {
  width: 100%;
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all var(--transition);
}

.tag-input:focus {
  border-color: var(--brand-primary);
  box-shadow: var(--focus-ring);
  outline: none;
}

.checkbox-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  user-select: none;
}

.checkbox-control input {
  width: 16px;
  height: 16px;
}

.library-main {
  min-width: 0;
}

.library-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.library-main-header--toolbar {
  margin-bottom: 0;
  align-items: flex-start;
}

.results-header-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.results-label {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.results-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.library-main-header--toolbar .results-header-actions {
  gap: 10px;
}

.results-action-button {
  appearance: none;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.results-action-button:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

/* Active filters summary */
.active-filters-summary {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.mode-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}


.mode-banner--warning {
  border-color: var(--brand-yellow);
  background: var(--brand-yellow-light);
}

.mode-banner--error {
  border-color: var(--brand-red);
  background: var(--brand-red-light);
}

.active-filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.active-filters-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.clear-all-filters {
  appearance: none;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.clear-all-filters:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
}

.active-filters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-medium);
  background: var(--bg-page);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.active-filter-chip:hover {
  border-color: var(--brand-neutral);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.active-filter-chip__x {
  color: var(--text-muted);
  font-weight: 700;
}

/* Sticky filter bar (mobile) */
.sticky-filter-bar {
  position: sticky;
  top: 0;
  z-index: 9996;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-elevation-1);
}

[data-theme="dark"] .sticky-filter-bar,
[data-theme="midnight"] .sticky-filter-bar,
[data-theme="carbon"] .sticky-filter-bar,
[data-theme="cyberpunk"] .sticky-filter-bar,
[data-theme="neon"] .sticky-filter-bar,
[data-theme="sunset"] .sticky-filter-bar {
  background: rgba(26, 28, 30, 0.82);
}

.sticky-filter-bar[hidden] {
  display: none;
}

.sticky-filter-bar__label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sticky-filter-bar__summary {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticky-filter-bar__btn {
  appearance: none;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.sticky-filter-bar__btn:hover {
  background: var(--bg-card-hover);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.44);
  z-index: 9995;
}

.sidebar-backdrop[hidden] {
  display: none;
}

/* Desktop: full-width layout (no sidebar) */
@media (min-width: 981px) {
  .library-layout {
    grid-template-columns: 1fr;
  }

  .library-sidebar {
    display: none;
  }
}

@media (max-width: 980px) {
  .library-layout {
    grid-template-columns: 1fr;
  }

  .workspace-shell__content {
    grid-template-columns: 1fr;
  }

  .library-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: min(420px, 92vw);
    max-height: 100vh;
    border-radius: 0;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    visibility: hidden;
    pointer-events: none;
    z-index: 9998;
  }

  body.sidebar-open .library-sidebar {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .hero-search-section,
  .filter-bar {
    display: none;
  }
}

/* Workspace Shell : Editorial Minimal */
.workspace-shell {
  position: relative;
  background: linear-gradient(180deg, var(--bg-card), color-mix(in srgb, var(--bg-card) 94%, var(--bg-page)));
  border: none;
  border-bottom: none;
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 0;
  box-shadow: var(--shadow-elevation-1);
}

.workspace-shell::after {
  content: '';
  display: block;
  height: 1px;
  margin-top: 16px;
  background: linear-gradient(
    to right,
    transparent,
    var(--border-light) 15%,
    var(--border-light) 85%,
    transparent
  );
}

.workspace-shell__topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.workspace-shell__toolbar {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.workspace-shell__intro {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}



.hero-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  position: relative;
}

.auth-user {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-menu {
  position: relative;
}

.auth-menu[hidden] {
  display: none;
}

.auth-menu__summary {
  appearance: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.auth-menu__summary::-webkit-details-marker {
  display: none;
}

.auth-menu__summary:hover,
.auth-menu[open] .auth-menu__summary {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.auth-menu__summary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.auth-menu__avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: var(--text-on-primary);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.auth-menu__chevron {
  font-size: 0.6875rem;
  color: var(--text-muted);
  transform: translateY(-1px);
}

.auth-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: min(280px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}

.auth-menu__eyebrow {
  margin: 0 0 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.auth-menu__user {
  margin: 0;
}

.auth-menu__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.auth-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.auth-link:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.hero-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: color var(--transition);
  flex: 0 0 auto;
}

.hero-back-link:hover {
  color: var(--brand-text);
}

/* Markup-facing brand classes carry .brand-* names; the legacy .atea-* twins
   are retained as aliases. Internal descendant combinators below stay on the
   legacy .atea-* names (they are not referenced directly from markup). */
.brand-logo,
.atea-logo {
  display: block;
  height: 22px;
  width: auto;
}

.workspace-shell__content {
  display: block;
}

.workspace-shell__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.workspace-shell__subtitle {
  margin: 0;
  max-width: 48ch;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.brand-watermark,
.atea-watermark {
  position: absolute;
  top: 8px;
  right: 0;
  opacity: 0.18;
  pointer-events: none;
  user-select: none;
}

.atea-watermark .atea-logo {
  display: block;
  width: 80px;
  height: auto;
}

/* Theme switching: grey logo in light, white logo in dark */
.brand-logo--dark,
.atea-logo--dark { display: none; }

[data-theme="dark"] .atea-logo--light,
[data-theme="dark"] .brand-logo--light,
[data-theme="midnight"] .atea-logo--light,
[data-theme="midnight"] .brand-logo--light,
[data-theme="carbon"] .atea-logo--light,
[data-theme="carbon"] .brand-logo--light,
[data-theme="cyberpunk"] .atea-logo--light,
[data-theme="cyberpunk"] .brand-logo--light,
[data-theme="neon"] .atea-logo--light,
[data-theme="neon"] .brand-logo--light,
[data-theme="sunset"] .atea-logo--light,
[data-theme="sunset"] .brand-logo--light {
  display: none;
}

[data-theme="dark"] .atea-logo--dark,
[data-theme="dark"] .brand-logo--dark,
[data-theme="midnight"] .atea-logo--dark,
[data-theme="midnight"] .brand-logo--dark,
[data-theme="carbon"] .atea-logo--dark,
[data-theme="carbon"] .brand-logo--dark,
[data-theme="cyberpunk"] .atea-logo--dark,
[data-theme="cyberpunk"] .brand-logo--dark,
[data-theme="neon"] .atea-logo--dark,
[data-theme="neon"] .brand-logo--dark,
[data-theme="sunset"] .atea-logo--dark,
[data-theme="sunset"] .brand-logo--dark {
  display: block;
}

[data-theme="dark"] .atea-watermark,
[data-theme="midnight"] .atea-watermark,
[data-theme="carbon"] .atea-watermark,
[data-theme="cyberpunk"] .atea-watermark,
[data-theme="neon"] .atea-watermark,
[data-theme="sunset"] .atea-watermark {
  opacity: 0.20;
}

@media (max-width: 640px) {
  .brand-watermark,
  .atea-watermark {
    display: none;
  }
}

.workspace-shell__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workspace-shell__fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg-card) 88%, var(--bg-page));
}

.workspace-shell__fact-label,
.workspace-shell__status-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.workspace-shell__fact-value {
  font-size: 0.95rem;
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .workspace-shell__toolbar {
    width: 100%;
    justify-content: flex-end;
  }
}

.workspace-shell__status-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-card) 92%, var(--bg-page)), var(--bg-card));
  box-shadow: var(--shadow-sm);
}

.workspace-shell__status-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.workspace-shell__status-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.workspace-shell__status-item strong {
  font-size: 0.9375rem;
  color: var(--text-primary);
  text-align: right;
}

/* Hero Search */
.hero-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.hero-search .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.hero-search input {
  width: 100%;
  appearance: none;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 15px 56px 15px 48px;
  border-radius: 16px;
  font-size: 1rem;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: all 250ms ease;
}

.hero-search input:hover {
  border-color: var(--brand-neutral);
}

.hero-search input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 138, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
  outline: none;
}

.hero-search input::placeholder {
  color: var(--text-muted);
}

/* Desktop Hero Search Section */
.browse-toolbar-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-elevation-1);
}

.hero-search-section {
  text-align: center;
  padding: 0;
}

.hero-search-section .hero-search {
  max-width: 640px;
  margin: 0 auto;
}

/* Desktop Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  flex-wrap: wrap;
}

.filter-bar__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
}

/* Reuse .filter-chip styles for filter bar pills */
.filter-bar__pills .filter-chip {
  /* inherits from .filter-chip */
}

.filter-bar__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.filter-bar__agent-select {
  appearance: none;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 7px 30px 7px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2.22 4.47a.75.75 0 011.06 0L6 7.19l2.72-2.72a.75.75 0 011.06 1.06L6.53 8.78a.75.75 0 01-1.06 0L2.22 5.53a.75.75 0 010-1.06z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.filter-bar__agent-select:hover {
  border-color: var(--brand-neutral);
  color: var(--text-primary);
}

.filter-bar__agent-select:focus {
  border-color: var(--brand-primary);
  box-shadow: var(--focus-ring);
  outline: none;
}

.filter-bar__favorites {
  appearance: none;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 7px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-bar__favorites:hover {
  border-color: var(--brand-neutral);
  color: var(--text-primary);
}

.filter-bar__favorites[aria-pressed="true"] {
  background: var(--brand-yellow-light);
  border-color: var(--brand-yellow);
  color: #92400e;
}

.filter-bar__favorites svg {
  width: 14px;
  height: 14px;
}

.filter-bar__variables {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.filter-bar__variables input[type="checkbox"] {
  accent-color: var(--brand-primary);
  width: 16px;
  height: 16px;
}

.search-shortcut {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text-muted);
  pointer-events: none;
}

/* Filters Section */
.filters-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-elevation-1);
}

/* Category Pills */



.pills-label {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  white-space: nowrap;
}

.category-pills,
.agent-pills {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.library-sidebar .category-pills,
.library-sidebar .agent-pills,
.library-sidebar .role-chips,
.library-sidebar .tag-chips {
  flex-wrap: wrap;
}

.category-pill,
.agent-pill {
  appearance: none;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.category-pill:hover,
.agent-pill:hover {
  border-color: var(--brand-neutral);
  color: var(--text-primary);
}

.category-pill.active,
.agent-pill.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-on-primary);
}

/* Controls Bar */



/* Sort Control */
.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-control select {
  appearance: none;
  border: 1px solid var(--border-medium);
  background: var(--bg-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2.22 4.47a.75.75 0 0 1 1.06 0L6 7.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L2.22 5.53a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text-primary);
  padding: 8px 32px 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.sort-control select:hover {
  border-color: var(--brand-neutral);
}

.sort-control select:focus {
  border-color: var(--brand-primary);
  box-shadow: var(--focus-ring);
  outline: none;
}

/* Favorites Toggle */
.favorites-toggle {
  appearance: none;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.favorites-toggle:hover {
  border-color: var(--brand-neutral);
  color: var(--text-primary);
}

.favorites-toggle[aria-pressed="true"] {
  background: var(--brand-yellow-light);
  border-color: var(--brand-yellow);
  color: #b8860b;
}

@keyframes favPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.favorites-toggle[aria-pressed="true"] svg {
  animation: favPop 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

.favorites-toggle .star-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Submit Prompt Button */
.submit-prompt-button {
  appearance: none;
  border: 1px solid var(--brand-primary);
  background: var(--bg-card);
  color: var(--brand-text);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.submit-prompt-button:hover {
  border-color: var(--brand-primary-hover);
  background: var(--brand-primary-light);
  color: var(--brand-text-hover);
}

.submit-prompt-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Clear Filters Button */
.clear-filters-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 8px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.clear-filters-btn:hover {
  color: var(--brand-red);
}

/* Results Count */
.results-count {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.results-count span:first-child,
.results-count span:nth-child(3) {
  font-weight: 700;
  color: var(--brand-text);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* Section Heading */










/* Form Controls */













/* Prompt Grid */
.prompt-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* 3-column cards on large screens */
@media (min-width: 1200px) {
  .prompt-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 2-column cards on medium screens */
@media (min-width: 981px) and (max-width: 1199px) {
  .prompt-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Prompt Card */
.prompt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 3px solid transparent;
  border-top: 2px solid transparent;
  border-radius: var(--radius-xl);
  padding: 24px 24px 20px;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-slow), transform var(--transition-base);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  box-shadow: var(--shadow-elevation-1);
}

.prompt-card--skeleton {
  cursor: default;
  pointer-events: none;
}

.prompt-card--skeleton:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-light);
}

.prompt-card:not(.revealed):not(.prompt-card--skeleton) {
  opacity: 0;
  transform: translateY(8px);
}

.prompt-card.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 300ms ease, transform 300ms ease;
}

.skeleton-line,
.skeleton-pill {
  background: linear-gradient(90deg, var(--bg-card-hover) 0%, color-mix(in srgb, var(--bg-card-hover) 60%, var(--bg-page)) 40%, var(--bg-card-hover) 80%);
  background-size: 200% 100%;
  animation: shimmer 1.8s linear infinite;
}

.skeleton-line {
  height: 12px;
  border-radius: 8px;
}

.skeleton-line--title {
  height: 16px;
  width: 70%;
}

.skeleton-pills {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.skeleton-pill {
  height: 24px;
  width: 88px;
  border-radius: 999px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.prompt-card:hover {
  border-color: var(--border-medium);
  border-left-color: var(--brand-primary);
  border-top-color: var(--brand-primary);
  box-shadow: var(--shadow-elevation-2);
  transform: translateY(-2px);
}

.prompt-card:hover .prompt-card__title {
  color: var(--brand-text);
  transition: color var(--transition-fast);
}

.prompt-card:focus-visible {
  box-shadow: var(--focus-ring);
}

.prompt-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.prompt-card__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--text-primary);
}

.prompt-card__favorite {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  flex-shrink: 0;
}

.prompt-card__favorite:hover {
  color: var(--brand-yellow);
}

.prompt-card__favorite[aria-pressed="true"] {
  color: var(--brand-yellow);
}

.prompt-card__favorite .star-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.prompt-card__description {
  margin: 0;
  margin-top: -2px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prompt-card__fit {
  margin: -4px 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.prompt-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Usage Stats */





.prompt-card__signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-card__signal {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.prompt-card__signal--usecase {
  border-color: rgba(0, 153, 51, 0.22);
  background: rgba(0, 153, 51, 0.08);
  color: var(--brand-text);
}

.prompt-card__signal--new {
  border-color: rgba(9, 114, 136, 0.22);
  background: rgba(9, 114, 136, 0.10);
  color: var(--brand-teal);
}

.prompt-card__action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.prompt-card__action-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.prompt-card__inline-cta {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, transparent);
  background: var(--brand-primary-light);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  text-align: left;
  cursor: pointer;
  font: inherit;
  margin-top: 0;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-text);
}

.prompt-card__inline-cta:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 28%, transparent);
  background: color-mix(in srgb, var(--brand-primary) 14%, transparent);
  text-decoration: none;
}

.prompt-card__inline-cta:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

body[data-density="compact"] main {
  gap: 18px;
}

body[data-density="compact"] .workspace-shell,
body[data-density="compact"] .filters-section,
body[data-density="compact"] .card,
body[data-density="compact"] .active-filters-summary,
body[data-density="compact"] .mode-banner {
  padding: 16px;
}

body[data-density="compact"] .browse-toolbar-shell {
  padding: 10px 12px;
  gap: 8px;
}

body[data-density="compact"] .library-main-header--toolbar .results-header-actions {
  gap: 8px;
}

body[data-density="compact"] .workspace-shell__facts {
  gap: 10px;
}

body[data-density="compact"] .workspace-shell__fact,
body[data-density="compact"] .workspace-shell__status-card {
  padding: 12px 14px;
}

body[data-density="compact"] .library-layout {
  gap: 18px;
}

body[data-density="compact"] .prompt-grid {
  gap: 14px;
}

body[data-density="compact"] .prompt-card {
  padding: 16px;
  gap: 10px;
}

body[data-density="compact"] .filter-bar {
  padding: 0;
  gap: 8px;
}

body[data-density="compact"] .hero-search-section {
  padding: 0;
}

/* New Badge */

/* Agent Badges - Using Atea Palette */
.agent-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--agent-bg);
  color: var(--agent-color);
}

.agent-badge[data-agent="copilotChat"] {
  --agent-color: var(--agent-text-blue);
  --agent-bg: var(--brand-blue-light);
}

.agent-badge[data-agent="researcher"] {
  --agent-color: var(--agent-text-teal);
  --agent-bg: var(--brand-teal-light);
}

.agent-badge[data-agent="sales"] {
  --agent-color: var(--agent-text-orange);
  --agent-bg: var(--brand-orange-light);
}

.agent-badge[data-agent="hr"] {
  --agent-color: var(--agent-text-red);
  --agent-bg: var(--brand-red-light);
}

.agent-badge[data-agent="itSupport"] {
  --agent-color: var(--agent-text-blue);
  --agent-bg: var(--brand-blue-light);
}

.agent-badge[data-agent="finance"] {
  --agent-color: var(--agent-text-green);
  --agent-bg: var(--brand-primary-light);
}

.agent-badge[data-agent="project"] {
  --agent-color: var(--agent-text-teal);
  --agent-bg: var(--brand-teal-light);
}

.agent-badge[data-agent="legal"] {
  --agent-color: var(--agent-text-neutral);
  --agent-bg: rgba(77, 84, 89, 0.1);
}

.agent-badge[data-agent="marketing"] {
  --agent-color: var(--agent-text-orange);
  --agent-bg: var(--brand-orange-light);
}

.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--bg-page);
  color: var(--text-secondary);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 64px 32px;
}

.empty-state__icon {
  color: var(--text-muted);
  margin-bottom: 24px;
  opacity: 0.5;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-state p {
  max-width: 36ch;
  margin: 0 auto 24px;
  color: var(--text-secondary);
}

/* Buttons */
.action-button {
  appearance: none;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-button:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.action-button.primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-on-primary);
}

.action-button.primary:hover {
  background: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
}

.icon-button {
  appearance: none;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.action-button:active,
.filter-chip:active,
.icon-button:active,
.prompt-card__inline-cta:active,
.workspace-shell__settings-button:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}

.icon-button[aria-pressed="true"] {
  color: var(--brand-yellow);
}

.icon-button .star-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Detail Panel */
.prompt-detail {
  min-height: 400px;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.detail-back-button {
  appearance: none;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px 6px 8px;
  border-radius: var(--radius-md);
  transition: color var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.detail-back-button:hover {
  color: var(--brand-text);
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

.detail-actions {
  display: flex;
  gap: 8px;
}

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.detail-body-left,
.detail-body-right {
  min-width: 0;
}

.detail-body-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-body-right .tips-section,
.detail-body-right .tags-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
}

@media (max-width: 980px) {
  .detail-body-grid {
    grid-template-columns: 1fr;
  }
}

.detail-copy-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}

[data-theme="dark"] .detail-copy-bar,
[data-theme="midnight"] .detail-copy-bar,
[data-theme="carbon"] .detail-copy-bar,
[data-theme="cyberpunk"] .detail-copy-bar,
[data-theme="neon"] .detail-copy-bar,
[data-theme="sunset"] .detail-copy-bar {
  background: rgba(26, 28, 30, 0.82);
}

.detail-copy-bar__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 10px;
}

.detail-copy-bar__inner .action-button {
  flex: 1;
  justify-content: center;
}

@media (max-width: 980px) {
  .detail-copy-bar {
    display: block;
  }

  main.detail-view-active {
    padding-bottom: calc(64px + 88px + env(safe-area-inset-bottom));
  }
}

.detail-title-section h2 {
  margin: 12px 0 8px;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.detail-description {
  margin: 0 0 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 64ch;
}


/* Placeholder Section */
.placeholder-section {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-elevation-1);
}

.placeholder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.placeholder-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.placeholder-toggle {
  display: none;
}

.placeholder-toggle svg {
  transition: transform var(--transition);
}

.placeholder-toggle[aria-expanded="false"] svg {
  transform: rotate(-90deg);
}

.placeholder-warning {
  border: 1px solid rgba(246, 189, 24, 0.45);
  background: rgba(246, 189, 24, 0.10);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 12px;
}

.placeholder-unmanaged {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  margin-left: 8px;
}

.placeholder-header__titles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.placeholder-section h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.placeholder-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.placeholder-count[data-complete="true"] {
  color: var(--placeholder-filled-text);
}

.placeholder-reset {
  padding: 8px 12px;
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
}

.placeholder-reset:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.placeholder-hint {
  margin: 0 0 20px;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.placeholder-form {
  display: grid;
  gap: 16px;
}

@media (max-width: 980px) {
  .placeholder-toggle {
    display: inline-flex;
  }
}

.placeholder-field {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.placeholder-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.placeholder-field label .required {
  color: var(--placeholder-unfilled-text);
}

.placeholder-field input,
.placeholder-field select,
.placeholder-field textarea {
  appearance: none;
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 14px;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all var(--transition);
}

.placeholder-field input:focus,
.placeholder-field select:focus,
.placeholder-field textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: var(--focus-ring);
  outline: none;
}

.placeholder-field input::placeholder,
.placeholder-field textarea::placeholder {
  color: var(--text-muted);
}

.placeholder-field textarea {
  resize: vertical;
  min-height: 80px;
}

.placeholder-field.error input,
.placeholder-field.error select,
.placeholder-field.error textarea {
  border-color: var(--brand-red);
}

/* Preview Section */
.preview-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-elevation-1);
}

.preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--bg-page) 70%, var(--bg-card));
  border-bottom: 1px solid var(--border-light);
}

.preview-header__titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.preview-header__eyebrow,
.placeholder-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.preview-header__eyebrow {
  color: var(--brand-text);
}

.preview-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.prompt-launch-targets {
  display: inline-flex;
  position: relative;
}

.prompt-launch-menu {
  position: relative;
  display: inline-flex;
}

.prompt-launch-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10000;
  min-width: max(220px, 100%);
  padding: 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-elevation-3);
}

.prompt-launch-menu__item {
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-color: transparent;
  background: transparent;
  text-align: left;
}

.prompt-launch-menu__item:hover,
.prompt-launch-menu__item:focus-visible {
  background: var(--bg-subtle);
}

.prompt-launch-menu__item::before {
  width: 1rem;
  flex: 0 0 1rem;
  color: var(--text-muted);
  text-align: center;
}

.prompt-launch-menu__item--launch::before {
  content: "\2197";
}

.prompt-launch-menu__item[data-menu-icon="copy"]::before {
  content: "\29C9";
}

.prompt-launch-menu__item[data-menu-icon="download"]::before {
  content: "\2193";
}

.prompt-launch-menu__item[data-menu-icon="code"]::before {
  content: "\2318";
}

.prompt-launch-menu__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.prompt-launch-menu__label {
  color: var(--text-primary);
}

.prompt-launch-menu__description {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.prompt-launch-menu__trigger {
  list-style: none;
}

.prompt-launch-menu__trigger::-webkit-details-marker {
  display: none;
}

.prompt-launch-menu__trigger::after {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 5px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  content: "";
}

.detail-copy-bar .prompt-launch-targets,
.detail-copy-bar .prompt-launch-targets > .action-button,
.detail-copy-bar .prompt-launch-menu,
.detail-copy-bar .prompt-launch-menu__trigger {
  flex: 1;
}

.preview-action-secondary {
  border-color: var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
}

.preview-action-secondary:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.preview-header h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.preview-header__subtitle,
.placeholder-subtitle {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.preview-content {
  padding: 24px;
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
  max-height: 480px;
  overflow-y: auto;
  margin: 0;
}

.preview-content--code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.65;
}

.placeholder-unfilled {
  background: var(--placeholder-unfilled-bg);
  color: var(--placeholder-unfilled-text);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: help;
  text-decoration: underline dashed;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.placeholder-unfilled:hover {
  background: color-mix(in srgb, var(--brand-orange) 18%, var(--bg-card));
}

.placeholder-filled {
  background: var(--placeholder-filled-bg);
  color: var(--placeholder-filled-text);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 550;
  cursor: help;
}

.placeholder-token--required {
  background: var(--placeholder-unfilled-bg);
  color: var(--placeholder-unfilled-text);
}

@keyframes placeholder-just-filled {
  from { background: color-mix(in srgb, var(--brand-primary) 30%, var(--bg-card)); }
  to { background: var(--placeholder-filled-bg); }
}

.placeholder-filled.is-just-filled {
  animation: placeholder-just-filled 600ms ease-out;
}

.placeholder-token--unmanaged {
  outline: 1px solid rgba(245, 184, 0, 0.85);
  outline-offset: -1px;
}

.placeholder-unfilled.is-active,
.placeholder-filled.is-active {
  box-shadow: 0 0 0 2px rgba(9, 114, 136, 0.35);
}

@media (max-width: 720px) {
  .preview-actions,
  .preview-actions > .action-button,
  .preview-actions > .prompt-launch-targets,
  .preview-actions .prompt-launch-menu,
  .preview-actions .prompt-launch-menu__trigger {
    width: 100%;
  }

  .preview-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-actions .action-button {
    justify-content: center;
  }
}

/* Tips & Tags */
.tips-section h3,
.tags-section h3 {
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.tips-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tips-list li {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.tips-list li::marker {
  color: var(--brand-text);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  background: var(--bg-page);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.tag:hover {
  border-color: var(--border-medium);
}

/* Settings Drawer. It is modal, so it lies over the non-modal Feedback panel (1100: its minimized Reopen bar covered
   the footer's Close button) and under the other modals (1200) and the tour (1250). */
.settings-drawer {
  position: fixed;
  inset: 0;
  z-index: 1150;
  display: flex;
  justify-content: flex-end;
}

.settings-drawer[hidden] {
  display: none;
}

.settings-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.settings-drawer.is-open .settings-drawer__backdrop {
  opacity: 1;
}

.settings-drawer__panel {
  position: relative;
  width: min(460px, 100%);
  height: 100%;
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  border-top: 3px solid var(--brand-primary);
  box-shadow: var(--shadow-elevation-3), -20px 0 60px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.settings-drawer.is-open .settings-drawer__panel {
  transform: translateX(0);
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-panel-enter {
  animation: fadeSlideIn 200ms ease both;
}

.settings-drawer__header,
.settings-drawer__footer {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-drawer__footer {
  margin-top: auto;
  border-bottom: 0;
  border-top: 1px solid var(--border-light);
}

.settings-drawer__eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-drawer__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.settings-drawer__body {
  padding: 24px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.settings-drawer__description {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* Settings: every section has the same heading and the same space under it; a row is a label, its control and a
   short help line. */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-section__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.settings-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.settings-row__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.settings-row__help {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* Default sort: an ordinary, enabled select with the shared chevron. */
.settings-select {
  appearance: none;
  min-height: 44px;
  min-width: 14rem;
  max-width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2.22 4.47a.75.75 0 0 1 1.06 0L6 7.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L2.22 5.53a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.settings-select:hover {
  border-color: var(--border-focus);
}

.settings-select:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

/* Show context panel: a switch with its label and help on the left. */
.settings-switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-switch-row__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin-top: 2px;
  padding: 0;
  border: 1px solid var(--border-medium);
  border-radius: 999px;
  background: var(--bg-input);
  cursor: pointer;
}

/* A 44 px target around the 26 px track. */
.settings-switch::before {
  content: '';
  position: absolute;
  inset: -9px 0;
}

.settings-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: transform var(--transition);
}

.settings-switch[aria-checked="true"] {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
}

.settings-switch[aria-checked="true"] .settings-switch__thumb {
  transform: translateX(18px);
  background: #fff;
}

.settings-switch:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

/* Footer: Reset preferences is a quiet link that asks before it clears anything. */
.settings-reset {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.settings-reset__link {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  align-self: flex-start;
}

.settings-reset__link:hover {
  color: var(--text-primary);
}

.settings-reset__link:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

.settings-reset__question {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.settings-reset__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-reset__confirm[hidden],
.settings-reset__link[hidden] {
  display: none;
}

.settings-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg-card) 90%, var(--bg-page));
}

.settings-toggle input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
}

.settings-toggle strong {
  display: block;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.settings-toggle small {
  display: block;
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 16px 20px;
  box-shadow: var(--shadow-elevation-3);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toast-in 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 360px;
}

.toast.success {
  border-left: 3px solid var(--brand-primary);
}

.toast.warning {
  border-left: 3px solid var(--brand-yellow);
}

.toast.error {
  border-left: 3px solid var(--brand-red);
}

.toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast.success .toast__icon {
  color: var(--brand-text);
}

.toast.warning .toast__icon {
  color: var(--brand-yellow);
}

.toast.error .toast__icon {
  color: var(--brand-red);
}

.toast__message {
  font-size: 0.875rem;
  color: var(--text-primary);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Page load entrance */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.workspace-shell__topbar { animation: fadeInUp 400ms ease both; }
.workspace-shell__intro { animation: fadeInUp 400ms ease 80ms both; }
.library-layout { animation: fadeInUp 400ms ease 160ms both; }

/* (P12: an exact-duplicate reduced-motion block lived here; the "Reduced motion" section owns it now.) */

.load-more {
  display: flex;
  justify-content: center;
  padding: 20px 0 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-search-section,
  .filter-bar,
  .browse-toolbar-shell {
    display: none;
  }

  main {
    padding: 16px 16px 48px;
    gap: 16px;
  }

  .workspace-shell {
    padding: 12px 0 16px;
  }

  .workspace-shell__topbar {
    margin-bottom: 16px;
  }

  .workspace-shell__content {
    grid-template-columns: 1fr;
  }

  .workspace-shell__facts {
    grid-template-columns: 1fr;
  }

  .workspace-shell__title {
    font-size: 1.6rem;
  }

  .workspace-shell__subtitle {
    font-size: 0.85rem;
  }

  .brand-watermark,
  .atea-watermark {
    display: none;
  }

  .hero-search input {
    padding: 14px 48px 14px 44px;
    font-size: 0.9375rem;
  }

  .filters-section {
    padding: 16px;
  }


  .pills-label {
    display: none;
  }

  .category-pill,
  .agent-pill {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .results-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .library-main-header--toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .card {
    padding: 16px;
  }

  .prompt-grid {
    grid-template-columns: 1fr;
  }

  .prompt-card__action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .prompt-card__action-hint {
    white-space: normal;
  }

  .preview-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }


  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    max-width: none;
  }

  .settings-drawer {
    justify-content: stretch;
  }

  .settings-drawer__panel {
    width: 100%;
  }

}

@media (max-width: 480px) {
  .workspace-shell__title {
    font-size: 1.25rem;
  }

  .sort-control select {
    flex: 1;
    min-width: 0;
  }

  .favorites-toggle,
  .results-action-button,
  .submit-prompt-button {
    flex: 1;
    justify-content: center;
  }

  .library-main-header {
    align-items: stretch;
  }

  .detail-title-section h2 {
    font-size: 1.25rem;
  }

}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.modal.is-open .modal__backdrop {
  opacity: 1;
}

.modal__dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  box-shadow: var(--shadow-elevation-3);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 200ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 980px) {
  .modal__dialog {
    width: min(1120px, calc(100vw - 64px));
  }
}

.modal.is-open .modal__dialog {
  opacity: 1;
  transform: scale(1);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-light) 60%, transparent);
}

.modal__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.modal__body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-intro {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-page);
}

.modal-intro__eyebrow,
.submit-section__eyebrow,
.review-inbox__eyebrow,
.review-card__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.modal-intro__copy {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.submission-draft-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 24%, var(--border-light));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--brand-primary) 8%, var(--bg-card));
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.submission-draft-notice__dismiss {
  border: 0;
  background: transparent;
  color: var(--brand-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 0;
}

.submission-draft-notice__dismiss:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.submit-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.submit-section__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 20px;
  align-items: flex-start;
}

.submit-section__title {
  margin: 2px 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.submit-section__description {
  margin: 0;
  max-width: 360px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.submit-section__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.submit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.submit-section--prompt,
.submit-section--details {
  min-width: 0;
}

.submit-section--prompt .submit-section__body {
  min-height: 100%;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-field__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-field__header label {
  margin: 0;
}

.modal-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.modal-field input,
.modal-field textarea,
.modal-field select {
  appearance: none;
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 14px;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all var(--transition);
}

.modal-field input:focus,
.modal-field textarea:focus,
.modal-field select:focus {
  border-color: var(--brand-primary);
  box-shadow: var(--focus-ring);
  outline: none;
}

.modal-field--prompt {
  min-height: 0;
}

.modal-field--prompt textarea {
  min-height: 360px;
  resize: vertical;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}


@media (max-width: 640px) {
  .modal-grid {
    grid-template-columns: 1fr;
  }
}



.action-button.action-button--compact {
  padding: 6px 10px;
  font-size: 0.8125rem;
}

.submit-placeholder {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
}

.submit-placeholder__row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.submit-placeholder__row input {
  flex: 1 1 auto;
  min-width: 0;
}

.submit-placeholder__preview {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.submit-helper {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 153, 51, 0.16);
  background: rgba(0, 153, 51, 0.06);
}

.submit-helper__copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.submit-helper__copy strong {
  color: var(--text-primary);
  font-size: 0.875rem;
}

.submit-helper__copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.submit-helper code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(0, 0, 0, 0.04);
  padding: 0 6px;
  border-radius: 6px;
}

/* ---------- Prompt submit: attachments ---------- */
.modal-field__optional {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
}

.submit-attachments {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
}

.submit-attachments__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--color-surface);
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}

.submit-attachments__trigger:hover {
  background: var(--color-surface-alt);
  border-color: var(--text-muted);
}

.submit-attachments__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 0;
}

.submit-attachment-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: var(--color-surface-alt);
  font-size: 0.8125rem;
  color: var(--text-primary);
  max-width: 220px;
}

.submit-attachment-item__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submit-attachment-item__size {
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.submit-attachment-item__remove {
  appearance: none;
  background: none;
  border: none;
  padding: 0 0 0 2px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.submit-attachment-item__remove:hover {
  color: var(--color-danger, #c91b1b);
}

.submit-attachments__hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  width: 100%;
}

[data-theme="dark"] .filter-bar__agent-select,
[data-theme="midnight"] .filter-bar__agent-select,
[data-theme="carbon"] .filter-bar__agent-select,
[data-theme="cyberpunk"] .filter-bar__agent-select,
[data-theme="neon"] .filter-bar__agent-select,
[data-theme="sunset"] .filter-bar__agent-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a9199' d='M2.22 4.47a.75.75 0 011.06 0L6 7.19l2.72-2.72a.75.75 0 011.06 1.06L6.53 8.78a.75.75 0 01-1.06 0L2.22 5.53a.75.75 0 010-1.06z'/%3E%3C/svg%3E");
}






@media (max-width: 980px) {
  .submit-layout {
    grid-template-columns: 1fr;
  }

  .modal-field--prompt textarea {
    min-height: 300px;
  }
}




.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.workspace-shell--admin {
  margin-bottom: 20px;
}

.workspace-shell__status-card--admin {
  align-self: stretch;
}

.review-inbox {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
}

.review-inbox__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 24px;
  align-items: flex-end;
}

.review-inbox__copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 560px;
}

.review-inbox__title {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 750;
  color: var(--text-primary);
}

.review-inbox__subtitle {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.review-inbox__controls {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.review-inbox__select {
  min-width: 180px;
}

.m365-sync-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 22%, var(--border-light));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--brand-primary) 7%, var(--bg-card));
}

.m365-sync-status strong {
  color: var(--text-primary);
  font-size: 14px;
}

.m365-sync-status span {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.review-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--brand-blue) 22%, var(--border-light));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--brand-blue) 6%, var(--bg-card));
}

.review-bulk-bar__select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.review-bulk-bar__count {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.review-bulk-bar .action-button {
  margin-left: auto;
}

.review-card__select {
  display: inline-flex;
  align-items: flex-start;
  padding-top: 2px;
}

.review-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.review-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.review-card__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 20px;
  align-items: flex-start;
}

.review-card__title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.review-card__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.review-card__description {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
}

.review-card__status {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.review-card__status[data-status="pending"] {
  background: rgba(223, 156, 0, 0.10);
  border-color: rgba(223, 156, 0, 0.18);
  color: #8a5d00;
}

.review-card__status[data-status="approved"] {
  background: rgba(0, 153, 51, 0.10);
  border-color: rgba(0, 153, 51, 0.18);
  color: var(--brand-text);
}

.review-card__status[data-status="rejected"] {
  background: rgba(184, 60, 60, 0.10);
  border-color: rgba(184, 60, 60, 0.18);
  color: var(--danger-text);
}

.review-card__status[data-status="changes-requested"] {
  background: rgba(20, 99, 181, 0.10);
  border-color: rgba(20, 99, 181, 0.18);
  color: var(--info-text);
}

.review-card__status[data-status="superseded"] {
  background: rgba(95, 107, 125, 0.10);
  border-color: rgba(95, 107, 125, 0.18);
  color: var(--text-secondary);
}

.review-card__meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.review-card__meta-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-page);
}

.review-card__meta-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.review-card__meta-value {
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.review-card__prompt {
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}

.review-card__prompt summary {
  cursor: pointer;
  list-style: none;
  color: var(--brand-text);
  font-weight: 600;
}

.review-card__prompt summary::-webkit-details-marker {
  display: none;
}

.review-card__prompt summary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 8px;
}

.review-card__content {
  white-space: pre-wrap;
  margin: 12px 0 0;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.65;
}

.review-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

/* Inline rejection panel */
.reject-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(184, 60, 60, 0.25);
  border-radius: var(--radius-lg);
  background: rgba(184, 60, 60, 0.04);
}

.reject-panel__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reject-panel__icon {
  flex-shrink: 0;
  color: #b83c3c;
}

.reject-panel__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--danger-text);
}

.reject-panel__copy {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.reject-panel__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.reject-panel__textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(184, 60, 60, 0.25);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.reject-panel__textarea:focus {
  outline: none;
  border-color: #b83c3c;
  box-shadow: 0 0 0 3px rgba(184, 60, 60, 0.15);
}

.reject-panel__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.reject-panel--changes {
  border-color: rgba(20, 99, 181, 0.24);
  background: rgba(20, 99, 181, 0.045);
}

.reject-panel--changes .reject-panel__icon,
.reject-panel--changes .reject-panel__title {
  color: var(--info-text);
}

.action-button--destructive {
  background: rgba(184, 60, 60, 0.08);
  border-color: rgba(184, 60, 60, 0.30);
  color: var(--danger-text);
}

.action-button--destructive:hover {
  background: #b83c3c;
  border-color: #b83c3c;
  color: #fff;
}

/* Submitter-facing submission status */
.submissions-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.submissions-list {
  display: grid;
  gap: 16px;
}

.submissions-empty {
  padding: 24px;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-page);
  color: var(--text-secondary);
}

.submissions-empty h3 {
  margin: 0 0 6px;
  color: var(--text-primary);
}

.submissions-empty p {
  margin: 0;
}

.submission-status-card {
  box-shadow: none;
}

.submission-rejection {
  padding: 16px;
  border: 1px solid rgba(184, 60, 60, 0.20);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(184, 60, 60, 0.06), rgba(184, 60, 60, 0.025));
}

.submission-rejection h4 {
  margin: 0 0 8px;
  color: var(--danger-text);
  font-size: 0.9375rem;
}

.submission-rejection p {
  margin: 0;
  color: var(--text-primary);
  line-height: 1.6;
}

.submission-changes-requested {
  border-color: rgba(20, 99, 181, 0.20);
  background: linear-gradient(135deg, rgba(20, 99, 181, 0.06), rgba(20, 99, 181, 0.025));
}

.submission-changes-requested h4 {
  color: var(--info-text);
}

.submission-resubmit-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 12px;
}

.submission-status-card__published {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 153, 51, 0.08);
  color: var(--brand-text);
  font-weight: 700;
}

.review-card__media {
  margin-bottom: 10px;
}

.review-card__media-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  display: block;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body[data-reduce-motion="true"] *,
body[data-reduce-motion="true"] *::before,
body[data-reduce-motion="true"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

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

@media (max-width: 720px) {
  .submit-section,
  .review-inbox {
    padding: 18px;
  }

  .submit-section__header,
  .review-inbox__header,
  .review-card__header {
    flex-direction: column;
  }

  .review-card__meta-grid {
    grid-template-columns: 1fr;
  }

  .review-card__actions,
  .review-inbox__controls,
  .review-bulk-bar {
    width: 100%;
    justify-content: stretch;
  }

  .review-card__actions .action-button,
  .review-inbox__controls .action-button,
  .review-inbox__controls .sort-control {
    width: 100%;
  }

  .review-bulk-bar .action-button {
    margin-left: 0;
    width: 100%;
  }

  .submit-placeholder__row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* =====================================================================
   AI Hub v1 : shell, pages, home, collections
   ===================================================================== */

:root {
  /* Semantic color layer on top of Atea brand tokens */
  --color-surface: var(--bg-card);
  --color-surface-alt: var(--bg-subtle);
  --color-surface-muted: var(--bg-page);
  --color-accent: var(--brand-primary);
  --color-accent-hover: var(--brand-primary-hover);
  --color-accent-soft: var(--brand-primary-light);
  --color-info: var(--brand-blue);
  --color-info-soft: var(--brand-blue-light);
  --color-warning: var(--brand-yellow);
  --color-warning-soft: var(--brand-yellow-light);
  --color-danger: var(--brand-red);
  --color-danger-soft: var(--brand-red-light);
  --color-success: var(--brand-primary);
  --color-success-soft: var(--brand-primary-light);
  --hub-header-h: 64px;
  --hub-max-width: 1400px;
}

/* Main needs to flow below the sticky hub header */
body:has(.hub-header) main {
  padding-top: 24px;
}

/* ---------- Hub header ---------- */
.hub-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  backdrop-filter: saturate(1.2);
}

.hub-header__inner {
  max-width: var(--hub-max-width);
  margin: 0 auto;
  padding: 0 20px;
  min-height: var(--hub-header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

.hub-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.015em;
  padding: 6px 4px;
  border-radius: var(--radius-md);
}

.hub-header__brand:hover {
  color: var(--color-accent);
}

.hub-header__brand-logo {
  height: 18px;
  width: auto;
}

.hub-header__brand-logo--dark { display: none; }

[data-theme="dark"] .hub-header__brand-logo--light,
[data-theme="midnight"] .hub-header__brand-logo--light,
[data-theme="carbon"] .hub-header__brand-logo--light,
[data-theme="cyberpunk"] .hub-header__brand-logo--light,
[data-theme="neon"] .hub-header__brand-logo--light,
[data-theme="sunset"] .hub-header__brand-logo--light { display: none; }

[data-theme="dark"] .hub-header__brand-logo--dark,
[data-theme="midnight"] .hub-header__brand-logo--dark,
[data-theme="carbon"] .hub-header__brand-logo--dark,
[data-theme="cyberpunk"] .hub-header__brand-logo--dark,
[data-theme="neon"] .hub-header__brand-logo--dark,
[data-theme="sunset"] .hub-header__brand-logo--dark { display: inline; }

.hub-header__brand-wordmark {
  font-weight: 600;
}

.hub-nav {
  display: flex;
  gap: 2px;
  justify-self: center;
  flex-wrap: wrap;
}

.hub-nav__link {
  position: relative;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  line-height: 1;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.hub-nav__link:hover {
  color: var(--text-primary);
  background: var(--color-surface-alt);
}

.hub-nav__link[aria-current="page"] {
  color: var(--text-primary);
  background: var(--color-accent-soft);
}

.hub-nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -13px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
}

.hub-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.hub-header__submit {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
}

.hub-header__settings {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.hub-header__settings:hover {
  background: var(--color-surface-alt);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.hub-header__auth {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

/* ---------- Page routing: show only the active hub page ---------- */
.hub-page {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.hub-page.is-active {
  display: flex;
}

.hub-page__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0 4px;
}

.hub-page__header--with-action {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.hub-page__header--with-action .hub-page__header-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hub-page__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hub-page__subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 68ch;
}

/* ---------- Skills ---------- */
.skills-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.skills-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.skills-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}

.skills-filter-chip:hover {
  border-color: var(--brand-primary);
  color: var(--text-primary);
}

.skills-filter-chip.is-active {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

.skills-sort-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -8px;
}

.skills-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skills-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.skills-panel__title {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

.skills-panel__copy,
.skills-submit__hint,
.skills-detail__description,
.skills-empty,
.skills-submit__selected {
  margin: 0;
  color: var(--text-secondary);
}

.skills-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.skill-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  height: 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-fast);
}

.skill-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.skill-card__type {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: var(--font-mono, monospace);
  padding: 4px 9px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--brand-blue) 10%, var(--bg-subtle));
  color: var(--brand-blue);
  border: 1px solid color-mix(in srgb, var(--brand-blue) 22%, transparent);
}

.skill-card__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.skill-card__tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.skill-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-elevation-1);
  transform: translateY(-1px);
}

.skill-card.is-active {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-elevation-2);
}

.skill-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--brand-primary) 12%, var(--bg-subtle));
  color: var(--brand-text);
  font-size: 1.3rem;
  font-weight: 700;
  overflow: hidden;
}

.skill-card__icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


.skill-card__title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 8px;
}

.skill-card__description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}



.skill-card__source {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  background: var(--bg-subtle);
  color: var(--text-muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  margin-top: 14px;
  gap: 8px;
}


.skill-card__action {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.skills-detail__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.skills-detail__eyebrow {
  margin: 0 0 6px;
  color: var(--brand-text);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skills-detail__title {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.skills-detail__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.skills-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.skills-meta__item {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
}

.skills-meta__item dt {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skills-meta__item dd {
  margin: 0;
  color: var(--text-primary);
}

.skills-source {
  margin: 0;
  min-height: 360px;
  max-height: 68vh;
  overflow: auto;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: color-mix(in srgb, var(--bg-card) 84%, var(--brand-blue-light));
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Skill source syntax highlighting (backlog B7) — colors the markdown syntax
   itself; the raw characters (#, **, `, etc.) stay on screen exactly as
   submitted, this only recolors them per line/token. */
.skills-source__line {
  display: inline;
}

.skills-source__heading {
  color: var(--brand-text);
  font-weight: 700;
}

.skills-source__fence {
  color: var(--text-muted);
}

.skills-source__code-block {
  color: var(--brand-blue);
}

.skills-source__list {
  color: var(--text-primary);
}

.skills-source__quote {
  color: var(--text-secondary);
  font-style: italic;
}

.skills-source__bold {
  color: var(--text-primary);
  font-weight: 700;
}

.skills-source__code {
  color: var(--brand-blue);
  background: color-mix(in srgb, var(--brand-blue) 12%, transparent);
  border-radius: 3px;
  padding: 0 2px;
}


.skills-submit__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skills-submit__hint code {
  font-size: 0.88em;
}

.skills-submit__status {
  min-height: 1.5em;
  color: var(--text-secondary);
}

.skills-submit__status[data-tone="error"] {
  color: var(--brand-red);
}

.skills-submit__status[data-tone="success"] {
  color: var(--brand-text);
}

@media (max-width: 960px) {
  .skills-shell {
    gap: 16px;
  }

  .skills-panel__header,
  .skills-detail__header {
    flex-direction: column;
  }

  .skills-meta {
    grid-template-columns: 1fr;
  }

  .skills-detail__actions {
    width: 100%;
  }

  .skills-detail__actions .action-button {
    flex: 1 1 160px;
  }
}

/* ---------- Home ---------- */
.home-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 48px 0 24px;
  max-width: 760px;
}

.home-hero__eyebrow {
  margin: 0;
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-hero__eyebrow:empty {
  display: none;
}

.home-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text-primary);
}

.home-hero__subtitle {
  margin: 0;
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 58ch;
}

.home-hero__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.home-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0;
}

.home-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.home-section__header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.015em;
}

.home-section__link {
  color: var(--color-accent);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.home-section__link:hover { text-decoration: underline; }

.home-trending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.home-trending-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--color-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.home-trending-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-elevation-2);
  transform: translateY(-1px);
}

.home-trending-card__category {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  padding: 4px 8px;
  border-radius: 999px;
}

.home-trending-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.home-trending-card__description {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-trending-card__footer {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
}

.home-trending-card__agent {
  font-weight: 500;
  color: var(--text-secondary);
}

.home-trending-empty {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

.home-discover__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.home-discover__card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  grid-template-rows: auto 1fr auto;
  column-gap: 10px;
  row-gap: 10px;
  padding: 22px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.home-discover__card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-elevation-2);
  transform: translateY(-1px);
}

.home-discover__badge {
  position: static;
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--color-surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  max-width: 100%;
  white-space: nowrap;
}

.home-discover__badge--live {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border-color: transparent;
}

.home-discover__card h3 {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.home-discover__card p {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.home-discover__cta {
  grid-column: 1 / -1;
  grid-row: 3;
  padding-top: 6px;
  color: var(--color-accent);
  font-size: 14px;
  font-weight: 500;
}

/* ---------- Coming soon ---------- */
.coming-soon-panel {
  padding: 32px;
  background: var(--color-surface);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 760px;
}

.coming-soon-panel--compact {
  padding: 24px;
  margin-top: 8px;
}


.coming-soon-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.015em;
}

.coming-soon-panel p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.55;
}


.inline-link-button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: var(--color-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inline-link-button:hover {
  color: var(--color-accent-hover);
}

/* ---------- My Collection ---------- */
.collection-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0;
  margin-top: 8px;
}

.collection-tab {
  appearance: none;
  background: none;
  border: 0;
  color: var(--text-secondary);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.collection-tab:hover:not(:disabled) {
  color: var(--text-primary);
}

.collection-tab.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--color-accent);
}

.collection-tab:disabled,
.collection-tab[aria-disabled="true"] {
  color: var(--text-muted);
  cursor: not-allowed;
}

.collection-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--color-surface-alt);
  color: var(--text-secondary);
}

.collection-tab.is-active .collection-tab__count {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.collection-tab__meta {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.my-collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.my-collection-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--color-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.my-collection-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-elevation-2);
  transform: translateY(-1px);
}

.my-collection-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.my-collection-card__agent {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  padding: 3px 8px;
  border-radius: 999px;
}

.my-collection-card__unfavorite {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 4px;
  color: var(--brand-yellow);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
}

.my-collection-card__unfavorite:hover {
  background: var(--color-surface-alt);
  color: var(--text-muted);
}

.my-collection-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.my-collection-card__description {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.my-collection-card__footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.my-collection-card__open {
  color: var(--color-accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.my-collection-card__open:hover { text-decoration: underline; }

.my-collection-empty {
  padding: 56px 24px;
  background: var(--color-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.my-collection-empty .empty-state__icon {
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* ---------- About ---------- */
.about-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1120px;
  padding-top: 8px;
}

.about-lead {
  max-width: 780px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.65;
}

.about-block h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.about-block p {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.about-block p:last-child { margin-bottom: 0; }

.about-block h3,
.about-callout h2,
.about-official-guidance h2 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text-primary);
}

.about-block h3 { font-size: 15px; }

.about-callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid;
  border-left-width: 4px;
  border-radius: var(--radius-lg);
}

.about-callout--important {
  color: var(--about-info-text);
  background: var(--about-info-bg);
  border-color: var(--about-info-border);
}

.about-callout--warning {
  color: var(--about-warning-text);
  background: var(--about-warning-bg);
  border-color: var(--about-warning-border);
}

.about-callout__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 800;
  line-height: 1;
}

.about-callout h2 {
  color: inherit;
  font-size: 17px;
}

.about-callout p {
  margin: 5px 0 0;
  color: inherit;
  font-size: 14px;
  line-height: 1.55;
}

.about-governance {
  display: flex;
  flex-direction: column;
  gap: 32px;
}





/* ---------- Dark theme tweaks for hub surfaces ---------- */
[data-theme="dark"] .hub-header,
[data-theme="midnight"] .hub-header,
[data-theme="carbon"] .hub-header,
[data-theme="cyberpunk"] .hub-header,
[data-theme="neon"] .hub-header,
[data-theme="sunset"] .hub-header {
  background: var(--bg-card);
  border-bottom-color: var(--border-light);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hub-header__inner {
    grid-template-columns: auto 1fr auto;
    padding: 0 16px;
    gap: 12px;
  }

  .hub-nav {
    gap: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    justify-self: center;
  }

  .hub-nav::-webkit-scrollbar { display: none; }

  .hub-nav__link {
    padding: 10px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .hub-nav__link[aria-current="page"]::after {
    bottom: -11px;
  }

  .hub-header__brand-wordmark { display: none; }

  .hub-header__settings { display: none; }

  .hub-header__submit {
    padding: 7px 12px;
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .home-hero { padding: 32px 0 16px; }
  .home-hero__title { font-size: 32px; }
  .home-hero__subtitle { font-size: 15px; }

  .hub-header__inner {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .hub-header__brand { grid-column: 1 / 2; }
  .hub-header__actions { grid-column: 2 / 3; }

  .hub-nav {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
    padding: 4px 0 10px;
    border-top: 1px solid var(--border-light);
    justify-self: stretch;
  }

  .hub-nav__link[aria-current="page"]::after { bottom: -6px; }


  .collection-tab__meta { display: none; }
}

/* =====================================================================
   Agent Hotel v3 : content split (Use Cases, Prompt Library, Agents)
   + selective v2 carry-over (drawer__strip, classification chips, pull-quote)
   ===================================================================== */

/* ---------- Home Discover: five-area catalog ---------- */
.home-discover__grid--catalog {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

@media (max-width: 560px) {
  .home-discover__grid--catalog { grid-template-columns: 1fr; }
}

[data-usecase-submit-panel] .modal__dialog {
  width: min(720px, 100%);
}

/* ---------- Use Cases (how-to) placeholder cards ---------- */
.howto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.howto-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.howto-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-elevation-2);
  transform: translateY(-1px);
}

.howto-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--brand-primary-light), color-mix(in srgb, var(--brand-teal) 12%, var(--bg-page)));
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--border-light);
  color: var(--brand-text);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.howto-card__media-placeholder {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: color-mix(in srgb, var(--brand-primary) 70%, var(--text-secondary));
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-pill, 999px);
}

[data-theme="dark"] .howto-card__media-placeholder,
[data-theme="midnight"] .howto-card__media-placeholder,
[data-theme="carbon"] .howto-card__media-placeholder,
[data-theme="cyberpunk"] .howto-card__media-placeholder,
[data-theme="neon"] .howto-card__media-placeholder,
[data-theme="sunset"] .howto-card__media-placeholder {
  background: rgba(0, 0, 0, 0.35);
  color: color-mix(in srgb, var(--brand-primary) 80%, #fff);
}

.howto-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px 18px;
}

.howto-card__category {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-text);
  background: var(--brand-primary-light);
  padding: 4px 10px;
  border-radius: 999px;
}

.howto-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.3;
}

.howto-card__description {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.howto-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: auto;
}

.howto-card__cta {
  color: var(--brand-text);
  font-weight: 600;
}

.howto-card__cta[data-cta-pending] {
  opacity: 0.6;
  cursor: default;
}

.howto-footnote {
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- Drawer 4-cell meta strip (v2 carry-over) ---------- */
.drawer__strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 16px 0;
  background: var(--bg-card);
}

.drawer__strip-cell {
  padding: 10px 14px;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.drawer__strip-cell:last-child {
  border-right: 0;
}

.drawer__strip-cell dt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

.drawer__strip-cell dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 760px) {
  .drawer__strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .drawer__strip-cell:nth-child(2n) { border-right: 0; }
  .drawer__strip-cell:nth-child(-n+2) {
    border-bottom: 1px solid var(--border-light);
  }
}

/* ---------- Agents page ---------- */
.agent-hotel__h {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.brand-pull-quote,
.atea-pull-quote {
  margin: 0;
  padding: 24px 28px;
  border-left: 4px solid var(--brand-primary);
  background: var(--bg-card);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.brand-pull-quote::before,
.atea-pull-quote::before {
  content: '\201C';
  position: absolute;
  top: -12px;
  left: 14px;
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1;
  color: var(--brand-primary-light);
  font-weight: 900;
}

.brand-pull-quote p,
.atea-pull-quote p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-pull-quote cite,
.atea-pull-quote cite {
  font-style: normal;
  color: var(--text-muted);
  font-size: 13px;
}

.agent-hotel__grid-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.agent-hotel__grid-meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.agent-hotel__grid-meta a {
  color: var(--brand-text);
  font-weight: 500;
}

.agent-hotel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.agent-hotel-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.agent-hotel-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-elevation-2);
  transform: translateY(-1px);
}

.agent-hotel-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.agent-hotel-card__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.agent-hotel-card__logo {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 28%, var(--border-light));
  background: color-mix(in srgb, var(--brand-primary) 10%, var(--bg-card));
  color: var(--brand-text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  object-fit: contain;
}

.agent-hotel-card__logo--fallback {
  font-family: var(--font-display);
}

.agent-hotel-card__class {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--text-muted) 12%, var(--bg-card));
  color: var(--text-secondary);
  border-radius: 999px;
}

.agent-hotel-card__class-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.agent-hotel-card__class--open .agent-hotel-card__class-dot { background: var(--brand-primary); }
.agent-hotel-card__class--internal .agent-hotel-card__class-dot { background: var(--brand-blue); }
.agent-hotel-card__class--restricted .agent-hotel-card__class-dot { background: var(--brand-orange); }
.agent-hotel-card__class--confidential .agent-hotel-card__class-dot { background: var(--brand-red); }

.agent-hotel-card__source {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.agent-hotel-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text-primary);
}

.agent-hotel-card__description {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  flex: 1;
}

.agent-hotel-card__governance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--text-muted);
  font-size: 11.5px;
}

.agent-hotel-card__governance-status {
  padding: 3px 8px;
  border: 1px solid var(--border-medium);
  border-radius: 999px;
  color: var(--text-secondary);
  font-weight: 700;
}

.agent-hotel-card__governance-status--approved { border-color: var(--brand-primary); }
.agent-hotel-card__governance-status--pilot { border-color: var(--brand-orange); }
.agent-hotel-card__governance-status--deprecated { border-color: var(--brand-red); }

.agent-hotel-card__governance-detail {
  overflow-wrap: anywhere;
}

.agent-hotel-card__prompts {
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.agent-hotel-card__prompts-title {
  margin: 0 0 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.agent-hotel-card__prompts-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
}

.agent-hotel-card__prompts-list a {
  color: var(--brand-text);
}

.agent-hotel-card__info-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.agent-hotel-card__info-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-display);
  line-height: 1;
  pointer-events: none;
}

.agent-hotel-card__info-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--brand-blue) 18%, var(--border-light));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, visibility 140ms;
  pointer-events: none;
  z-index: 10;
}

.agent-hotel-card__info-btn:hover .agent-hotel-card__info-tooltip,
.agent-hotel-card__info-btn:focus .agent-hotel-card__info-tooltip,
.agent-hotel-card__info-btn:focus-visible .agent-hotel-card__info-tooltip {
  opacity: 1;
  visibility: visible;
}

.agent-hotel-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 12.5px;
}

.agent-hotel-card__vendor {
  color: var(--text-secondary);
  font-weight: 500;
}

.agent-hotel-card__launch {
  display: inline-flex;
  align-items: center;
  color: var(--brand-text);
  font-weight: 600;
  text-decoration: none;
}

.agent-hotel-card__launch:hover {
  color: var(--brand-text);
  text-decoration: underline;
}

.agent-hotel-card__launch--disabled {
  color: var(--muted);
  cursor: default;
}

.agent-hotel-card__launch--disabled:hover {
  color: var(--muted);
  text-decoration: none;
}

.agent-hotel-card__launch[data-cta-pending] {
  opacity: 0.6;
}

.agent-hotel__grid-foot {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Apps page (v3) ---------- */
.apps-grid-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.app-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-elevation-2);
  transform: translateY(-1px);
}

.app-card:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.app-card__main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

button.app-card__main {
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.app-card-shell {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.app-card__main:focus-visible,
.app-card__access:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.app-card__access {
  align-self: flex-start;
  margin-top: 2px;
}

.app-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.app-card__class {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--text-muted) 12%, var(--bg-card));
  color: var(--text-secondary);
  border-radius: 999px;
}

.app-card__class-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.app-card__class--open .app-card__class-dot { background: var(--brand-primary); }
.app-card__class--internal .app-card__class-dot { background: var(--brand-blue); }
.app-card__class--restricted .app-card__class-dot { background: var(--brand-orange); }
.app-card__class--confidential .app-card__class-dot { background: var(--brand-red); }

.app-card__owner {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.app-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text-primary);
}

.app-card__description {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  flex: 1;
}

.app-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 12.5px;
}

.app-card__vendor {
  color: var(--text-secondary);
  font-weight: 500;
}

.app-card__launch {
  color: var(--brand-text);
  font-weight: 600;
}

/* ---------- About guidance ---------- */
.about-eyebrow {
  margin: 0 0 8px;
}

.about-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.about-feature,
.about-rule {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

.about-feature h3,
.about-rule h3 {
  margin-bottom: 6px;
}

.about-feature p,
.about-rule p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.about-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}

.about-checklist li {
  position: relative;
  padding-left: 26px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.about-checklist li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--brand-text);
  font-weight: 800;
}

.about-classification-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid;
  border-left-width: 4px;
  border-radius: var(--radius-lg);
}

.about-classification-card--non-business {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
  color: var(--about-non-business-text);
  background: var(--about-non-business-bg);
  border-color: var(--about-non-business-border);
}

.about-classification-card--public {
  color: var(--about-public-text);
  background: var(--about-public-bg);
  border-color: var(--about-public-border);
}

.about-classification-card--internal {
  color: var(--about-internal-text);
  background: var(--about-internal-bg);
  border-color: var(--about-internal-border);
}

.about-classification-card--confidential {
  color: var(--about-confidential-text);
  background: var(--about-confidential-bg);
  border-color: var(--about-confidential-border);
}

.about-classification-card--strict {
  color: var(--about-strict-text);
  background: var(--about-strict-bg);
  border-color: var(--about-strict-border);
}

.about-classification-card__icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  color: inherit;
}

.about-classification-card__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.about-classification-card h3 {
  color: inherit;
  font-size: 15px;
}

.about-classification-card p {
  margin: 6px 0 0;
  color: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.about-classification-scale {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.about-rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.about-conservative-rule {
  padding: 12px 14px;
  border-left: 4px solid var(--about-non-business-border);
  border-radius: var(--radius-md);
  background: var(--about-non-business-bg);
  color: var(--about-non-business-text) !important;
}

.about-official-guidance {
  padding: 20px;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.about-official-guidance h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.about-official-guidance p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.about-official-guidance a {
  color: var(--brand-blue);
  font-weight: 650;
}

.about-official-guidance a:hover { text-decoration: underline; }

.about-official-guidance a:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .about-feature-grid,
  .about-rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .about-classification-scale { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .about-content { gap: 26px; }
  .about-lead { font-size: 16px; }

  .about-feature-grid,
  .about-rule-grid,
  .about-classification-scale,
  .about-checklist { grid-template-columns: 1fr; }

  .about-callout { padding: 16px; }
}


/* ===== Likes ===== */
.detail-likes {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.detail-likes__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border-medium);
  border-radius: 999px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
  line-height: 1.4;
}

.detail-likes__btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-text);
  transform: translateY(-1px);
}

.detail-likes__btn[aria-pressed="true"] {
  background: var(--brand-primary-light);
  border-color: var(--brand-primary);
  color: var(--brand-text);
}

.detail-likes__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.detail-likes__btn:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.detail-likes__btn .thumbs-icon {
  width: 20px;
  height: 20px;
  transition: fill var(--transition-fast);
  fill: currentColor;
}

.detail-likes__btn[aria-pressed="true"] .thumbs-icon {
  fill: var(--brand-primary);
}

.detail-likes__count {
  font-size: 0.875rem;
  color: var(--text-muted);
  min-width: 1ch;
}

/* ===== Comments ===== */
.detail-comments {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.detail-comments__title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.detail-comments__list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-comments__empty,
.detail-comments__loading {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.comment-item {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

.comment-item__avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-teal) 15%, var(--bg-card));
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--brand-teal);
  text-transform: uppercase;
  font-family: var(--font-display);
  user-select: none;
}

.comment-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comment-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.comment-item__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.comment-item__meta strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.comment-item__text {
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.comment-item__delete {
  flex-shrink: 0;
  padding: 2px 6px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.4;
  font-family: inherit;
}

.comment-item__delete:hover {
  color: var(--brand-red);
  border-color: var(--brand-red-light);
  background: var(--brand-red-light);
}

.detail-comments__add {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-comments__add textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 80px;
}

.detail-comments__add textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
}

.detail-comments__add-actions {
  display: flex;
  justify-content: flex-end;
}

.detail-comments__gate {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.detail-comments__gate a {
  color: var(--brand-text);
  text-decoration: underline;
}

/* ===== Icon picker ===== */
.icon-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.icon-picker__trigger {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  overflow: hidden;
  padding: 0;
}

.icon-picker__trigger:hover {
  border-color: var(--brand-primary);
  background: var(--brand-primary-light);
}

.icon-picker__trigger:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.icon-picker__placeholder {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 4px;
  pointer-events: none;
  line-height: 1.3;
}

.icon-picker__preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 2px);
  display: block;
}

.icon-picker__info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.icon-picker__clear {
  align-self: flex-start;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all var(--transition-fast);
  font-family: inherit;
  padding: 0;
}

.icon-picker__clear:hover {
  color: var(--brand-red);
  border-color: var(--brand-red);
  background: var(--brand-red-light);
}

.icon-picker__clear:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.modal-field__error {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--danger-text);
  font-weight: 500;
}

.modal-field__hint {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ========================================================================
   Lab / self-hosted apps (v1)
   ======================================================================== */

/* Section header badge */
.lab-section-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 3px 8px;
  background: color-mix(in srgb, #c97b00 14%, var(--bg-card));
  color: #b56f00;
  border: 1px solid color-mix(in srgb, #c97b00 28%, var(--bg-card));
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

/* Official apps empty state */
.apps-empty {
  font-size: 14px;
  color: var(--text-muted);
  padding: 10px 0 4px;
  line-height: 1.5;
}

/* Lab apps empty state */
.lab-apps-empty {
  font-size: 14px;
  color: var(--text-muted);
  padding: 10px 0 4px;
  line-height: 1.5;
}

/* Lab app card — extends .app-card with warning styling */
.app-card--lab {
  border-left: 3px solid #c97b00;
}

.app-card--lab:hover {
  border-color: #c97b00;
}

/* Lab card badge strip */
.app-card__lab-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 2px;
}

.app-card__badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
}

.app-card__badge--lab {
  background: color-mix(in srgb, #c97b00 14%, var(--bg-card));
  color: #b56f00;
  border: 1px solid color-mix(in srgb, #c97b00 28%, var(--bg-card));
}

.app-card__badge--not-official {
  background: color-mix(in srgb, var(--text-muted) 10%, var(--bg-card));
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

/* Lab submit modal disclaimer */
.lab-submit-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 16px;
  background: color-mix(in srgb, #c97b00 10%, var(--bg-card));
  border: 1px solid color-mix(in srgb, #c97b00 28%, var(--bg-card));
  border-radius: var(--radius-md, 10px);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.lab-submit-disclaimer svg {
  flex-shrink: 0;
  color: #c97b00;
  margin-top: 1px;
}

/* Acknowledgement checkbox field */
.modal-field--ack {
  margin-top: 4px;
}

.ack-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 100%;
  position: relative;
  user-select: none;
}

.ack-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  margin-top: 2px;
  width: 20px;
  height: 20px;
  /* Inside a .modal-field the text-field padding would inflate the box. */
  padding: 0;
  border: 2px solid var(--border-light);
  border-radius: 4px;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.ack-label input[type="checkbox"]:checked {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2 7l4 4 6-7' stroke='%23fff' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-repeat: no-repeat;
  background-position: center;
}

.ack-label input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.ack-label span {
  cursor: pointer;
}

/* App page header variant (with action button) reuse hub-page__header--with-action from submissions */

.app-card__caution {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #b56f00;
  font-style: italic;
}

.app-detail__dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(780px, calc(100vh - 32px));
  overflow: auto;
}

.app-detail__body {
  display: grid;
  gap: 18px;
}

.app-detail__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.app-detail__facts > div,
.app-detail__section,
.app-detail__guidance > section {
  min-width: 0;
}

.app-detail__facts dt,
.app-detail__section h3,
.app-detail__caution h3,
.app-detail__guidance h3 {
  margin: 0 0 5px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.app-detail__facts dd,
.app-detail__section p,
.app-detail__caution p,
.app-detail__guidance p,
.app-detail__guidance ul {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.app-detail__facts dd {
  overflow-wrap: anywhere;
}

.app-detail__caution {
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, #c97b00 28%, var(--bg-card));
  border-radius: var(--radius-md, 10px);
  background: color-mix(in srgb, #c97b00 10%, var(--bg-card));
}

.app-detail__guidance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.app-detail__guidance ul {
  padding-left: 18px;
}

.app-detail__media-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.app-detail__actions {
  margin-top: 0;
}

@media (max-width: 640px) {
  .app-detail__dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .app-detail__facts,
  .app-detail__guidance {
    grid-template-columns: 1fr;
  }

  .app-detail__actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .app-detail__actions .action-button {
    justify-content: center;
    width: 100%;
  }
}

/* Keep role preference and progress compact without changing other Home sections. */
[data-home-personalization="role-picker"],
[data-home-personalization="checklist"] {
  gap: 8px;
  padding: 12px 0;
  min-width: 0;
}
[data-home-personalization="role-picker"] h2,
[data-home-personalization="role-picker"] p,
[data-home-personalization="checklist"] h2,
[data-home-personalization="checklist"] p,
[data-home-personalization="checklist"] ol {
  margin: 0;
}
[data-home-personalization="role-picker"] .pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
[data-home-personalization="role-picker"] .filter-chip,
html[data-shell="refined"] [data-home-personalization="role-picker"] .filter-chip {
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Read-only, independently authorized catalog fallback; never an agent action card. */
.agent-catalog-fallback { margin-block: 1.5rem; }
.agent-catalog-fallback__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; padding: 0; list-style: none; }
.agent-catalog-fallback__list > li { padding: 1rem; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow-wrap: anywhere; }
.agent-catalog-fallback__list h3 { margin: 0 0 .5rem; }
.agent-catalog-fallback__list p { margin: 0; }
.agent-catalog-fallback > button { margin-inline-end: .5rem; }

.catalog-published-date { display: block; margin-block: 4px; font-size: .75rem; color: var(--text-secondary, #64748b); font-weight: 400; }
.catalog-published-date[hidden] { display: none; }

/* Ordinary create recovery remains usable in both source forms and Share. */
.initial-create-recovery { padding: 12px; border: 1px solid var(--border-medium); border-radius: 8px; color: var(--text-primary, #212224); background: var(--bg-card); overflow-wrap: anywhere; }
.initial-create-recovery[hidden] { display: none; }
.initial-create-recovery p { margin: 0 0 12px; }
.initial-create-recovery__retry { min-height: 44px; white-space: normal; max-width: 100%; }
.initial-create-recovery__retry:focus-visible { outline: 3px solid var(--border-focus); outline-offset: 3px; }
