/* style -- THE INSPIRATION ROOM (js/inspire*.js).

   Simon, 24 Oct 2026: "a new section on the left-hand side for inspiration
   ... a mood board-type space, similar to the node space ... like a giant
   canvas area, and it's like an infinite canvas."

   A pane in the shell's own cell (like Ask), the canvas filling it.

   Simon, 26 Oct 2026: "the inspire section needs to begin within the prompt
   box in the middle of the screen not an initial prompt box down the bottom
   ... the ideas should load as a big grid". So three faces over one canvas:
   the start box in the middle (#inspmod.empty / .hero), the board with a
   composer floating under the selection (.picked) and a one-line tip when
   nothing is selected, and the 2 x 2 grid of ideas (.grid). */

#inspmod {
  width: 420px; flex: 1 1 560px; min-width: 0;
  height: calc(100vh - var(--hdr-h, 50px));
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  box-sizing: border-box; background: var(--surface-deep);
}
#inspmod.hidden { display: none; }
/* Left of the gallery in the panel's own row (After Effects, the browser),
   where the classic controls it stands in for would be. */
#inspmod { order: -1; }
/* THE NARROW PANEL (22-width-ruler.css stacks #layout into a column under
   664px): the board on top at the panel's full width and height, the
   gallery under it. A width of its own here would be a canvas clipped at
   the right edge, which is where its buttons are. */
@media (max-width: 664px) {
  #inspmod { width: 100%; flex: 0 0 auto; height: calc(100vh - var(--hdr-h, 50px) - 8px); min-height: 380px; }
}
html.desktop.nle-on #inspmod { width: auto; flex: 1 1 520px; height: auto; min-height: 0; align-self: stretch; }
/* "Whole window": over the shell, clear of the rail and the header. */
#inspmod.max {
  position: fixed; top: var(--hdr-h, 50px); left: 46px; right: 0; bottom: 0;
  width: auto; height: auto; border-top: 1px solid var(--border);
  /* Over the shell's panel tabs (#pa-tabs, --z-menu) as well; the rail is
     left of it, so nothing that leads out of the app is covered. */
  z-index: calc(var(--z-menu) + 5);
}

/* The make cell opens wide for it, the way it does for Create and Ask
   (css/nle/01-grid.css; panelarrange.js genT says the same thing inline). */
html.desktop.nle-on:not(.nle-dock).insp-on body {
  grid-template-columns:
    minmax(0, var(--nle-w-bin, 300px))
    minmax(0, max(var(--nle-w-gen, 400px), min(1200px, 62vw)))
    minmax(0, 1fr);
}
html.desktop.nle-on:not(.nle-dock).insp-on.sm-gen-set body {
  grid-template-columns:
    minmax(0, var(--nle-w-bin, 300px))
    minmax(0, var(--nle-w-gen, 400px))
    minmax(0, 1fr);
}

