/* v4 interiors for the React app pages (library, prompt detail, search, community, account, forms, courses).
   Those interiors are written in Tailwind (shadcn hsl triples) and product-design.css tokens; html.v4i (set by
   src/components/v4/V4Page.tsx) re-points both token sets at v4 paper/ink so the same markup and every function
   keep working, in light and dark. On html, not main: dialogs, menus and toasts portal to <body>.
   Triples are sRGB conversions of the v4.css oklch tokens. Admin and unported pages never get .v4i. */

html.v4i{
  --background: 40 48% 94.8%; --foreground: 26 31% 5.8%;
  --card: 40 48% 94.8%; --card-foreground: 26 31% 5.8%;
  --popover: 40 48% 94.8%; --popover-foreground: 26 31% 5.8%;
  --primary: 26 31% 5.8%; --primary-foreground: 40 48% 94.8%;
  --secondary: 40 33% 90.2%; --secondary-foreground: 26 31% 5.8%;
  --muted: 40 33% 90.2%; --muted-foreground: 26 10% 21.7%;
  --accent: 26 31% 5.8%; --accent-foreground: 40 48% 94.8%;
  --destructive: 7 93% 37.2%; --destructive-foreground: 40 48% 94.8%;
  --success: 150 100% 19.8%;
  --border: 36 10% 80.8%; --input: 26 6% 36.4%; --ring: 26 31% 5.8%;
  --color-bg: 40 48% 94.8%; --color-surface: 40 48% 94.8%; --color-raised: 40 33% 90.2%; --color-text: 26 31% 5.8%;
  --color-muted: 26 6% 36.4%; --color-accent: 26 31% 5.8%; --color-border: 36 10% 80.8%; --color-control: 26 6% 36.4%;
  --color-danger: 7 93% 37.2%; --color-success: 150 100% 19.8%;
  --product-bg: var(--paper); --product-surface: var(--paper); --product-raised: var(--paper-2);
  --product-text: var(--ink); --product-muted: var(--ink-3); --product-accent: var(--ink);
  --product-border: var(--rule); --product-control-border: var(--ink-3);
  --radius: 0px; --radius-card: 0px; --radius-control: 0px; --radius-pill: 0px; --product-radius: 0px;
  --font-body: var(--ui); --font-heading: var(--display);
  --warn: oklch(0.47 0.1 75);
}
@media (prefers-color-scheme: dark){ html.v4i{
  --background: 26 26% 5.8%; --foreground: 40 33% 92.5%;
  --card: 26 26% 5.8%; --card-foreground: 40 33% 92.5%;
  --popover: 26 21% 9.3%; --popover-foreground: 40 33% 92.5%;
  --primary: 40 33% 92.5%; --primary-foreground: 26 26% 5.8%;
  --secondary: 26 21% 9.3%; --secondary-foreground: 40 33% 92.5%;
  --muted: 26 21% 9.3%; --muted-foreground: 40 10% 75.9%;
  --accent: 40 33% 92.5%; --accent-foreground: 26 26% 5.8%;
  --destructive: 8 100% 67.7%; --destructive-foreground: 26 26% 5.8%;
  --success: 145 50% 56.5%;
  --border: 27 9% 19.8%; --input: 40 5% 56.4%; --ring: 40 33% 92.5%;
  --color-bg: 26 26% 5.8%; --color-surface: 26 26% 5.8%; --color-raised: 26 21% 9.3%; --color-text: 40 33% 92.5%;
  --color-muted: 40 5% 56.4%; --color-accent: 40 33% 92.5%; --color-border: 27 9% 19.8%; --color-control: 40 5% 56.4%;
  --color-danger: 8 100% 67.7%; --color-success: 145 50% 56.5%;
  --warn: oklch(0.82 0.12 80);
} }

/* page base: UI face for interiors (v4 bodies read in Newsreader; app screens are controls and lists) */
html.v4i body{ font-family: var(--ui); color-scheme: inherit; }
html.v4i ::selection{ background: var(--lime); color: var(--on-light); }
html.v4i :focus-visible{ outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 0; }
html.v4i main :is(h1, h2, h3):not(.sec-h, .card h3){ font-family: var(--display); font-stretch: 75%; letter-spacing: -0.015em; }
html.v4i main :is(h1, h2):not(.hero h1, .sec-h){ font-weight: 800; line-height: 1; }
html.v4i main h1:not(.hero h1){ font-size: clamp(2rem, 1.4rem + 2.4vw, 3.4rem); text-transform: none; }

