/* Preview harness; keep these rules out of the production integration. */
.trial-page { --accent:#eaff52; }
.trial-page .topbar .word { display:inline; margin-left:8px; color:#f6f6f8; }
.trial-brand { color:#1d1608; background:#e8b667; border-radius:8px; padding:5px 7px; font-weight:900; }
.trial-badge { margin-left:auto; padding:4px 7px; border:1px solid #414142; border-radius:6px; color:#cfccd1; font-size:11px; font-weight:750; }
.trial-page .nav-right { margin-left:0; }
.trial-menu { position:relative; }
.trial-menu summary { list-style:none; cursor:pointer; width:44px; height:44px; display:grid; place-items:center; font-size:21px; }
.trial-menu > div { position:absolute; top:46px; right:0; width:172px; background:#1c1c20; border:1px solid #36363b; border-radius:12px; padding:6px; }
.trial-menu a { display:block; padding:12px 9px; }
.trial-art { height:auto; aspect-ratio: 3/3.7; background-color:#29292d; background-image:url(studio-reference.jpg); background-repeat:no-repeat; background-size: 432% auto; border-radius:12px; }
.art-1 { background-position:34.4% 33.5%; }
.art-2 { background-position:65.8% 33.5%; }
.trial-upload { position:absolute; opacity:0; inset:0; width:100%; height:100%; cursor:pointer; }
.trial-upload-preview { width:42px; height:48px; object-fit:cover; border-radius:7px; }
.trial-empty, .trial-status { border:1px solid #323437; border-radius:12px; padding:14px; color:#ddd; background:#171719; }
.trial-status { border-color:#555e32; }
.trial-page dialog { color:#f7f6f8; background:#18181b; border:1px solid #414146; border-radius:15px; width:min(400px,calc(100% - 32px)); }
.trial-page dialog::backdrop { background:#000b; }
.trial-page dialog form { margin-top:12px; }

/* Route-scoped integration layer. Existing controls remain the source of truth. */
.lm-info, .lm-more summary { display:none; }
@media (min-width:761px) {
  .lm-more, .lm-more-menu { display:contents; }
}
@media (max-width:760px) {
  body:has(.leai-mobile-v2) .leai-mobile-nav { display:none; }
  body:has(.leai-mobile-v2) .view { min-width:0; padding-bottom:calc(82px + env(safe-area-inset-bottom)); }
  body:has(.leai-mobile-v2) :is(.topbar,.nav-right,.view) { max-width:100%; min-width:0; }
  body:has(.leai-mobile-v2) .topbar { padding-inline:16px; }
  body:has(.leai-mobile-v2) .topbar .logo .word { display:inline; }
  body:has(.leai-mobile-v2) .topbar .menu-btn { order:3; }
  .ws.leai-mobile-v2 { grid-template-columns:minmax(0,1fr); min-width:0; min-height:0; }
  .leai-mobile-v2 :is(.side,.side-scroll,.ws-main,.ws-body,.ws-top,.col,.rcard,.adv,.field,.txt) { min-width:0; max-width:100%; }
  .leai-mobile-v2 .side { position:static; overflow:visible; }
  .leai-mobile-v2 .side-scroll { position:relative; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-content:start; gap:9px; padding:14px 16px 16px; }
  .leai-mobile-v2 .side-scroll > * { grid-column:1/-1; }
  .leai-mobile-v2 .side-scroll > .field:has(.selrow,.range) { grid-column:auto; }
  .leai-mobile-v2 .side-tabs { padding:0 16px; }
  .leai-mobile-v2 .side-tabs button { height:44px; }
  .leai-mobile-v2 .model-card { display:flex; align-items:center; min-height:45px; aspect-ratio:auto; margin-right:52px; background:transparent; }
  .leai-mobile-v2 .model-card::after,.leai-mobile-v2 .model-card .media,.leai-mobile-v2 .model-card .txt p,.leai-mobile-v2 .model-card .change { display:none; }
  .leai-mobile-v2 .model-card .txt { position:static; padding-right:16px; }
  .leai-mobile-v2 .model-card h3 { font:750 clamp(18px,5.7vw,23px)/1.1 system-ui,sans-serif; color:var(--ink); overflow-wrap:anywhere; }
  .leai-mobile-v2 .model-card h3::after { content:"⌄"; margin-left:8px; color:#aaa; }
  .leai-mobile-v2 .lm-info { display:grid; place-items:center; position:absolute; top:14px; right:16px; height:44px; width:44px; border-radius:50%; background:#18181b; border:1px solid #343438; color:#ddd; font:700 16px/1 system-ui; }
  .leai-mobile-v2 .drop:not(.has) { min-height:100px; padding:10px; overflow-wrap:anywhere; }
  .leai-mobile-v2 .drop:not(.has) small,.leai-mobile-v2 .field .help { display:none; }
  .leai-mobile-v2 .field { padding:9px 10px; gap:4px; }
  .leai-mobile-v2 .field :is(textarea,input,select) { font-size:16px; min-width:0; width:100%; }
  .leai-mobile-v2 .field textarea { min-height:56px; }
  .leai-mobile-v2 .selrow { padding-inline:7px; }
  .leai-mobile-v2 .adv summary { min-height:44px; }
  .leai-mobile-v2 .ws-main { padding:12px 16px 18px; }
  .leai-mobile-v2 .feed { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .leai-mobile-v2 .tabs { max-width:100%; min-width:0; }
  .leai-mobile-v2 .tabs button { min-height:44px; }
  .leai-mobile-v2 .tabs [data-pane=help] { display:none; }
  .leai-mobile-v2 .rcard .ov { opacity:1; }
  .leai-mobile-v2 .rcard .ov .acts { min-width:0; gap:3px; }
  .leai-mobile-v2 .rcard .ov .meta { display:none; }
  .leai-mobile-v2 .rcard .ov .mini,.leai-mobile-v2 .lm-more summary { min-width:36px; min-height:40px; }
  .leai-mobile-v2 .lm-more summary { display:grid; place-items:center; list-style:none; color:#fff; background:#141418d9; border-radius:8px; cursor:pointer; }
  .leai-mobile-v2 .lm-more summary::-webkit-details-marker { display:none; }
  .leai-mobile-v2 .lm-more-menu { position:absolute; bottom:56px; right:7px; display:flex; gap:3px; padding:3px; background:#1a1a1e; border:1px solid #393940; border-radius:8px; z-index:2; }
  .leai-mobile-v2 .lm-more:not([open]) .lm-more-menu { display:none; }
  .leai-mobile-v2 .side-foot { position:fixed; bottom:0; left:0; right:0; z-index:35; padding:8px 16px max(10px,env(safe-area-inset-bottom)); background:#101012f7; }
  .leai-mobile-v2 .side-foot .generate { min-height:49px; font-size:17px; }
  .leai-mobile-v2 .side-foot .generate:disabled { filter:none; opacity:.78; }
  .leai-mobile-v2 .side-foot .side-note:empty { display:none; }
  body.leai-keyboard-open .leai-mobile-v2 .side-foot, body:has(.leai-mobile-v2 .field :is(textarea,input[type=text]):focus) .leai-mobile-v2 .side-foot { position:static; }
  body:has(.modal,.cmpx,dialog[open]) .leai-mobile-v2 .side-foot { visibility:hidden; }
}
@media (max-width:355px) {
  .leai-mobile-v2 .side-scroll > .field:has(.selrow,.range) { grid-column:1/-1; }
  .leai-mobile-v2 .rcard .ov { padding:5px; }
  .leai-mobile-v2 .rcard .ov .acts { gap:3px; }
}

/* A real row below the media; expanding it never overlays or clips the photo. */
.leai-mobile-v2 .rcard:has(.lm-card-footer) .ov { display:none; }
.leai-mobile-v2 .lm-card-footer { padding:6px 8px; background:#18181b; border-top:1px solid #27272c; }
.leai-mobile-v2 .lm-card-footer > .acts {
 display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px;
}
.leai-mobile-v2 .lm-card-footer :is(button,a,summary) {
 width:100%; min-width:0; min-height:44px; display:grid; place-items:center; color:#eeedf0;
 background:#222227; border:1px solid #38383e; border-radius:8px; cursor:pointer;
}
.leai-mobile-v2 .lm-card-footer .lm-more { position:static; min-width:0; }
.leai-mobile-v2 .lm-card-footer .lm-more[open] { display:grid; grid-column:1/-1; }
.leai-mobile-v2 .lm-card-footer .lm-more-menu {
 position:static; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px;
 padding:4px 0 0; border:0; background:transparent;
}
.leai-mobile-v2 .lm-card-footer .lm-more:not([open]) .lm-more-menu { display:none; }
.leai-mobile-v2 .lm-card-footer .lm-more summary { list-style:none; }
.leai-mobile-v2 .lm-card-footer .lm-more summary::-webkit-details-marker {display:none}

/* Less chrome on demo history: compact icons with 44px hit targets. */
.trial-page .lm-card-footer { padding:0 6px; }
.trial-page .lm-card-footer > .acts { display:flex; justify-content:center; gap:8px; }
.trial-page .lm-card-footer > .acts > :is(button,a) {
  flex:0 0 44px; width:44px; height:44px; padding:0;
  background:transparent; border:0; border-radius:6px; font-size:16px;
}
.trial-page .lm-card-footer > .acts > :is(button,a):hover,
.trial-page .lm-card-footer > .acts > :is(button,a):focus-visible { background:#28282d; }
.trial-detail-actions { display:flex; flex-wrap:wrap; gap:2px 8px; }
.trial-detail-actions button { min-height:44px; padding:4px 6px; border:0; border-radius:6px; background:transparent; color:#dfdee3; font:600 13px/1.25 system-ui; cursor:pointer; }
.trial-detail-actions button:is(:hover,:focus-visible) { background:#28282d; }
@media (max-width:760px) {
 .trial-page .leai-mobile-v2 .side-foot { padding-block:4px max(5px, env(safe-area-inset-bottom)); }
 .trial-page .leai-mobile-v2 .side-foot .generate { min-height:44px; height:44px; font-size:15px; border-radius:10px; }
}

/* Whole-site trial shell and independent history actions. */
.trial-page [hidden] { display:none !important; }
.trial-page { margin:0; background:#0c0c0e; }
.trial-page .topbar { gap:8px; }
.trial-menu > div { z-index:3; max-height:min(75dvh,430px); overflow:auto; }
.trial-page .leai-mobile-nav { grid-template-columns:repeat(6,minmax(0,1fr)); }
.trial-page .leai-mobile-nav a { font-size:10px; padding:0; }
.trial-page .leai-mobile-nav a span { font-size:19px; line-height:1; }
.trial-page .side-tabs a { display:flex; align-items:center; min-height:44px; padding:0 8px; text-decoration:none; color:#b5b3ba; white-space:nowrap; }
.trial-page .ws-body { min-width:0; }
.trial-page .lm-card-footer > .acts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:2px; }
.trial-page .lm-card-footer > .acts > :is(button,a) { width:100%; min-width:0; height:40px; min-height:40px; margin:0; }
.trial-page .trial-more { font-size:18px !important; }
.trial-page dialog { position:fixed; margin:auto; padding:16px; max-height:82dvh; overflow:auto; }
.trial-page dialog h2 { margin:0 0 8px; font-size:18px; }
.trial-page dialog p { font-size:14px; color:#b9b8c0; line-height:1.4; margin:8px 0 12px; }
.trial-page dialog .trial-art { max-height:45dvh; }
.trial-detail-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.trial-detail-actions button { border:1px solid #37373b; margin:0; overflow-wrap:anywhere; }
.trial-compare { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:10px; }
.trial-section { width:min(100%,920px); margin:0 auto; padding:20px 16px 20px; min-width:0; }
.section-head { margin:0 0 14px; }
.section-head h1 { margin:0 0 8px; font-size:clamp(25px,7.5vw,42px); line-height:1.12; letter-spacing:-.035em; color:#f4f4f8; }
.section-head p { color:#c5c3cb; line-height:1.45; font-size:15px; }
.section-head .trial-eyebrow { color:#e1e2a3; font-size:11px; font-weight:800; letter-spacing:.14em; margin:0 0 8px; }
.main-hero { padding:20px 18px; border:1px solid #34362a; border-radius:18px; background:radial-gradient(100% 130% at 0% 0%,#25281a,#141417 72%); }
.trial-primary { display:inline-flex; align-items:center; min-height:44px; padding:0 13px; border-radius:9px; background:#eaff52;color:#151609; font-size:14px; font-weight:800; text-decoration:none; }
.trial-group { margin:18px 0; }
.trial-group h2 { margin:8px 0; color:#efeff1; font-size:17px; }
.trial-tool-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.trial-tool { display:flex; flex-direction:column; justify-content:center; min-height:62px; min-width:0; padding:9px 10px; border:1px solid #303036; border-radius:11px; background:#17171a; text-decoration:none; color:#eee; overflow-wrap:anywhere; }
.trial-tool:is(:hover,:focus-visible){background:#26272b;border-color:#515457}
.tool-kind { font-size:10px; text-transform:uppercase; letter-spacing:.05em; color:#bbb9ad; margin:0 0 2px; }
.trial-tool strong { font-size:14px; }
.trial-search { display:block; color:#cbc9d0; font-size:13px; }
.trial-search input,.trial-filter select { display:block; width:100%; min-height:44px; padding:7px 10px; margin:5px 0; border:1px solid #44444b; border-radius:9px; background:#19191d; color:#fff; font-size:16px; }
#tool-count { color:#adaab4; margin:6px 0; font-size:13px; }
.trial-filter { display:block; max-width:250px; margin-bottom:10px; }
.trial-section .feed.masonry { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
@media(max-width:760px){
 .trial-page:has(dialog[open]) .leai-mobile-nav{display:none}
 .trial-page .view{padding-bottom:calc(58px + env(safe-area-inset-bottom))}
 .trial-page:has(.leai-mobile-v2) .view{padding-bottom:calc(60px + env(safe-area-inset-bottom))}
 .trial-page .side .model-card + .lm-info{top:14px}
 .trial-page dialog{top:auto;bottom:0;left:0;right:0;width:100%;max-width:100%;margin:0;padding:16px 16px max(16px,env(safe-area-inset-bottom));border-radius:18px 18px 0 0;}
 .trial-page .drop{min-width:0}
}
@media(min-width:761px){
 .trial-tool-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
 .trial-page .ws.l-sidebar{min-height:calc(100vh - var(--top))}
}