/* ---- toolbar ---- */
.insp-bar {
  flex: none; display: flex; align-items: center; gap: 6px; height: 36px;
  padding: 0 8px 0 14px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.insp-title { font-size: var(--fs-body); font-weight: 700; color: var(--text); white-space: nowrap; }
.insp-hint { font-size: var(--fs-small); color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.insp-sp { flex: 1 1 auto; min-width: 0; }
.insp-stat { font-size: 10.5px; color: var(--text-dim); white-space: nowrap; margin-right: 4px; }
.insp-ib {
  width: 26px; height: 26px; padding: 0; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--text-dim); cursor: pointer;
}
.insp-ib:hover:not(:disabled) { color: var(--text); background: var(--card); border-color: var(--border); }
.insp-ib:disabled { opacity: .3; cursor: default; }
.insp-ib.on { color: #fff; background: var(--accent-soft); border-color: rgba(var(--accent-rgb), .5); }
/* Text buttons on the toolbar: "Ideas" (the grid) and "New idea" (the start box). */
.insp-tb {
  height: 26px; flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 0 9px 0 7px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--text-dim);
  font: inherit; font-size: var(--fs-small); font-weight: 600; white-space: nowrap; cursor: pointer;
}
.insp-tb:hover:not(:disabled) { color: var(--text); border-color: #2c2c31; }
.insp-tb:disabled { opacity: .35; cursor: default; }
.insp-tb.on { color: #fff; background: var(--accent-soft); border-color: rgba(var(--accent-rgb), .55); }
.insp-tb svg { width: 13px; height: 13px; }
#inspmod.empty .insp-tb, #inspmod.empty .insp-ib, #inspmod.empty .insp-hint { visibility: hidden; }
.insp-ib svg, .insp-tb svg, .insp-acts svg, .insp-addref svg, .insp-hero-add svg, .insp-tip svg, .insp-check svg, .insp-tile-open svg {
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.insp-ib svg { width: 15px; height: 15px; }
#inspmod.narrow .insp-hint, #inspmod.narrow .insp-tb span { display: none; }
#inspmod.narrow .insp-tb { padding: 0 6px; }

/* ---- the canvas ---- */
.insp-stage {
  position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; outline: none; cursor: default;
  background-color: var(--surface-deep);
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.3px);
  background-size: 24px 24px;
}
.insp-stage.space { cursor: grab; }
.insp-stage.panning, .insp-stage.dragging { cursor: grabbing; }
.insp-world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
.insp-links { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.insp-link { fill: none; stroke: #3b3b43; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.insp-link.hot { stroke: rgba(var(--accent-rgb), .9); stroke-width: 2; }
.insp-link.live { stroke-dasharray: 5 5; animation: insp-dash 1s linear infinite; }
.insp-link.bad { stroke: rgba(255, 107, 107, .45); }
@keyframes insp-dash { to { stroke-dashoffset: -20; } }
.insp-marquee {
  position: absolute; z-index: 3; pointer-events: none;
  border: 1px solid rgba(var(--accent-rgb), .85); background: rgba(var(--accent-rgb), .07);
}

/* ---- cards ---- */
.insp-card {
  position: absolute; box-sizing: border-box; overflow: hidden; cursor: pointer; user-select: none;
  border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  transition: box-shadow var(--t-quick), border-color var(--t-quick);
}
.insp-card:hover { border-color: #36363d; }
/* SELECTED READS FROM ACROSS THE ROOM: a crimson frame, a glow and a tick,
   because the selection IS the input to the next Generate. */
.insp-card.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .75), 0 0 34px rgba(var(--accent-rgb), .28), 0 12px 28px rgba(0, 0, 0, .55);
}
/* ...and what a marquee is touching, before it is let go. */
.insp-card.marq:not(.sel) { border-color: rgba(var(--accent-rgb), .7); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .35), 0 6px 18px rgba(0, 0, 0, .35); }
.insp-check {
  position: absolute; left: 6px; top: 6px; z-index: 2; width: 20px; height: 20px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); pointer-events: none;
}
.insp-check svg { width: 12px; height: 12px; stroke-width: 3; }
.insp-card.sel .insp-check { display: flex; }
.insp-card.sel .insp-tag { left: 31px; }
.insp-card > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  background: #050506; pointer-events: none;
}
.insp-card.missing::after {
  content: 'Picture not found'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-small); color: var(--text-faint); background: #0b0b0d; z-index: 0;
}
.insp-card.missing .insp-acts { z-index: 1; }
.insp-tag {
  position: absolute; left: 6px; top: 7px; padding: 2px 5px; border-radius: var(--radius-sm);
  font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(0, 0, 0, .62); color: var(--text-dim); pointer-events: none;
}
.insp-starred { position: absolute; left: 6px; bottom: 6px; width: 16px; height: 16px; pointer-events: none; }
.insp-starred svg { width: 16px; height: 16px; fill: var(--warn); stroke: rgba(0, 0, 0, .5); stroke-width: 1; }
.insp-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 9px 8px; pointer-events: none;
  background: linear-gradient(transparent, rgba(0, 0, 0, .88)); opacity: 0; transition: opacity var(--t-quick);
}
.insp-card:hover .insp-cap { opacity: 1; }
.insp-card.starred:hover .insp-starred { opacity: 0; }
.insp-cap b { display: block; font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-dim); }
.insp-cap p {
  margin: 2px 0 0; font-size: 10px; line-height: 1.35; color: #d4d4da;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.insp-acts { position: absolute; right: 5px; top: 5px; display: flex; gap: 3px; opacity: 0; transition: opacity var(--t-quick); }
.insp-card:hover .insp-acts, .insp-card.sel .insp-acts, .insp-card.st-failed .insp-acts { opacity: 1; }
.insp-acts button {
  width: 24px; height: 24px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--radius); background: rgba(8, 8, 10, .8); color: var(--text); cursor: pointer;
}
.insp-acts button:hover { background: var(--accent); }
.insp-acts svg { width: 13px; height: 13px; stroke-width: 1.9; }
.insp-acts button.on svg { fill: var(--warn); stroke: var(--warn); }