/* legacy dark utilities (base classes only; hover: variants have their own rules): white-alpha surfaces become ink-alpha, white text becomes ink, status hues get paper-safe inks */
html.v4i :is([class^="bg-white/"], [class*=" bg-white/"]){ background-color: color-mix(in oklch, var(--ink) 5%, transparent); }
html.v4i [class*="hover:bg-white/"]:hover{ background-color: color-mix(in oklch, var(--ink) 9%, transparent); }
html.v4i :is([class~="bg-white"], [class~="hover:bg-white"]:hover){ background-color: var(--ink); color: var(--paper); }
html.v4i :is([class^="bg-neutral-9"], [class*=" bg-neutral-9"]), html.v4i :is([class^="bg-neutral-8"], [class*=" bg-neutral-8"]), html.v4i :is([class^="bg-[#"], [class*=" bg-[#"]){ background-color: var(--paper); }
/* solid bg-black is a media stage (letterbox behind video and images): fixed ink in both themes */
html.v4i [class~="bg-black"]{ background-color: var(--b-ink); }
/* bg-black/NN: in-flow wells become paper-2; fixed overlays stay a scrim */
html.v4i :is([class^="bg-black/"], [class*=" bg-black/"]){ background-color: var(--paper-2); }
html.v4i .fixed:is([class^="bg-black/"], [class*=" bg-black/"]){ background-color: color-mix(in oklch, var(--b-ink) 80%, transparent); }
html.v4i :is([class^="border-white"], [class*=" border-white"]), html.v4i :is([class^="border-neutral-"], [class*=" border-neutral-"]), html.v4i :is([class^="divide-white"], [class*=" divide-white"]) > * + *{ border-color: var(--rule); }
html.v4i [class*="hover:border-white"]:hover{ border-color: var(--ink-3); }
/* spinners: border-white/20 border-t-white/60 keep a visible moving arc */
html.v4i [class*="border-t-white"]{ border-top-color: var(--ink); }
html.v4i :is([class~="text-white"], :is([class^="text-white/"], [class*=" text-white/"]), :is([class^="text-neutral-1"], [class*=" text-neutral-1"]), :is([class^="text-neutral-2"], [class*=" text-neutral-2"]), [class~="hover:text-white"]:hover){ color: var(--ink); }
html.v4i :is(:is([class^="text-neutral-3"], [class*=" text-neutral-3"]), :is([class^="text-neutral-4"], [class*=" text-neutral-4"]), :is([class^="text-neutral-5"], [class*=" text-neutral-5"])){ color: var(--ink-3); }
html.v4i [class~="text-black"]{ color: var(--paper); }
html.v4i :is([class^="ring-white"], [class*=" ring-white"]){ --tw-ring-color: var(--rule); }
html.v4i :is(:is([class^="text-emerald-"], [class*=" text-emerald-"]), :is([class^="text-green-"], [class*=" text-green-"])){ color: var(--gain); }
html.v4i :is(:is([class^="text-red-"], [class*=" text-red-"]), :is([class^="text-rose-"], [class*=" text-rose-"]), :is([class^="text-orange-"], [class*=" text-orange-"])){ color: var(--red-ink); }
html.v4i :is(:is([class^="text-amber-"], [class*=" text-amber-"]), :is([class^="text-yellow-"], [class*=" text-yellow-"])){ color: var(--warn); }
html.v4i :is(:is([class^="text-violet-"], [class*=" text-violet-"]), :is([class^="text-blue-"], [class*=" text-blue-"]), :is([class^="text-sky-"], [class*=" text-sky-"]), :is([class^="text-indigo-"], [class*=" text-indigo-"]), :is([class^="text-cyan-"], [class*=" text-cyan-"]), :is([class^="text-teal-"], [class*=" text-teal-"]), :is([class^="text-fuchsia-"], [class*=" text-fuchsia-"]), :is([class^="text-pink-"], [class*=" text-pink-"]), :is([class^="text-purple-"], [class*=" text-purple-"])){ color: var(--cobalt); }
html.v4i :is(:is([class^="bg-emerald-"], [class*=" bg-emerald-"]), :is([class^="bg-green-"], [class*=" bg-green-"])){ background-color: color-mix(in oklch, var(--gain) 12%, var(--paper)); }
html.v4i :is(:is([class^="bg-red-"], [class*=" bg-red-"]), :is([class^="bg-rose-"], [class*=" bg-rose-"]), :is([class^="bg-orange-"], [class*=" bg-orange-"])){ background-color: color-mix(in oklch, var(--red) 12%, var(--paper)); }
html.v4i :is(:is([class^="bg-amber-"], [class*=" bg-amber-"]), :is([class^="bg-yellow-"], [class*=" bg-yellow-"])){ background-color: color-mix(in oklch, var(--warn) 14%, var(--paper)); }
html.v4i :is(:is([class^="bg-violet-"], [class*=" bg-violet-"]), :is([class^="bg-blue-"], [class*=" bg-blue-"]), :is([class^="bg-sky-"], [class*=" bg-sky-"])){ background-color: color-mix(in oklch, var(--cobalt) 12%, var(--paper)); }
html.v4i :is(:is([class^="border-emerald-"], [class*=" border-emerald-"]), :is([class^="border-green-"], [class*=" border-green-"])){ border-color: var(--gain); }
html.v4i :is(:is([class^="border-red-"], [class*=" border-red-"]), :is([class^="border-rose-"], [class*=" border-rose-"]), :is([class^="border-orange-"], [class*=" border-orange-"])){ border-color: var(--red-ink); }
html.v4i :is(:is([class^="border-amber-"], [class*=" border-amber-"]), :is([class^="border-yellow-"], [class*=" border-yellow-"])){ border-color: var(--warn); }
html.v4i :is(:is([class^="border-violet-"], [class*=" border-violet-"]), :is([class^="border-blue-"], [class*=" border-blue-"])){ border-color: var(--cobalt); }
html.v4i :is([class^="bg-gradient-"], [class*=" bg-gradient-"]){ background-image: none; }
html.v4i :is([class*="hover:text-emerald-"], [class*="hover:text-green-"], [class*="hover:text-red-"], [class*="hover:text-rose-"], [class*="hover:text-orange-"], [class*="hover:text-amber-"], [class*="hover:text-sky-"], [class*="hover:text-blue-"]):hover{ color: var(--red-ink); }
html.v4i :is([class*="hover:bg-emerald-"], [class*="hover:bg-green-"], [class*="hover:bg-red-"], [class*="hover:bg-rose-"], [class*="hover:bg-orange-"], [class*="hover:bg-amber-"], [class*="hover:bg-sky-"], [class*="hover:bg-blue-"]):hover{ background-color: color-mix(in oklch, var(--ink) 9%, transparent); }
/* labels laid over photos (absolute + bg-black/NN): fixed ink block with light text in both themes */
html.v4i .absolute:is([class^="bg-black/"], [class*=" bg-black/"]), html.v4i .absolute:is([class^="bg-black/"], [class*=" bg-black/"]) *{ color: var(--on-dark); }
html.v4i .absolute:is([class^="bg-black/"], [class*=" bg-black/"]){ background-color: color-mix(in oklch, var(--b-ink) 82%, transparent); }
/* v4 has no radii, shadows, blur or glow; round avatars and dots keep rounded-full */
html.v4i :is(main, [role="dialog"], [role="menu"], [data-radix-popper-content-wrapper]) [class*="rounded"]:not([class~="rounded-full"]){ border-radius: 0; }
html.v4i :is(main, [role="dialog"]) :is([class*="shadow"], [class*="backdrop-blur"]){ box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* buttons: legacy names, v4 look (ink block, ghost outline, square) */
html.v4i :is(.btn-primary, .product-button-primary){ display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 2px solid var(--ink); border-radius: 0; background: var(--ink); color: var(--paper); font: 700 .92rem/1 var(--ui); text-decoration: none; }
html.v4i :is(.btn-outline, .product-button:not(.product-button-primary)){ border: 2px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); font-family: var(--ui); font-weight: 700; }
html.v4i .btn-ghost{ border-radius: 0; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine){
  html.v4i :is(.btn-primary, .product-button-primary):hover:not(:disabled){ background: var(--red); border-color: var(--red); color: oklch(0.99 0 0); }
  html.v4i :is(.btn-outline, .product-button:not(.product-button-primary)):hover:not(:disabled){ background: var(--ink); color: var(--paper); }
}
html.v4i .product-button[aria-pressed="true"]{ background: var(--ink); color: var(--paper); border-color: var(--ink); }
html.v4i .product-section-label{ font: 700 .74rem/1.3 var(--ui); letter-spacing: .12em; color: var(--ink-3); }
html.v4i .board-link{ font-family: var(--ui); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
html.v4i .board-link:hover{ color: var(--red-ink); }
html.v4i main a:not([class]):hover{ color: var(--red-ink); }
html.v4i :is(input, select, textarea){ color: var(--ink); }
html.v4i :is(input, textarea)::placeholder{ color: var(--ink-3); opacity: 1; }
/* sponsor units (campaign-unit) keep their own layout; only the on-accent text flips with the accent */
html.v4i .campaign-unit .board-link{ color: var(--paper); text-decoration: none; }

/* prompt library: filter rows read as v4 chips, cards as ruled prompt cards (FlipCard markup unchanged) */
.v4i .prompt-filter-groups{ gap: 4px; }
.v4i .prompt-filter-row{ gap: 2px 20px; font: 700 .92rem var(--ui); }
/* desktop: every model chip reachable without a horizontal scrollbar */
@media (min-width: 900px){ .v4i .prompt-filter-row{ flex-wrap: wrap; overflow: visible; } }
.v4i .prompt-filter-row + .prompt-filter-row{ border-top: 1px solid var(--rule); }
.v4i .prompt-filter-row button{ min-height: 44px; min-width: 44px; justify-content: center; padding: 10px 0 6px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; color: var(--ink-2); font: inherit; gap: 6px; }
.v4i .prompt-filter-row button[aria-pressed="true"]{ color: var(--ink); background: none; border-color: var(--red); }
.v4i .prompt-filter-row button span{ font: 500 .78rem var(--ui); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.v4i .prompt-grid-search input{ height: 52px; border: 0; border-bottom: 3px solid var(--ink); border-radius: 0; background: none; font: 800 clamp(1.3rem, 1rem + 1vw, 1.8rem)/1.2 var(--display); font-stretch: 75%; }
.v4i .prompt-grid-search input:focus{ border-color: var(--red); background: none; }
.v4i .prompt-grid-search select{ height: 44px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); font: 700 .88rem var(--ui); }
.v4i .prompt-grid-discovery{ border-color: var(--rule); font-family: var(--ui); }
.v4i .prompt-grid-wide{ gap: 0 32px; border-top: 2px solid var(--ink); }
.v4i .prompt-object{ border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: none; padding: 20px 0 22px; overflow: visible; }
.v4i .prompt-object-media{ background: var(--paper-2); border: 1px solid var(--rule); }
.v4i .prompt-open-text{ font-family: var(--mono); }
.v4i .prompt-open-text p{ color: var(--ink-2); font: 500 .85rem/1.6 var(--mono); }
.v4i .prompt-video-excerpt{ color: var(--ink-2); font: 500 .85rem/1.6 var(--mono); }
.v4i .prompt-object-content{ padding: 14px 0 0; }
.v4i .prompt-object h3{ font: 800 1.45rem/1.02 var(--display); font-stretch: 75%; letter-spacing: -0.015em; margin: 0 0 10px; }
.v4i .prompt-object h3 a{ text-decoration: none; } .v4i .prompt-object h3 a:hover{ color: var(--red-ink); }
.v4i .prompt-object-actions{ border-top: 1px solid var(--rule); font-family: var(--ui); }
.v4i .prompt-object-actions > button{ font-weight: 600; }
.v4i .prompt-object-actions > .prompt-copy-btn{ gap: 6px; min-height: 40px; padding: 0 14px; border: 2px solid var(--ink); font-weight: 700; }
@media (hover: hover) and (pointer: fine){ .v4i .prompt-object-actions > .prompt-copy-btn:hover{ background: var(--ink); color: var(--paper); } }
.v4i .prompt-play{ border: 2px solid var(--b-ink); border-radius: 0; background: var(--b-ink); color: var(--on-dark); font: 700 .88rem var(--ui); }
.v4i .prompt-media-status{ background: var(--paper); color: var(--ink-2); border: 1px solid var(--rule); font-family: var(--ui); }
.v4i .model-attribution{ border-color: var(--rule); font-family: var(--ui); }
.v4i .model-attribution span{ font: 600 .72rem var(--ui); letter-spacing: .1em; text-transform: uppercase; }
/* type bars on /prompts link to the type pages */
.v4i .hbar a{ text-decoration: none; } .v4i .hbar a:hover{ text-decoration: underline; }

/* the library's own section rhythm */
.v4i .lib-sec{ padding-top: clamp(40px, 5vw, 72px); }
.v4i .lib-sec .prompt-grid-shell{ margin-top: 28px; }
.v4i .lib-empty{ padding: 48px 0; max-width: 40em; }
.v4i .lib-empty h3{ font-size: var(--t-h3); margin-bottom: 10px; }
.v4i .lib-empty p{ font: 400 1.05rem/1.5 var(--ui); color: var(--ink-2); }
/* the house "Advertise here" card between grid rows reads as one ruled strip, not a 4:3 empty frame */
.v4i [data-sponsored-surface="prompt-grid"] > aside{ border: 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); background: none; padding: 16px 0; }
.v4i [data-sponsored-surface="prompt-grid"] > aside > div:first-child{ display: none; }
@media (max-width: 560px){ .v4i .prompt-grid-search input{ font-size: 1.05rem; } .v4i .prompt-grid-search input:placeholder-shown{ padding-right: 8px; } }
/* Tailwind on/off switches (role=switch without .account-switch): state reads as ink fill, not two pale tints */
html.v4i [role="switch"]:not(.account-switch){ border: 2px solid var(--ink); border-radius: 0; background: var(--paper); }
html.v4i [role="switch"]:not(.account-switch)[aria-checked="true"]{ background: var(--ink); }
html.v4i [role="switch"]:not(.account-switch) > span{ border-radius: 0; background: var(--ink-3); }
html.v4i [role="switch"]:not(.account-switch)[aria-checked="true"] > span{ background: var(--paper); }
/* v4.css zeroes p and heading margins (.v4 p, .v4 h1-h4), which outranks Tailwind margin utilities; interiors space with them, so restore the ones they use */
html.v4i :is(p, h1, h2, h3, h4).mt-0\.5{ margin-top: .125rem; } html.v4i :is(p, h1, h2, h3, h4).mb-0\.5{ margin-bottom: .125rem; }
html.v4i :is(p, h1, h2, h3, h4).mt-1{ margin-top: .25rem; } html.v4i :is(p, h1, h2, h3, h4).mb-1{ margin-bottom: .25rem; }
html.v4i :is(p, h1, h2, h3, h4).mt-1\.5{ margin-top: .375rem; } html.v4i :is(p, h1, h2, h3, h4).mb-1\.5{ margin-bottom: .375rem; }
html.v4i :is(p, h1, h2, h3, h4).mt-2{ margin-top: .5rem; } html.v4i :is(p, h1, h2, h3, h4).mb-2{ margin-bottom: .5rem; }
html.v4i :is(p, h1, h2, h3, h4).mt-3{ margin-top: .75rem; } html.v4i :is(p, h1, h2, h3, h4).mb-3{ margin-bottom: .75rem; }
html.v4i :is(p, h1, h2, h3, h4).mt-4{ margin-top: 1rem; } html.v4i :is(p, h1, h2, h3, h4).mb-4{ margin-bottom: 1rem; }
html.v4i :is(p, h1, h2, h3, h4).mt-5{ margin-top: 1.25rem; } html.v4i :is(p, h1, h2, h3, h4).mb-5{ margin-bottom: 1.25rem; }
html.v4i :is(p, h1, h2, h3, h4).mt-6{ margin-top: 1.5rem; } html.v4i :is(p, h1, h2, h3, h4).mb-6{ margin-bottom: 1.5rem; }
html.v4i :is(p, h1, h2, h3, h4).mt-8{ margin-top: 2rem; } html.v4i :is(p, h1, h2, h3, h4).mb-8{ margin-bottom: 2rem; }
html.v4i :is(p, h1, h2, h3, h4).mx-auto{ margin-left: auto; margin-right: auto; }
/* library first screen: compact hero, then search, filters and the first row of cards */
.v4i .hero.lib-hero{ padding: 14px 0 22px; }
.v4i .hero.lib-hero .hero-in{ gap: 10px; }
.v4i .hero.lib-hero .dek{ max-width: 40em; font-size: clamp(1.05rem, .95rem + .4vw, 1.3rem); }
.v4i .lib-grid{ padding: 24px 0 0; }
.v4i .lib-grid .prompt-grid-search{ margin-bottom: 8px; }
.v4i .lib-grid .prompt-grid-filters{ margin-bottom: 8px; }
.v4i .lib-grid .prompt-grid-summary{ margin-bottom: 12px; }
.v4i .prompt-object-media{ aspect-ratio: 4 / 3; }