.insp-card.st-running, .insp-tile.st-running {
  border-style: dashed; border-color: var(--border-dash); cursor: default;
  background: linear-gradient(110deg, #101012 30%, #19191d 50%, #101012 70%); background-size: 220% 100%;
  animation: insp-shimmer 1.6s linear infinite;
}
@keyframes insp-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.insp-run { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: var(--fs-small); color: var(--text-dim); }
.insp-spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(var(--accent-rgb), .22); border-top-color: var(--accent); animation: insp-spin .8s linear infinite; }
@keyframes insp-spin { to { transform: rotate(360deg); } }
.insp-card.st-running .insp-cap { opacity: 1; background: none; padding-top: 0; }
.insp-card.st-running .insp-cap p { color: var(--text-faint); -webkit-line-clamp: 2; }

.insp-card.st-failed, .insp-tile.st-failed { border-color: rgba(255, 107, 107, .45); background: #140c0e; cursor: default; }
.insp-fail { position: absolute; inset: 0; padding: 12px 11px 11px; display: flex; flex-direction: column; gap: 6px; }
.insp-fail b { font-size: var(--fs-small); color: var(--red); }
.insp-fail p {
  margin: 0; flex: 1 1 auto; min-height: 0; overflow: auto; font-size: 10.5px; line-height: 1.4;
  color: var(--text-dim); user-select: text; word-break: break-word; cursor: text;
}
.insp-retry {
  align-self: flex-start; height: 26px; padding: 0 12px; border: none; border-radius: var(--radius);
  background: var(--accent); color: #fff; font: inherit; font-size: var(--fs-small); font-weight: 700; cursor: pointer;
}
.insp-retry:hover { filter: brightness(1.1); }

.insp-card.k-prompt { background: #0e0e11; border-color: #27272d; }
.insp-pt { position: absolute; inset: 0; padding: 28px 12px 10px; }
.insp-pt p {
  margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---- drop, zoom, tip ---- */
.insp-drop {
  position: absolute; inset: 10px; z-index: 30; display: none; align-items: center; justify-content: center; pointer-events: none;
  border: 2px dashed rgba(var(--accent-rgb), .7); border-radius: var(--radius-lg); background: rgba(var(--accent-rgb), .06);
}
#inspmod.dropping .insp-drop { display: flex; }
#inspmod.dropping.empty .insp-drop, #inspmod.dropping.hero .insp-drop { display: none; }
.insp-drop span { padding: 6px 12px; border-radius: var(--radius); background: var(--accent); color: #fff; font-size: var(--fs-mid); font-weight: 600; }
.insp-zoombar {
  position: absolute; left: 10px; top: 10px; z-index: 4; display: flex; align-items: center; gap: 2px; padding: 2px;
  background: var(--chrome-blur-bg); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 10.5px; color: var(--text-dim); cursor: default;
}
.insp-zoombar button { width: 22px; height: 22px; padding: 0; border: none; border-radius: var(--radius-sm); background: none; color: var(--text-dim); font: inherit; font-size: 14px; cursor: pointer; }
.insp-zoombar button:hover { color: var(--text); background: var(--card); }
.insp-zoombar span { min-width: 38px; text-align: center; }
#inspmod.empty .insp-zoombar { display: none; }
/* Nothing selected on a board: no prompt box, one line saying what to do. */
.insp-tip {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 24px); padding: 6px 6px 6px 14px;
  background: var(--chrome-blur-bg); border: 1px solid #222226; border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: var(--fs-small); color: var(--text-dim); cursor: default;
}
.insp-tip > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.insp-tip button {
  flex: none; height: 26px; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px 0 8px;
  border: 1px solid rgba(var(--accent-rgb), .5); border-radius: var(--radius); background: var(--accent-soft);
  color: #fff; font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer;
}
.insp-tip button:hover { background: rgba(var(--accent-rgb), .3); }
.insp-tip svg { width: 12px; height: 12px; stroke-width: 2.2; }
#inspmod.empty .insp-tip, #inspmod.hero .insp-tip, #inspmod.grid .insp-tip, #inspmod.picked .insp-tip { display: none; }

/* ---- the composer: under the selection ---- */
.insp-comp {
  position: absolute; z-index: 6; width: 340px; box-sizing: border-box; cursor: default;
  display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 10px;
  background: rgba(13, 13, 15, .97); border: 1px solid rgba(var(--accent-rgb), .45); border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 18px 44px rgba(0, 0, 0, .6);
}
.insp-comp.off { display: none; }
.insp-comp.docked { left: 50%; top: auto; bottom: 12px; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); }
.insp-comp.hot { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .35), 0 14px 40px rgba(0, 0, 0, .55); }
.insp-comp-top { display: flex; align-items: center; gap: 6px; }
.insp-from { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text); white-space: nowrap; }
.insp-four {
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint);
  padding: 2px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.insp-refs { display: flex; flex-wrap: wrap; gap: 5px; }
.insp-ref { position: relative; width: 38px; height: 38px; overflow: hidden; border-radius: var(--radius); border: 1px solid rgba(var(--accent-rgb), .5); background: #050506; }
.insp-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.insp-ref button {
  position: absolute; right: 1px; top: 1px; width: 15px; height: 15px; padding: 0; display: none;
  border: none; border-radius: 2px; background: rgba(0, 0, 0, .75); color: #fff; font-size: 12px; line-height: 14px; cursor: pointer;
}
.insp-ref:hover button { display: block; }
.insp-addref {
  height: 38px; min-width: 38px; padding: 0 10px; display: inline-flex; align-items: center; gap: 5px;
  border: 1px dashed var(--border-dash); border-radius: var(--radius); background: none;
  color: var(--text-dim); font: inherit; font-size: 10.5px; cursor: pointer;
}
.insp-addref:hover { color: var(--text); border-color: var(--text-faint); }
.insp-addref svg { width: 13px; height: 13px; stroke-width: 2; }
#insp-prompt {
  width: 100%; box-sizing: border-box; min-height: 54px; max-height: 140px; resize: vertical; margin: 0;
  padding: 8px 10px; border-radius: var(--radius); border: 1px solid #26262b; background: var(--bg);
  color: var(--text); font: inherit; font-size: var(--fs-body); line-height: 1.45;
}
#insp-prompt:focus { outline: none; border-color: rgba(var(--accent-rgb), .7); }
.insp-comp-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.insp-keys { font-size: 10px; color: var(--text-faint); white-space: nowrap; }
.insp-go {
  flex: none; height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px;
  border: none; border-radius: var(--radius); background: var(--accent); color: #fff;
  font: inherit; font-size: var(--fs-body); font-weight: 700; white-space: nowrap; cursor: pointer;
  box-shadow: 0 6px 18px rgba(var(--accent-rgb), .25);
}
.insp-go:hover:not(:disabled) { filter: brightness(1.1); }
.insp-go:disabled { opacity: .35; cursor: default; box-shadow: none; }
.insp-go i { font-style: normal; font-weight: 500; font-size: 10.5px; opacity: .8; }
.insp-spark {
  width: 13px; height: 13px; flex: none; background: currentColor;
  -webkit-mask: var(--spark-ico) center / contain no-repeat; mask: var(--spark-ico) center / contain no-repeat;
}
#inspmod.narrow .insp-comp.docked { width: calc(100% - 16px); bottom: 8px; }

/* The start box and the grid of ideas: 42b-inspire-ideas.css. */

/* ---- the card menu, the toast ---- */
.insp-menu {
  position: fixed; z-index: calc(var(--z-menu) + 10); min-width: 180px; padding: 4px; display: flex; flex-direction: column;
  background: #121215; border: 1px solid #27272d; border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgba(0, 0, 0, .6);
}
.insp-menu button { padding: 7px 10px; text-align: left; border: none; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; font-size: var(--fs-body); cursor: pointer; }
.insp-menu button:hover { background: var(--card-hover); }
.insp-menu button.bad { color: var(--red); }
#insp-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: var(--z-toast);
  display: flex; align-items: center; gap: 12px; max-width: min(560px, 90vw); padding: 8px 12px 8px 14px;
  border-radius: var(--radius); background: #131315; border: 1px solid var(--border); color: var(--text); font-size: var(--fs-body);
  opacity: 0; pointer-events: none; transition: opacity var(--t-slow);
}
#insp-toast.show { opacity: 1; pointer-events: auto; }
#insp-toast.bad { border-color: var(--red); color: var(--red); }
#insp-toast button { padding: 0; border: none; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
