/* Restored Media Lab, PhantomCut, and Content Hub presentation from the last complete creator-suite build. */

/* =====================  MEDIA LAB + SETTINGS  ================ */
/* ============================================================= */
.overlay-wide .overlay-panel { width: min(1360px, 100%); }

/* Compact, denser page head just for the Media Lab workspace — same title
   size as every other workspace page (.workspace-page-head h1's shared
   default), only the padding shrinks to make room for Media Lab's own
   Create/Pending/Edit tab row directly below it. */
.workspace-page[data-workspace-page="media"] .workspace-page-head { padding: 8px clamp(18px, 2vw, 28px) 6px; }
.workspace-page[data-workspace-page="media"] .workspace-page-kicker { margin-bottom: 1px; }
.workspace-page[data-workspace-page="media"] .workspace-page-body { padding-top: 8px; }
/* Media Lab is a working cockpit, not a feed — the scrolling system ticker
   is dead weight here and costs real vertical space toward fitting the
   whole cockpit on screen without scrolling. */
.app-main:has(.workspace-page[data-workspace-page="media"]) .phantomwire { display: none; }

.ml-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(12, 24, 18, 0.05); color: var(--dim); font: 600 10.5px "Spline Sans Mono", monospace; letter-spacing: 0.05em; white-space: nowrap; }
.ml-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim-2); flex: 0 0 auto; }
.ml-chip.is-ready { color: var(--ink); border-color: rgba(65, 255, 161,0.3); }
.ml-chip.is-ready i { background: var(--neon); box-shadow: 0 0 8px rgba(65, 255, 161,0.8); animation: mlPulse 2.6s ease-in-out infinite; }
@keyframes mlPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.ml { display: flex; flex-direction: column; gap: 6px; }
/* topbar: view tabs + tool icons (Templates/History/Engine/Settings) +
   a compact engine/credits readout, all in one slim row */
.ml-topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ml-tabs { display: flex; align-items: center; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 4px; border-radius: 13px; background: rgba(12, 24, 18, 0.044); }
.ml-tabs::-webkit-scrollbar { display: none; }
.ml-tab { flex: 0 0 auto; white-space: nowrap; padding: 8px 15px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--dim); cursor: pointer; font: 600 13px "Instrument Sans", sans-serif; transition: background 0.18s, color 0.18s; }
.ml-tab:hover { color: var(--ink); background: rgba(65, 255, 161,0.06); }
.ml-tab.is-active { color: #ffffff; background: linear-gradient(120deg, var(--neon), #41ffa1); box-shadow: 0 4px 16px rgba(65, 255, 161,0.22); }
.ml-topbar-tools { display: flex; align-items: center; gap: 6px; }
.ml-topbar-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: rgba(12, 24, 18, 0.044); color: var(--dim); cursor: pointer; }
.ml-topbar-ic .ic { width: 15px; height: 15px; }
.ml-topbar-ic:hover { color: var(--ink); border-color: var(--line-strong); }
.ml-topbar-ic.is-active { color: var(--neon); border-color: rgba(65, 255, 161,0.4); background: rgba(65, 255, 161,0.08); }
.ml-settings-gear {
  margin-left: auto; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(12, 24, 18, 0.044);
  color: var(--neon); cursor: pointer;
}
.ml-settings-gear .ic { width: 15px; height: 15px; }
.ml-settings-gear:hover,
.ml-settings-gear.is-active { border-color: var(--line-strong); background: rgba(65, 255, 161,0.08); box-shadow: 0 0 16px rgba(65, 255, 161,0.16); }
.ml-asset-open {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 11px;
  background: rgba(65, 255, 161,0.055); color: var(--dim); cursor: pointer;
  font: 700 12px "Instrument Sans", sans-serif; white-space: nowrap;
}
.ml-asset-open .ic { width: 14px; height: 14px; color: var(--neon); }
.ml-asset-open:hover,
.ml-asset-open.is-active { border-color: var(--line-strong); color: var(--ink); background: rgba(65, 255, 161,0.1); }
.ml-engine-mini {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(12, 24, 18, 0.044);
  font: 600 11.5px "Spline Sans Mono", monospace; color: var(--dim); white-space: nowrap;
}
.ml-engine-mini-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim-2); flex: 0 0 auto; }
.ml-engine-mini.is-ready { color: var(--ink); border-color: rgba(65, 255, 161,0.28); }
.ml-engine-mini.is-ready .ml-engine-mini-dot { background: var(--neon); box-shadow: 0 0 8px rgba(65, 255, 161,0.8); animation: mlPulse 2.6s ease-in-out infinite; }
.ml-engine-mini.is-checking { color: var(--ink); border-color: rgba(12, 24, 18,0.2); }
.ml-engine-mini.is-checking .ml-engine-mini-dot { background: #173126; animation: mlPulse 1.8s ease-in-out infinite; }
.ml-engine-mini.is-warn { color: #7a5200; border-color: rgba(199, 126, 0,0.35); }
.ml-engine-mini.is-warn .ml-engine-mini-dot { background: #c77e00; box-shadow: 0 0 8px rgba(199, 126, 0,0.7); }
.ml-engine-mini.is-down { color: #ffb5bf; border-color: rgba(224, 52, 94,0.35); }
.ml-engine-mini.is-down .ml-engine-mini-dot { background: var(--risk); box-shadow: 0 0 8px rgba(224, 52, 94,0.65); }
.ml-engine-mini b { display: inline-flex; align-items: center; gap: 4px; padding-left: 8px; border-left: 1px solid var(--line); color: var(--neon); }
.ml-engine-mini b .ic { width: 11px; height: 11px; }

/* drawers: Templates / History / Engine — slide over the main content,
   real state, not a parallel page */
.ml-drawer-backdrop { position: fixed; inset: 0; z-index: 210; background: var(--glass); backdrop-filter: blur(1px); }
.ml-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 211; width: min(400px, 100vw);
  display: flex; flex-direction: column; background: var(--glass-2);
  border-left: 1px solid var(--line-strong); box-shadow: -30px 0 70px rgba(12, 24, 18, 0.16);
}
.ml-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.ml-drawer-head b { font-size: 15px; font-weight: 700; }
.ml-drawer-x { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: rgba(12, 24, 18, 0.05); color: var(--dim); cursor: pointer; }
.ml-drawer-x:hover { color: var(--ink); border-color: var(--line-strong); }
.ml-drawer-x .ic { width: 13px; height: 13px; }
.ml-drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px 22px; }
.ml-drawer-note { margin: 0 0 12px; font-size: 12px; color: var(--dim); line-height: 1.5; }
.ml-history-rows { display: flex; flex-direction: column; gap: 8px; }
.ml-history-row { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(12, 24, 18, 0.044); }
.ml-history-row i { margin-top: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--dim-2); flex: 0 0 auto; }
.ml-history-row.is-ok i { background: var(--neon); box-shadow: 0 0 6px rgba(65, 255, 161,0.7); }
.ml-history-row.is-warn i { background: var(--warn); box-shadow: 0 0 6px rgba(199, 126, 0,0.6); }
.ml-history-row.is-down i { background: var(--risk); box-shadow: 0 0 6px rgba(224, 52, 94,0.6); }
.ml-history-row b { display: block; font-size: 12.5px; font-weight: 600; }
.ml-history-row span { font-size: 10.5px; color: var(--dim); }
.ml-engine-drawer-rows { display: grid; gap: 6px; margin-bottom: 14px; }
.ml-engine-drawer-rows span { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 8px 10px; border-radius: 9px; background: rgba(12, 24, 18, 0.044); }
.ml-engine-drawer-rows b { color: var(--dim); font-weight: 500; }
.ml-engine-drawer-rows i { font-style: normal; color: var(--ink); text-align: right; }
.ml-asset-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 10px; }
.ml-local-kinds { margin-bottom: 10px; }
.ml-local-summary {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: rgba(12, 24, 18, 0.044);
}
.ml-local-summary b { color: var(--neon); font-size: 12px; }
.ml-local-summary span { color: var(--dim); font: 700 9px "Spline Sans Mono", monospace; letter-spacing: 0.07em; text-transform: uppercase; }
.ml-local-message { color: var(--warn); }
.ml-local-assets { display: grid; gap: 9px; }
.ml-local-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 13px; color: var(--dim); text-align: center; font-size: 12px; }
.ml-local-asset {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px; border: 1px solid var(--line); border-radius: 13px;
  background: linear-gradient(145deg, rgba(65, 255, 161,0.055), rgba(12, 24, 18, 0.036));
}
.ml-local-thumb {
  width: 56px; height: 56px; display: grid; place-items: center; overflow: hidden; border-radius: 11px;
  background: rgba(12, 24, 18, 0.06); border: 1px solid rgba(65, 255, 161,0.12); color: var(--neon);
}
.ml-local-thumb img,
.ml-local-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ml-local-thumb span { display: grid; place-items: center; width: 100%; height: 100%; }
.ml-local-thumb .ic { width: 20px; height: 20px; }
.ml-local-copy { min-width: 0; display: grid; gap: 2px; }
.ml-local-copy b { color: var(--ink); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-local-copy span,
.ml-local-copy i { color: var(--dim); font-size: 10.5px; line-height: 1.25; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-local-actions { display: flex; flex-direction: column; gap: 5px; }
.ml-local-actions button,
.ml-local-actions em {
  min-width: 48px; min-height: 25px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; background: rgba(65, 255, 161,0.07);
  color: var(--ink); font: 700 10px "Instrument Sans"; font-style: normal;
}
.ml-local-actions button { cursor: pointer; }
.ml-local-actions button:hover { border-color: var(--neon); background: rgba(65, 255, 161,0.13); }
.ml-local-actions em { color: var(--dim); background: rgba(12, 24, 18, 0.036); }

/* Assets is a full Media Lab workspace. The catalogue combines persistent
   Asset Cloud files, the explicit local-PC index, and Media Pool without
   pretending those storage locations are interchangeable. */
.ml-asset-catalogue { min-width: 0; display: grid; gap: 12px; padding-bottom: 24px; }
.ml-catalog-command {
  display: flex; align-items: center; gap: 18px; min-width: 0; padding: 18px 20px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: linear-gradient(110deg, rgba(65, 255, 161, 0.09), rgba(12, 24, 18, 0.025) 55%, rgba(51, 255, 161, 0.035));
}
.ml-catalog-command > div:first-child { min-width: 0; flex: 1 1 auto; }
.ml-catalog-command span,
.ml-catalog-results-head span {
  display: block; color: var(--neon); font: 800 9px "Spline Sans Mono", monospace;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.ml-catalog-command h2 { margin: 3px 0 2px; color: var(--ink); font-size: clamp(22px, 2.2vw, 30px); line-height: 1.05; letter-spacing: 0; }
.ml-catalog-command p { margin: 0; color: var(--dim); font-size: 12.5px; line-height: 1.45; }
.ml-catalog-command-actions { display: flex; flex: 0 0 auto; gap: 7px; align-items: center; }
.ml-catalog-command-actions button,
.ml-catalog-empty button,
.ml-catalog-detail-actions button,
.ml-catalog-meta-form button,
.ml-catalog-bulk button {
  min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px;
  background: rgba(12, 24, 18, 0.045); color: var(--ink); cursor: pointer;
  font: 700 11.5px "Instrument Sans", sans-serif;
}
.ml-catalog-command-actions button:first-child,
.ml-catalog-detail-actions .is-primary,
.ml-catalog-empty button { border-color: transparent; background: linear-gradient(120deg, var(--neon), #41ffa1); color: #fff; }
.ml-catalog-command-actions button:hover,
.ml-catalog-detail-actions button:hover,
.ml-catalog-meta-form button:hover,
.ml-catalog-bulk button:hover { border-color: var(--neon); background-color: rgba(65, 255, 161, 0.11); }
.ml-catalog-command-actions .ic,
.ml-catalog-detail-actions .ic,
.ml-catalog-meta-form .ic,
.ml-catalog-bulk .ic { width: 14px; height: 14px; }
.ml-catalog-upload-status {
  position: relative; min-height: 38px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 8px 12px 10px; overflow: hidden; border: 1px solid rgba(51, 255, 161, 0.24); border-radius: 7px;
  background: rgba(51, 255, 161, 0.04); color: var(--dim); font-size: 11px;
}
.ml-catalog-upload-status span { color: var(--ink); font-weight: 700; }
.ml-catalog-upload-status b { justify-self: end; color: var(--neon); font: 800 11px "Spline Sans Mono", monospace; }
.ml-catalog-upload-status i { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(51, 255, 161, 0.08); }
.ml-catalog-upload-status i::before { content: ""; display: block; width: var(--progress); height: 100%; background: var(--neon); transition: width 0.2s ease; }
.ml-catalog-upload-status em { font-style: normal; color: var(--warn); }
.ml-catalog-notice { padding: 10px 12px; border-left: 2px solid var(--neon); background: rgba(65, 255, 161, 0.065); color: var(--ink); font-size: 12px; line-height: 1.45; }
.ml-catalog-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.ml-catalog-stats button {
  min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 11px 14px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--dim); cursor: pointer; text-align: left;
}
.ml-catalog-stats button:last-child { border-right: 0; }
.ml-catalog-stats button:hover,
.ml-catalog-stats button.is-on { color: var(--ink); background: rgba(65, 255, 161, 0.055); box-shadow: inset 0 -2px var(--neon); }
.ml-catalog-stats span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 650; }
.ml-catalog-stats b { color: var(--ink); font: 800 18px "Spline Sans Mono", monospace; }
.ml-catalog-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 130px auto; gap: 8px; align-items: center; }
.ml-catalog-search { min-width: 0; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: rgba(12, 24, 18, 0.035); }
.ml-catalog-search:focus-within { border-color: var(--neon); }
.ml-catalog-search .ic { width: 14px; height: 14px; color: var(--dim); flex: 0 0 auto; }
.ml-catalog-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 600 12px "Instrument Sans", sans-serif; }
.ml-catalog-toolbar select { height: 38px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; background: rgba(12, 24, 18, 0.035); color: var(--ink); font: 700 11px "Instrument Sans", sans-serif; }
.ml-catalog-view { display: grid; grid-template-columns: repeat(2, 36px); gap: 4px; }
.ml-catalog-view button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--dim); cursor: pointer; }
.ml-catalog-view button.is-on { color: var(--neon); border-color: var(--neon); background: rgba(65, 255, 161, 0.08); }
.ml-catalog-view .ic { width: 14px; height: 14px; }
.ml-catalog-layout { min-width: 0; display: grid; grid-template-columns: 172px minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.ml-catalog-filters { min-width: 0; display: grid; gap: 18px; padding: 4px 12px 8px 0; border-right: 1px solid var(--line); }
.ml-catalog-filters section { display: grid; gap: 3px; }
.ml-catalog-filters section > b { margin: 0 0 5px 8px; color: var(--dim); font: 800 9px "Spline Sans Mono", monospace; letter-spacing: 0.13em; text-transform: uppercase; }
.ml-catalog-filters button { min-width: 0; min-height: 35px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px; padding: 7px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--dim); cursor: pointer; text-align: left; font: 650 11.5px "Instrument Sans", sans-serif; }
.ml-catalog-filters button:hover,
.ml-catalog-filters button.is-on { color: var(--ink); background: rgba(65, 255, 161, 0.075); }
.ml-catalog-filters button.is-on { box-shadow: inset 2px 0 var(--neon); }
.ml-catalog-filters button i { max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim-2); font: 700 8px "Spline Sans Mono", monospace; font-style: normal; }
.ml-catalog-filters > p { margin: 0; padding: 9px; border-top: 1px solid var(--line); color: var(--dim); font-size: 10.5px; line-height: 1.45; }
.ml-catalog-results { min-width: 0; }
.ml-catalog-results-head { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ml-catalog-results-head > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.ml-catalog-results-head > div:first-child > b { color: var(--ink); font-size: 13px; }
.ml-catalog-results-head span { color: var(--dim-2); font-size: 8px; }
.ml-catalog-bulk { display: flex; align-items: center; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: rgba(12, 24, 18, 0.035); }
.ml-catalog-bulk > b { padding-inline: 6px; color: var(--ink); font-size: 10.5px; white-space: nowrap; }
.ml-catalog-bulk button { min-height: 28px; padding: 5px 8px; font-size: 10px; }
.ml-catalog-grid { min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(154px, 1fr)); gap: 9px; }
.ml-catalog-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: rgba(12, 24, 18, 0.025); transition: border-color 0.15s, background 0.15s; }
.ml-catalog-card:hover,
.ml-catalog-card.is-active { border-color: var(--line-strong); background: rgba(65, 255, 161, 0.055); }
.ml-catalog-card.is-selected { box-shadow: inset 0 0 0 1px var(--neon); }
.ml-catalog-check { position: absolute; top: 7px; left: 7px; z-index: 3; width: 22px; height: 22px; display: grid; place-items: center; cursor: pointer; }
.ml-catalog-check input { position: absolute; opacity: 0; pointer-events: none; }
.ml-catalog-check span { width: 17px; height: 17px; display: block; border: 1px solid rgba(255,255,255,0.52); border-radius: 5px; background: rgba(3, 8, 12, 0.78); }
.ml-catalog-check input:checked + span { border-color: var(--neon); background: var(--neon); box-shadow: inset 0 0 0 3px rgba(3, 8, 12, 0.78); }
.ml-catalog-preview { position: relative; width: 100%; min-height: 0; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; padding: 0; border: 0; border-radius: 0; background: linear-gradient(145deg, rgba(65, 255, 161, 0.14), rgba(3, 8, 12, 0.85)); color: var(--neon); cursor: pointer; line-height: 0; }
.ml-catalog-preview > span { width: 100%; height: 100%; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.ml-catalog-preview img,
.ml-catalog-preview video { width: 100%; height: 100%; min-height: 0; max-height: 100%; object-fit: cover; display: block; }
.ml-catalog-preview .ic { width: 25px; height: 25px; }
.ml-catalog-preview > i { position: absolute; right: 7px; bottom: 7px; padding: 3px 6px; border-radius: 4px; background: rgba(3, 8, 12, 0.78); color: #eaf7f2; font: 800 8px "Spline Sans Mono", monospace; font-style: normal; letter-spacing: 0.08em; text-transform: uppercase; }
.ml-catalog-audio-art { width: 100%; height: 100%; display: grid; place-items: center; color: var(--neon); background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(65, 255, 161, 0.09) 10px 11px); }
.ml-catalog-card-copy { min-width: 0; display: grid; gap: 3px; padding: 9px 10px 10px; }
.ml-catalog-card-copy button { min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.ml-catalog-card-copy b,
.ml-catalog-card-copy span,
.ml-catalog-card-copy i { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-catalog-card-copy b { display: block; color: var(--ink); font-size: 11.5px; }
.ml-catalog-card-copy span,
.ml-catalog-card-copy i { color: var(--dim); font-size: 9.5px; font-style: normal; }
.ml-catalog-favorite { position: absolute; z-index: 3; right: 7px; top: 7px; width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,0.22); border-radius: 6px; background: rgba(3, 8, 12, 0.74); color: #dbe9e5; cursor: pointer; }
.ml-catalog-favorite.is-on { color: var(--neon); border-color: var(--neon); }
.ml-catalog-favorite .ic { width: 13px; height: 13px; }
.ml-asset-catalogue.is-list .ml-catalog-grid { grid-template-columns: 1fr; gap: 5px; }
.ml-asset-catalogue.is-list .ml-catalog-card { display: grid; grid-template-columns: 104px minmax(0, 1fr); min-height: 76px; }
.ml-asset-catalogue.is-list .ml-catalog-preview { grid-row: 1; width: 104px; min-height: 74px; aspect-ratio: auto; }
.ml-asset-catalogue.is-list .ml-catalog-card-copy { align-content: center; padding-right: 42px; }
.ml-catalog-detail { min-width: 0; position: sticky; top: 0; display: grid; gap: 12px; padding-left: 14px; border-left: 1px solid var(--line); }
.ml-catalog-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ml-catalog-detail-head span { color: var(--neon); font: 800 8px "Spline Sans Mono", monospace; letter-spacing: 0.12em; text-transform: uppercase; }
.ml-catalog-detail-head h3 { margin: 3px 0 0; max-width: 240px; overflow-wrap: anywhere; color: var(--ink); font-size: 16px; line-height: 1.2; }
.ml-catalog-detail-head button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--dim); cursor: pointer; }
.ml-catalog-detail-head .ic { width: 13px; height: 13px; }
.ml-catalog-detail-preview { width: 100%; aspect-ratio: 16 / 11; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: linear-gradient(145deg, rgba(65, 255, 161, 0.13), rgba(3, 8, 12, 0.86)); color: var(--neon); }
.ml-catalog-detail-preview > .ic { width: 30px; height: 30px; }
.ml-catalog-detail-preview img,
.ml-catalog-detail-preview video { width: 100%; height: 100%; object-fit: contain; display: block; background: #03080c; }
.ml-catalog-detail-preview:has(audio) { grid-template-rows: minmax(120px, 1fr) auto; }
.ml-catalog-detail-preview audio { width: calc(100% - 16px); margin: 8px; }
.ml-catalog-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.ml-catalog-meta div { min-width: 0; display: grid; gap: 2px; padding: 8px 9px; background: var(--glass-2); }
.ml-catalog-meta dt { color: var(--dim); font: 800 8px "Spline Sans Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; }
.ml-catalog-meta dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 10.5px; }
.ml-catalog-meta-form { display: grid; gap: 8px; }
.ml-catalog-meta-form label { display: grid; gap: 4px; }
.ml-catalog-meta-form label span { color: var(--dim); font: 800 8px "Spline Sans Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; }
.ml-catalog-meta-form input { width: 100%; min-width: 0; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: rgba(12, 24, 18, 0.035); color: var(--ink); outline: 0; font-size: 11.5px; }
.ml-catalog-meta-form input:focus { border-color: var(--neon); }
.ml-catalog-meta-form button { justify-self: start; min-height: 32px; }
.ml-catalog-readonly { display: grid; gap: 3px; padding: 9px 10px; border-left: 2px solid var(--neon); background: rgba(51, 255, 161, 0.035); }
.ml-catalog-readonly b { color: var(--ink); font-size: 10.5px; }
.ml-catalog-readonly span { color: var(--dim); font-size: 10px; line-height: 1.4; }
.ml-catalog-detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ml-catalog-detail-actions button { min-width: 0; }
.ml-catalog-detail-actions button.is-danger { color: var(--risk); }
.ml-catalog-detail-empty,
.ml-catalog-empty { min-height: 260px; display: grid; justify-items: center; align-content: center; gap: 7px; padding: 24px; border: 1px dashed var(--line); border-radius: 7px; color: var(--dim); text-align: center; }
.ml-catalog-detail-empty { min-height: 210px; }
.ml-catalog-empty > .ic,
.ml-catalog-detail-empty > .ic { width: 30px; height: 30px; color: var(--neon); }
.ml-catalog-empty b,
.ml-catalog-detail-empty b { color: var(--ink); font-size: 14px; }
.ml-catalog-empty span,
.ml-catalog-detail-empty span { max-width: 340px; font-size: 11px; line-height: 1.45; }
.ml-catalog-empty.is-loading i { width: 26px; height: 26px; border: 2px solid rgba(65, 255, 161, 0.18); border-top-color: var(--neon); border-radius: 50%; animation: mlSpin 0.8s linear infinite; }
@keyframes mlSpin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .ml-catalog-layout { grid-template-columns: 160px minmax(0, 1fr); }
  .ml-catalog-detail { position: static; grid-column: 2; padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .ml-catalog-detail:not(.is-open) { display: none; }
  .ml-catalog-detail-preview { max-height: 360px; }
}
@media (max-width: 760px) {
  .ml-catalog-command { align-items: flex-start; flex-direction: column; padding: 14px; }
  .ml-catalog-command-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ml-catalog-command-actions button { min-width: 0; padding-inline: 6px; }
  .ml-catalog-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ml-catalog-stats button:nth-child(2) { border-right: 0; }
  .ml-catalog-stats button:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .ml-catalog-toolbar { grid-template-columns: minmax(0, 1fr) 112px auto; }
  .ml-catalog-layout { grid-template-columns: 1fr; }
  .ml-catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 0 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .ml-catalog-filters > p { grid-column: 1 / -1; }
  .ml-catalog-detail { grid-column: 1; }
  .ml-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ml-catalog-results-head { align-items: flex-start; flex-direction: column; }
  .ml-catalog-bulk { width: 100%; overflow-x: auto; }
}
@media (max-width: 460px) {
  .ml-catalog-command-actions { grid-template-columns: 1fr 1fr; }
  .ml-catalog-command-actions button:last-child { grid-column: 1 / -1; }
  .ml-catalog-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .ml-catalog-toolbar select { grid-row: 2; grid-column: 1 / -1; }
  .ml-catalog-grid { grid-template-columns: 1fr; }
  .ml-asset-catalogue.is-list .ml-catalog-card { grid-template-columns: 86px minmax(0, 1fr); }
  .ml-asset-catalogue.is-list .ml-catalog-preview { width: 86px; }
  .ml-catalog-detail-actions { grid-template-columns: 1fr; }
}
/* drag & drop: local-asset cards + OS file drops */
.ml-local-asset[draggable="true"] { cursor: grab; }
.ml-local-asset[draggable="true"]:active { cursor: grabbing; }
.ml-asset-dragging .ml-drawer-backdrop { pointer-events: none; }
.ml-asset-dragging .ml-tabs { overflow: visible; }
.ml-asset-dragging [data-ml-dropzone] { position: relative; z-index: 250; }
[data-ml-dropzone].is-ml-droptarget {
  position: relative;
  box-shadow: inset 0 0 0 2px rgba(65, 255, 161,0.55);
  border-radius: 10px;
}
[data-ml-dropzone].is-ml-droptarget::after {
  content: attr(data-ml-dropzone-label);
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--neon);
  background: var(--glass); color: var(--neon);
  font: 700 10px "Instrument Sans", sans-serif; letter-spacing: 0.03em;
  white-space: nowrap; pointer-events: none; z-index: 260;
}
[data-ml-dropzone].is-ml-droptarget.is-dragover {
  box-shadow: inset 0 0 0 2px var(--neon), 0 0 18px rgba(65, 255, 161,0.4);
}
.ml-os-drop-overlay {
  position: fixed; inset: 0; z-index: 320;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass); border: 2px dashed rgba(65, 255, 161,0.8);
  color: var(--neon); font: 800 15px "Instrument Sans", sans-serif; letter-spacing: 0.02em;
  pointer-events: none; text-align: center; padding: 20px;
}
.ml-drawer-settings { display: grid; gap: 14px; }
.ml-drawer-section {
  display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--glass);
}
.ml-drawer-label {
  color: var(--neon); font: 800 10px "Spline Sans Mono", monospace;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.ml-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.ml-settings-empty { padding: 10px 11px; border-radius: 11px; border: 1px solid rgba(199, 126, 0,0.3); color: #7a5200; background: rgba(199, 126, 0,0.06); font-size: 12px; }
.ml-settings-textarea { min-height: 74px; resize: vertical; }

/* cockpit flow: shot builder -> hero CTA -> preview stage -> production rail,
   stacked as one vertical sequence instead of three competing side columns —
   the stage is the centerpiece, everything else supports it. */
/* main workspace: Shot Builder (left, controls + primary action) / Preview
   Stage (right, the hero) — a real two-column cockpit, not a stacked flow */
/* stretch, not start: the Shot Builder's height varies with how many rows
   are open (negative prompt, advanced settings) — if the stage cell doesn't
   stretch to match, its shorter idle content leaves a dead gap of raw
   background before the status strip below. */
.ml-workspace { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 12px; align-items: stretch; }
.ml-brief {
  display: flex; flex-direction: column; gap: 7px;
  padding: 10px clamp(14px, 1.6vw, 20px); border: 1px solid var(--line); border-radius: 20px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 20px 50px rgba(0,0,0,0.28);
}
.ml-brief-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ml-brief-head .ml-card-head { padding-bottom: 0; margin-bottom: 0; }
.ml-brief-head .ml-card-head::after { display: none; }
.ml-brief-head .ml-seg { flex: 0 0 auto; }
.ml-setup-link {
  flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  max-width: 100%; padding: 8px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(12, 24, 18, 0.044);
  color: var(--ink); cursor: pointer; font: 700 11px "Spline Sans Mono", monospace;
  letter-spacing: 0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ml-setup-link .ic { width: 13px; height: 13px; color: var(--neon); flex: 0 0 auto; }
.ml-setup-link:hover { border-color: var(--line-strong); background: rgba(65, 255, 161,0.06); }
.ml-brief-engine { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.ml-brief-engine .ml-field:first-child { flex: 1 1 auto; }
.ml-brief-engine .ml-provs { flex-wrap: wrap; }
.ml-brief-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ml-brief-row .ml-field { flex: 1 1 90px; min-width: 88px; }
.ml-brief-row .ml-grow { flex: 1 1 140px; }
.ml-advanced { border: 1px solid var(--line); border-radius: 12px; padding: 2px 12px; background: rgba(12, 24, 18, 0.032); }
.ml-advanced summary { display: flex; align-items: center; gap: 8px; padding: 6px 0; font: 600 12px "Instrument Sans", sans-serif; color: var(--dim); cursor: pointer; list-style: none; }
.ml-advanced summary::-webkit-details-marker { display: none; }
.ml-advanced summary .ic { width: 13px; height: 13px; }
.ml-advanced[open] summary { color: var(--ink); }
.ml-advanced-body { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 8px; }
.ml-seg-sm button { padding: 7px 10px; font-size: 12px; }
.ml-advanced-note { margin: 0; font-size: 11px; color: var(--dim); }
.ml-settings-needed {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; border-radius: 12px; border: 1px dashed rgba(199, 126, 0,0.45);
  background: rgba(199, 126, 0,0.06); color: #7a5200; cursor: pointer;
  font: 700 12px "Instrument Sans", sans-serif;
}
.ml-settings-needed .ic { width: 14px; height: 14px; }
/* reference drop: a slim row, not a giant dead rectangle */
.ml-drop { position: relative; display: flex; align-items: center; gap: 10px; min-height: 0; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 12px; background: rgba(65, 255, 161,0.02); color: var(--dim); cursor: pointer; text-align: left; font-size: 12px; }
.ml-drop.drag { border-color: var(--neon); background: rgba(65, 255, 161,0.08); }
.ml-drop-ic { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(65, 255, 161,0.08); color: var(--neon); }
.ml-drop-ic .ic { width: 15px; height: 15px; }
.ml-drop-copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ml-drop-copy b { font-size: 11.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.ml-drop-copy i { font-style: normal; font-size: 10.5px; color: var(--dim); }
.ml-drop-browse { flex: 0 0 auto; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(12, 24, 18, 0.05); color: var(--ink); font: 600 11px "Spline Sans Mono", monospace; cursor: pointer; }
.ml-drop-browse:hover { border-color: var(--neon); color: var(--neon); }
.ml-drop.has-ref { padding: 6px; }
.ml-drop.has-ref img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.ml-card-head { display: flex; flex-direction: column; gap: 3px; padding-bottom: 12px; margin-bottom: 4px; position: relative; }
.ml-card-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, rgba(65, 255, 161,0.32), transparent 75%); }
.ml-card-head b { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.ml-card-head i { font: 500 10px "Spline Sans Mono", monospace; font-style: normal; color: var(--dim); letter-spacing: 0.12em; text-transform: uppercase; }
.ml-field { display: flex; flex-direction: column; gap: 5px; }
.ml-field > span { font: 600 9.5px "Spline Sans Mono", monospace; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.ml-grow { flex: 1; }
.ml-row { display: flex; gap: 12px; }
.ml-seg { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(12, 24, 18, 0.05); }
.ml-seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px; border: 0; border-radius: 9px; background: none; color: var(--dim); cursor: pointer; font: 600 13px "Instrument Sans"; }
.ml-seg button .ic { width: 15px; height: 15px; }
.ml-seg button.is-on { background: linear-gradient(120deg, var(--neon), #41ffa1); color: #ffffff; }
/* Templates drawer: presets live here now, not inline in the Shot Builder */
.ml-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  scrollbar-width: thin;
  scrollbar-color: rgba(65, 255, 161,0.35) rgba(0,0,0,0.15);
}
.ml-preset {
  position: relative;
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(90% 80% at 10% 0%, rgba(65, 255, 161,0.11), transparent 56%),
    linear-gradient(160deg, rgba(255, 255, 255,0.82), rgba(12, 24, 18, 0.056));
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}
.ml-preset::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, transparent, rgba(65, 255, 161,0.72), transparent); opacity: 0.35; }
.ml-preset.is-video::before { background: linear-gradient(90deg, transparent, rgba(22, 217, 133,0.78), transparent); }
.ml-preset:hover { border-color: var(--line-strong); background: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(12, 24, 18, 0.056)); box-shadow: inset 0 0 0 1px rgba(65, 255, 161,0.12); }
.ml-preset.is-on { border-color: var(--neon); box-shadow: 0 0 0 1px rgba(65, 255, 161,0.36) inset, 0 12px 28px rgba(65, 255, 161,0.1); }
.ml-preset.is-video.is-on { border-color: rgba(22, 217, 133,0.9); box-shadow: 0 0 0 1px rgba(22, 217, 133,0.26) inset, 0 12px 28px rgba(22, 217, 133,0.09); }
.ml-preset b { font-size: 13px; line-height: 1.12; letter-spacing: -0.01em; }
.ml-preset-kicker { display: inline-flex; align-items: center; gap: 5px; width: fit-content; max-width: 100%; color: var(--ink); font: 700 8.5px "Spline Sans Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-preset-kicker .ic { width: 12px; height: 12px; flex: 0 0 auto; color: var(--neon); }
.ml-preset-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.ml-preset-meta i { display: inline-flex; align-items: center; min-height: 19px; padding: 2px 6px; border: 1px solid rgba(65, 255, 161,0.2); border-radius: 999px; background: rgba(65, 255, 161,0.06); color: var(--ink); font: 700 9px "Spline Sans Mono", monospace; font-style: normal; line-height: 1; }
.ml-preset.is-video .ml-preset-meta i { border-color: rgba(22, 217, 133,0.19); background: rgba(22, 217, 133,0.055); }
.ml-preset em { font-style: normal; font-size: 10.5px; color: var(--dim); line-height: 1.32; }
.ml-provs { display: flex; flex-wrap: wrap; gap: 8px; }
.ml-prov { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--glass); color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 500; transition: border-color 0.18s, background 0.18s; }
.ml-prov i { width: 9px; height: 9px; border-radius: 50%; }
.ml-prov:hover { border-color: var(--line-strong); }
.ml-prov.is-on { border-color: var(--pb, var(--neon)); background: rgba(65, 255, 161,0.08); box-shadow: 0 0 0 1px var(--pb, var(--neon)) inset; }
.ml-hint { font-size: 12.5px; color: var(--dim); }
.ml-hint b { color: var(--neon); cursor: pointer; }
.ml-select, .ml-text-in { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(12, 24, 18, 0.06); color: var(--ink); font-size: 13.5px; outline: none; }
.ml-select:focus, .ml-text-in:focus { border-color: var(--neon); }
/* native <select> styled as a compact closed pill — click anywhere on it to
   open the (grouped, for aspect) native dropdown; no custom popover needed */
.ml-select-pill {
  width: auto; appearance: none; -webkit-appearance: none; padding: 8px 26px 8px 12px; font-weight: 600;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 6l4 4 4-4' fill='none' stroke='%2341ffa1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>"), linear-gradient(rgba(12, 24, 18, 0.105), rgba(12, 24, 18, 0.105));
  background-repeat: no-repeat, no-repeat; background-position: right 8px center, 0 0; background-size: 12px, 100%;
}
.ml-prompt-wrap { position: relative; }
.ml-prompt { width: 100%; padding: 12px 12px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(12, 24, 18, 0.06); color: var(--ink); font: 400 14px "Instrument Sans"; outline: none; resize: vertical; }
.ml-prompt:focus { border-color: var(--neon); }
.ml-prompt.shake { animation: mlShake 0.4s; border-color: var(--warn); }
/* the shot brief is the star control — give it presence */
.ml-field-brief > span { color: var(--ink); }
.ml-field-brief .ml-prompt { min-height: 60px; font-size: 14.5px; line-height: 1.5; border-color: rgba(65, 255, 161,0.26); background: linear-gradient(180deg, rgba(255, 255, 255,0.85), rgba(12, 24, 18, 0.07)); box-shadow: 0 0 0 1px rgba(65, 255, 161,0.05), 0 12px 30px rgba(0,0,0,0.22); }
.ml-field-brief .ml-prompt:focus { border-color: var(--neon); box-shadow: 0 0 0 1px var(--neon), 0 12px 34px rgba(65, 255, 161,0.12); }
html[data-org-color-mode="dark"] .ml-field-brief .ml-prompt {
  background:
    linear-gradient(180deg, rgba(11, 24, 31, 0.96), rgba(4, 10, 15, 0.94)),
    rgba(4, 10, 15, 0.94);
  color: #eef8f5;
  border-color: rgba(51, 255, 161, 0.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 12px 30px rgba(0,0,0,0.28);
}
html[data-org-color-mode="dark"] .ml-field-brief .ml-prompt::placeholder {
  color: rgba(210, 230, 226, 0.58);
}
@keyframes mlShake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-5px)} 40%,80%{transform:translateX(5px)} }
.ml-enhance { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(65, 255, 161,0.08); color: var(--neon); cursor: pointer; font: 600 11px "Spline Sans Mono", monospace; }
.ml-enhance:hover { background: rgba(65, 255, 161,0.16); }
.ml-enhance .ic { width: 13px; height: 13px; }
.ml-link { align-self: flex-start; background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 12px; padding: 0; }
.ml-link:hover { color: var(--neon); }
.ml-chips { display: flex; gap: 6px; }
.ml-chips-wrap { flex-wrap: wrap; }
.ml-chips button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(12, 24, 18, 0.04); color: var(--dim); cursor: pointer; font: 500 12px "Spline Sans Mono", monospace; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.ml-chips button:hover { border-color: var(--line-strong); color: var(--ink); }
.ml-chips button.is-on { border-color: var(--neon); color: var(--neon); background: rgba(65, 255, 161,0.1); }
.ml-drop-x { flex: 0 0 auto; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--glass); color: #fff; cursor: pointer; }
.ml-drop-x .ic { width: 12px; height: 12px; }
.ml-generate { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border: 0; border-radius: 13px; cursor: pointer; color: #ffffff; background: linear-gradient(120deg, var(--neon), #41ffa1); font: 700 14px "Instrument Sans"; box-shadow: 0 8px 24px rgba(65, 255, 161,0.24); transition: transform 0.15s, opacity 0.2s; }
.ml-generate:hover { transform: translateY(-1px); }
.ml-generate[disabled] { opacity: 0.5; cursor: default; transform: none; }
.ml-generate .ic { width: 16px; height: 16px; }
.ml-generate.ml-ghost { background: none; border: 1px solid var(--line-strong); color: var(--ink); box-shadow: none; }
.ml-generate.ml-inline { padding: 11px 16px; font-size: 13px; }
/* the ONE hero CTA (Shot Builder's "Generate") gets the premium glow treatment;
   the smaller reused .ml-generate buttons (save/download/upload) stay simple rows */
.ml-generate.ml-hero {
  position: relative; overflow: hidden; flex-direction: column; gap: 2px;
  padding: 12px 16px 10px; border-radius: 15px;
  box-shadow: 0 10px 30px rgba(65, 255, 161,0.3), inset 0 1px 0 rgba(255,255,255,0.35);
}
.ml-generate.ml-hero:hover { box-shadow: 0 14px 36px rgba(65, 255, 161,0.4), inset 0 1px 0 rgba(255,255,255,0.35); }
.ml-generate-glow { position: absolute; inset: -40%; z-index: 0; pointer-events: none; background: var(--glass); animation: mlGenerateGlow 5s ease-in-out infinite; }
@keyframes mlGenerateGlow { 0%, 100% { transform: translate(-18%, -10%) scale(0.8); opacity: 0.5; } 50% { transform: translate(14%, 14%) scale(1.05); opacity: 0.85; } }
.ml-generate-main { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; text-transform: capitalize; font-size: 14.5px; }
.ml-generate-hint { position: relative; z-index: 1; font: 600 10px "Spline Sans Mono", monospace; font-style: normal; letter-spacing: 0.03em; color: rgba(255, 255, 255,0.62); }
/* ---- preview stage (right column) ---- */
.ml-stage { min-width: 0; display: flex; flex-direction: column; }
.ml-stage-frame {
  position: relative; display: flex; flex-direction: column; flex: 1 1 auto; border: 1px solid var(--line-strong); border-radius: 20px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(65, 255, 161,0.08), transparent 55%),
    var(--glass);
  box-shadow: 0 24px 70px rgba(12, 24, 18, 0.14), inset 0 1px 0 rgba(255,255,255,0.04);
}
.ml-stage-frame::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(115deg, transparent 32%, rgba(65, 255, 161,0.055) 50%, transparent 68%);
  background-size: 260% 100%; animation: mlSheen 9s ease-in-out infinite;
}
@keyframes mlSheen { 0% { background-position: 130% 0; } 60%, 100% { background-position: -40% 0; } }
.ml-stage-top {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: rgba(12, 24, 18, 0.06);
  font: 600 9.5px "Spline Sans Mono", monospace; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim);
}
.ml-stage-top b { flex: 1; text-align: center; color: var(--dim); font-weight: 600; }
.ml-stage-tools { display: inline-flex; align-items: center; gap: 8px; }
.ml-stage-chip { color: var(--neon); }
.ml-stage-ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: rgba(12, 24, 18, 0.05); color: var(--dim); cursor: pointer; }
.ml-stage-ic:hover { border-color: var(--line-strong); color: var(--ink); }
.ml-stage-ic .ic { width: 13px; height: 13px; }
/* fullscreen: the stage takes over the studio's center column visually by
   floating above everything else — no layout reflow of the rail/builder */
/* Fullscreen: the FRAME is the one scrolling region (sticky header on top);
   the view must lay out top-down instead of its normal vertical centering,
   or tall content spills into the footer/next-steps below it instead of
   scrolling — align-content:center + overflow:visible was the exact bug. */
.ml-stage-frame.is-full {
  position: fixed; inset: clamp(12px, 3vh, 40px); z-index: 200; overflow-y: auto;
  box-shadow: 0 0 0 100vmax rgba(255, 255, 255,0.86), 0 40px 120px rgba(12, 24, 18, 0.16);
}
.ml-stage-frame.is-full .ml-stage-top { position: sticky; top: 0; z-index: 3; }
.ml-stage-frame.is-full .ml-stage-view {
  /* the explicit min-height:380px (needed for the normal idle/small-batch
     view) overrides flexbox's automatic content-based minimum, so without
     flex-shrink:0 this column-flex item shrinks BELOW its actual content
     height and the overflow spills into the meta/next-steps siblings below
     instead of scrolling — flex-shrink:0 forces it to its real content size. */
  align-content: start; flex-shrink: 0;
}
.ml-rec { display: inline-flex; align-items: center; gap: 6px; }
.ml-rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim-2); }
.ml-rec.is-live { color: #ffb9c4; }
.ml-rec.is-live i { background: var(--risk); box-shadow: 0 0 10px rgba(224, 52, 94,0.8); animation: mlPulse 1.1s ease-in-out infinite; }
.ml-stage-view { position: relative; padding: clamp(12px, 2vw, 20px); min-height: 240px; display: grid; align-content: center; flex: 1 1 auto; }
.ml-stage-view::before {
  content: ""; position: absolute; inset: 10px; pointer-events: none; opacity: 0.5; z-index: 1;
  background:
    linear-gradient(var(--neon), var(--neon)) left 0 top 0 / 16px 1.5px,
    linear-gradient(var(--neon), var(--neon)) left 0 top 0 / 1.5px 16px,
    linear-gradient(var(--neon), var(--neon)) right 0 top 0 / 16px 1.5px,
    linear-gradient(var(--neon), var(--neon)) right 0 top 0 / 1.5px 16px,
    linear-gradient(var(--neon), var(--neon)) left 0 bottom 0 / 16px 1.5px,
    linear-gradient(var(--neon), var(--neon)) left 0 bottom 0 / 1.5px 16px,
    linear-gradient(var(--neon), var(--neon)) right 0 bottom 0 / 16px 1.5px,
    linear-gradient(var(--neon), var(--neon)) right 0 bottom 0 / 1.5px 16px;
  background-repeat: no-repeat;
}
.ml-stage-meta { padding: 10px 14px; border-top: 1px solid var(--line); background: rgba(12, 24, 18, 0.052); }
.ml-brief-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ml-brief-chips span { padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; font: 500 10.5px "Spline Sans Mono", monospace; color: var(--ink); background: rgba(65, 255, 161,0.05); }

/* ---- Next steps: what to do with the cut you just made ---- */
.ml-next { position: relative; z-index: 2; padding: 14px 14px 16px; border-top: 1px solid var(--line); background: rgba(12, 24, 18, 0.04); }
.ml-next-head { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; color: var(--dim); }
.ml-next-head .ic { width: 13px; height: 13px; color: var(--neon); }
.ml-next-head b { font: 700 12.5px "Instrument Sans", sans-serif; color: var(--ink); }
.ml-next-head span { font-size: 11px; color: var(--dim); }
.ml-next-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ml-next-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 13px; cursor: pointer; color: var(--ink);
  background: linear-gradient(160deg, rgba(255,255,255,0.03), rgba(12, 24, 18, 0.036));
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.ml-next-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.ml-next-card[disabled] { opacity: 0.45; cursor: default; transform: none; }
.ml-next-card .ic { width: 16px; height: 16px; }
.ml-next-card b { font: 700 12.5px "Instrument Sans", sans-serif; letter-spacing: -0.01em; }
.ml-next-card span { font: 500 10.5px "Spline Sans Mono", monospace; color: var(--dim); }
.ml-next-card.is-neon .ic { color: var(--neon); }
.ml-next-card.is-neon:hover { box-shadow: 0 10px 26px rgba(65, 255, 161,0.14); }
.ml-next-card.is-cyan .ic { color: var(--neon-2); }
.ml-next-card.is-cyan:hover { box-shadow: 0 10px 26px rgba(22, 217, 133,0.12); }
.ml-next-card.is-gold .ic { color: var(--warn); }
.ml-next-card.is-gold:hover { box-shadow: 0 10px 26px rgba(199, 126, 0,0.12); }
.ml-next-card.is-ghost .ic { color: var(--dim); }

/* ---- Job log: a slim, honest trail under the studio ---- */
.ml-joblog { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(12, 24, 18, 0.036); font-size: 11px; color: var(--dim); }
.ml-joblog-label { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; font: 700 10px "Spline Sans Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim-2); }
.ml-joblog-label .ic { width: 11px; height: 11px; }
.ml-joblog-rows { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 14px; overflow-x: auto; scrollbar-width: none; }
.ml-joblog-rows::-webkit-scrollbar { display: none; }
.ml-joblog-row { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ml-joblog-row i { width: 5px; height: 5px; border-radius: 50%; background: var(--dim-2); }
.ml-joblog-row.is-ok i { background: var(--neon); box-shadow: 0 0 6px rgba(65, 255, 161,0.7); }
.ml-joblog-row.is-warn i { background: var(--warn); box-shadow: 0 0 6px rgba(199, 126, 0,0.6); }
.ml-joblog-row.is-down i { background: var(--risk); box-shadow: 0 0 6px rgba(224, 52, 94,0.6); }
.ml-joblog-clear { flex: 0 0 auto; background: none; border: 0; color: var(--dim); cursor: pointer; font: 600 10px "Spline Sans Mono", monospace; text-transform: uppercase; letter-spacing: 0.06em; }
.ml-joblog-clear:hover { color: var(--ink); }

/* idle stage — a lit set waiting for its first shot */
.ml-idle { position: relative; display: grid; justify-items: center; align-content: center; gap: 6px; text-align: center; min-height: 220px; color: var(--dim); padding: 6px; }
.ml-idle::before {
  content: ""; position: absolute; inset: -10% -10% auto; height: 62%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 60% at 30% 20%, rgba(65, 255, 161,0.16), transparent 70%),
    radial-gradient(32% 55% at 72% 12%, rgba(22, 217, 133,0.11), transparent 70%);
  filter: blur(2px);
}
.ml-idle > * { position: relative; z-index: 1; }
.ml-idle-orb { position: relative; width: 82px; height: 82px; margin-bottom: 2px; }
.ml-idle-orb span { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(65, 255, 161,0.4); opacity: 0; animation: mlOrb 3.9s ease-out infinite; }
.ml-idle-orb span:nth-child(2) { animation-delay: 1.3s; }
.ml-idle-orb span:nth-child(3) { animation-delay: 2.6s; }
.ml-idle-orb::after {
  content: ""; position: absolute; inset: 31%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.92), rgba(65, 255, 161,0.55) 45%, rgba(65, 255, 161,0.08) 78%);
  box-shadow: 0 0 46px rgba(65, 255, 161,0.45), 0 0 90px rgba(65, 255, 161,0.18); animation: mlFloat 5s ease-in-out infinite;
}
@keyframes mlOrb { 0% { transform: scale(0.45); opacity: 0.85; } 100% { transform: scale(1.12); opacity: 0; } }
@keyframes mlFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.ml-idle b { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -0.015em; }
.ml-idle i { font-style: normal; font-size: 12.5px; max-width: 400px; line-height: 1.6; color: var(--dim); }
.ml-board { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ml-board-cell { position: relative; overflow: hidden; width: 44px; border-radius: 6px; border: 1px solid var(--line); background: linear-gradient(150deg, rgba(65, 255, 161,0.15), rgba(22, 217, 133,0.05) 60%, rgba(12, 24, 18, 0.05)); }
.ml-board-cell[data-ratio="1:1"] { aspect-ratio: 1 / 1; }
.ml-board-cell[data-ratio="4:5"] { aspect-ratio: 4 / 5; }
.ml-board-cell[data-ratio="16:9"] { aspect-ratio: 16 / 9; width: 62px; }
.ml-board-cell[data-ratio="9:16"] { aspect-ratio: 9 / 16; width: 32px; }
.ml-board-cell[data-ratio="3:2"] { aspect-ratio: 3 / 2; width: 54px; }
.ml-board-cell::after { content: ""; position: absolute; inset: 0; background: var(--glass); transform: translateX(-100%); animation: mlShim 2.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ml-idle-hints { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 6px; }
.ml-idle-hints button { padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(12, 24, 18, 0.05); color: var(--ink); cursor: pointer; font: 500 11px "Spline Sans Mono", monospace; transition: border-color 0.15s, color 0.15s; }
.ml-idle-hints button:hover { border-color: var(--neon); color: var(--neon); }

/* ---- production rail: a mission-control strip under the stage, not a
   tall column competing with it for width ---- */
/* one slim strip instead of a wall of cards — credits, content hub, and a
   queue count that expands into a dropdown only when you click it */
.ml-rail { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ml-rail-credit {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px;
  border: 1px solid rgba(65, 255, 161,0.28); background: linear-gradient(120deg, rgba(65, 255, 161,0.08), rgba(12, 24, 18, 0.044));
  font: 600 12px "Spline Sans Mono", monospace; color: var(--dim);
}
.ml-rail-credit .ic { width: 13px; height: 13px; color: var(--neon); }
.ml-rail-credit b { font-size: 15px; color: var(--ink); font-weight: 700; }
.ml-rail-credit span { text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; }
.ml-rail-credit-meter { display: inline-block; width: 56px; height: 5px; border-radius: 999px; background: rgba(65, 255, 161,0.12); overflow: hidden; }
.ml-rail-credit-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #41ffa1, var(--neon)); box-shadow: 0 0 8px rgba(65, 255, 161,0.5); }
.ml-queue-drop { position: relative; }
.ml-queue-drop summary {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(12, 24, 18, 0.044); color: var(--dim); font: 600 11.5px "Spline Sans Mono", monospace; cursor: pointer; list-style: none;
}
.ml-queue-drop summary::-webkit-details-marker { display: none; }
.ml-queue-drop summary:hover { color: var(--ink); border-color: var(--line-strong); }
.ml-queue-drop summary .ic { width: 13px; height: 13px; }
.ml-queue-drop summary b { color: var(--ink); }
.ml-queue-drop[open] summary { color: var(--neon); border-color: rgba(65, 255, 161,0.4); }
.ml-queue-pop {
  position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: min(340px, 90vw); padding: 12px;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--glass-2); box-shadow: 0 20px 50px rgba(12, 24, 18, 0.16);
}
.ml-rail-empty { margin: 0; font-size: 11.5px; color: var(--dim); }
.ml-queue { display: grid; gap: 8px; width: 100%; }
.ml-q-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: rgba(12, 24, 18, 0.044); color: var(--ink); cursor: pointer; text-align: left; transition: border-color 0.15s, background 0.15s; }
.ml-q-row:hover { border-color: var(--line-strong); background: rgba(65, 255, 161,0.06); }
.ml-q-row img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; display: block; }
.ml-q-info { min-width: 0; display: grid; gap: 1px; }
.ml-q-info b { font-size: 12px; font-weight: 600; }
.ml-q-info i { font-style: normal; font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-q-badge { flex: 0 0 auto; font: 600 8.5px "Spline Sans Mono", monospace; font-style: normal; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 7px; border-radius: 999px; }
.ml-q-badge.is-preview { color: var(--warn); background: rgba(199, 126, 0,0.1); }
.ml-q-badge.is-live { color: var(--neon); background: rgba(65, 255, 161,0.1); }
.ml-q-badge.is-saved { color: var(--neon-2); background: rgba(22, 217, 133,0.1); }

/* ---- result grids ---- */
.ml-wait-card {
  position: relative; z-index: 2; display: grid; grid-template-columns: minmax(110px, 190px) minmax(0, 440px); align-items: center; justify-content: center; gap: clamp(18px, 4vw, 44px); min-height: 420px; padding: clamp(22px, 4vw, 52px); text-align: left;
}
.ml-wait-phantom { width: min(190px, 30vw); filter: drop-shadow(0 0 26px rgba(65, 255, 161,0.35)); animation: phantomFloat 3.8s ease-in-out infinite; }
.ml-wait-copy { display: grid; gap: 10px; max-width: 460px; }
.ml-wait-copy span { font: 800 10px "Spline Sans Mono", monospace; letter-spacing: 0.14em; text-transform: uppercase; color: var(--neon); }
.ml-wait-copy b { font-size: clamp(22px, 3vw, 38px); line-height: 1; color: var(--ink); }
.ml-wait-copy i { font-style: normal; color: var(--dim); font-size: 15px; line-height: 1.55; }
.ml-pending-stack, .ml-recent-jobs { display: grid; gap: 18px; align-content: start; }
.ml-pending-list { display: grid; gap: 12px; align-content: start; }
.ml-pending-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(135deg, rgba(65, 255, 161,0.08), rgba(255, 255, 255,0.94)); }
.ml-pending-card.is-terminal { background: var(--glass-2); }
.ml-pending-phantom { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 0 18px rgba(65, 255, 161,0.3)); }
.ml-pending-copy { min-width: 0; display: grid; gap: 5px; }
.ml-pending-copy span { font: 800 10px "Spline Sans Mono", monospace; letter-spacing: 0.14em; text-transform: uppercase; color: var(--neon); }
.ml-pending-copy b { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-pending-copy i { color: var(--dim); font-style: normal; font-size: 12px; }
@keyframes phantomFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.ml-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ml-grid-lib {
  grid-template-columns: repeat(auto-fill, minmax(170px, 220px));
  justify-content: start;
  align-content: start;
  overflow: auto;
}

/* ---- Edit tab: Photo / Video editor chooser ---- */
.ml-edit-choose { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 380px)); gap: 16px; justify-content: center; align-content: center; min-height: 340px; padding: 24px; }
.ml-choose-card { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 34px 26px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(160deg, rgba(65, 255, 161,0.06), rgba(255, 255, 255,0.96)); color: var(--ink); cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.ml-choose-card:hover { border-color: var(--neon); transform: translateY(-2px); }
.ml-choose-card svg { width: 30px; height: 30px; color: var(--neon); }
.ml-choose-card b { font-size: 18px; letter-spacing: 0.02em; }
.ml-choose-card i { font-style: normal; font-size: 12.5px; line-height: 1.55; color: var(--dim); max-width: 300px; }
.ml-edit-mode-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ml-edit-mode-bar span { font: 600 10.5px "Spline Sans Mono", monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.ml-edit-mode-bar button, .ml-edit-back-inline { padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); font: 600 11px "Instrument Sans", sans-serif; cursor: pointer; }
.ml-edit-mode-bar button:hover, .ml-edit-back-inline:hover { border-color: var(--neon); }
.ml-edit-back-inline { padding: 2px 7px; margin-right: 4px; font-size: 10px; vertical-align: middle; }
.ml-videocut-host { display: block; min-height: 420px; }
@media (prefers-reduced-motion: reduce) { .ml-choose-card { transition: none; } .ml-choose-card:hover { transform: none; } }

/* ---- Media Pool tab: persistent, publish-ready media ---- */
.ml-pool-pending { display: grid; gap: 10px; margin-bottom: 16px; }
.ml-pool-pending-card { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg, rgba(65, 255, 161,0.09), rgba(255, 255, 255,0.94)); }
.ml-pool-pending-card b { font-size: 13px; color: var(--ink); }
.ml-pool-pending-card i { font: 500 10.5px "Spline Sans Mono", monospace; color: var(--dim); font-style: normal; letter-spacing: 0.04em; }
.ml-pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; align-content: start; }
.ml-pool-card { display: grid; grid-template-rows: auto auto auto; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--glass-2); }
.ml-pool-thumb { margin: 0; aspect-ratio: 4 / 3; background: var(--glass-2); display: grid; place-items: center; overflow: hidden; }
.ml-pool-thumb img, .ml-pool-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ml-pool-thumb-empty { font: 500 10.5px "Spline Sans Mono", monospace; color: var(--dim); letter-spacing: 0.06em; text-transform: uppercase; }
.ml-pool-meta { display: grid; gap: 3px; padding: 10px 12px 6px; }
.ml-pool-meta b { font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-pool-meta i { font: 500 10px "Spline Sans Mono", monospace; color: var(--dim); font-style: normal; letter-spacing: 0.04em; }
.ml-pool-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 12px; }
.ml-pool-act { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); font: 600 11px "Instrument Sans", sans-serif; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.ml-pool-act:hover { border-color: var(--neon); }
.ml-pool-act.is-primary { background: linear-gradient(135deg, rgba(65, 255, 161,0.22), rgba(255, 255, 255,0.9)); border-color: rgba(65, 255, 161,0.5); }
.ml-pool-act.is-danger:hover { border-color: var(--warn); color: var(--warn); }
.ml-pool-act svg { width: 13px; height: 13px; }
@media (max-width: 767px) {
  .ml-pool-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .ml-pool-actions { padding: 6px 10px 10px; }
}
.ml-stage-grid { position: relative; z-index: 2; align-content: start; }
.ml-stage-grid .ml-skel:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.ml-stage-grid .ml-tile:first-child { grid-column: 1 / -1; aspect-ratio: auto; }
.ml-stage-grid .ml-tile:first-child img { height: auto; max-height: 54vh; object-fit: contain; background: var(--glass-2); }
.ml-tile { position: relative; margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--glass-2); aspect-ratio: 1 / 1; }
.ml-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ml-grid-lib .ml-tile { width: 100%; max-width: 220px; aspect-ratio: 4 / 5; }
.ml-grid-lib .ml-tile img { object-fit: contain; background: var(--glass-2); }
.ml-badge { position: absolute; top: 9px; left: 9px; font: 600 8.5px "Spline Sans Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: var(--glass); color: var(--warn); }
.ml-badge-live { color: var(--neon); }
.ml-tile-x {
  position: absolute; top: 8px; right: 8px; z-index: 4; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(12, 24, 18, 0.16); background: var(--glass);
  color: var(--ink); cursor: pointer; font-size: 17px; line-height: 1;
  opacity: 0.86; transition: border-color 0.18s, color 0.18s, background 0.18s, transform 0.16s;
}
.ml-tile-x:hover { border-color: rgba(224, 52, 94, 0.65); color: #c22b52; background: rgba(224, 52, 94, 0.12); transform: scale(1.06); }
.ml-play { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; display: grid; place-items: center; color: var(--ink); pointer-events: none; }
.ml-play .ic { width: 26px; height: 26px; filter: drop-shadow(0 2px 8px rgba(12, 24, 18, 0.16)); }
.ml-tile-bar { position: absolute; inset: auto 0 0 0; display: flex; gap: 4px; padding: 8px; background: var(--glass); opacity: 0; transition: opacity 0.2s; }
.ml-tile:hover .ml-tile-bar { opacity: 1; }
/* touch devices: hover sticks after a tap and the overlay parks on top of the
   spec plate — give the actions their own solid strip below the image instead */
@media (hover: none) {
  .ml-tile-bar { position: static; opacity: 1; background: var(--glass); border-top: 1px solid var(--line); }
}
.ml-tile-bar button { flex: 1; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--glass); color: var(--dim); cursor: pointer; }
.ml-tile-bar button:hover { border-color: var(--neon); color: var(--neon); }
.ml-tile-bar .ic { width: 15px; height: 15px; }
.ml-skel { border-radius: 14px; overflow: hidden; aspect-ratio: 1/1; background: var(--glass-2); position: relative; }
.ml-skel-shim { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(65, 255, 161,0.1) 50%, transparent 80%); transform: translateX(-100%); animation: mlShim 1.3s ease-in-out infinite; }
@keyframes mlShim { to { transform: translateX(100%); } }
.ml-empty { display: grid; place-items: center; gap: 10px; min-height: 300px; text-align: center; color: var(--dim); border: 1px dashed var(--line); border-radius: 16px; padding: 30px; }
.ml-empty .ic { width: 34px; height: 34px; color: var(--dim-2); }
.ml-empty b { font-size: 16px; color: var(--ink); }
.ml-empty i { font-size: 13px; font-style: normal; max-width: 340px; }
.ml-edit-pick { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }

/* editor */
.ml-editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; min-height: 0; }
.ml-canvas-wrap { position: relative; min-width: 0; display: grid; place-items: center; min-height: 360px; max-height: 62vh; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: radial-gradient(circle at 50% 40%, rgba(65, 255, 161,0.05), transparent 60%), var(--glass); overflow: hidden; }
.ml-canvas {
  max-width: 100%; max-height: 58vh; border-radius: 8px;
  background-color: var(--glass-2);
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.08) 75%);
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-size: 18px 18px;
  box-shadow: 0 20px 50px rgba(12, 24, 18, 0.16);
}
.ml-layer-overlay {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 58vh;
  border-radius: 8px;
  pointer-events: none;
}
.ml-layer-overlay.is-active { pointer-events: auto; cursor: grab; }
.ml-layer-overlay.is-active:hover { cursor: grab; }
.ml-layer-overlay.is-dragging { cursor: grabbing; }
.ml-canvas.is-picking { cursor: crosshair; outline: 2px dashed rgba(65, 255, 161,0.65); outline-offset: 4px; }
.ml-canvas.is-painting { cursor: crosshair; }
.ml-edit-topbar {
  position: absolute; z-index: 4; top: 12px; left: 12px; display: flex; gap: 6px; padding: 5px;
  border: 1px solid rgba(65, 255, 161,.2); border-radius: 12px; background: var(--glass); backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(12, 24, 18, 0.112);
}
.ml-edit-topbar button {
  min-width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--dim); cursor: pointer; font: 700 10px "Instrument Sans", sans-serif;
}
.ml-edit-topbar button:hover, .ml-edit-topbar button.is-on { color: var(--neon); border-color: var(--line); background: rgba(65, 255, 161,.08); }
.ml-edit-topbar button:disabled { opacity: .28; cursor: default; }
.ml-edit-topbar .ic { width: 15px; height: 15px; }
.ml-tools { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.ml-tools > * { flex-shrink: 0; }
.ml-edit-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 4px; }
.ml-edit-title > div { display: grid; gap: 3px; }
.ml-edit-title span { color: var(--neon); font: 700 9px "Spline Sans Mono", monospace; letter-spacing: .15em; text-transform: uppercase; }
.ml-edit-title b { color: var(--ink); font-size: 18px; }
.ml-edit-title .ml-tutorial-btn { flex: 0 0 auto; width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 14px; }
.ml-quick-fixes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ml-quick-fixes button, .ml-smart-frame {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 11px;
  border: 1px solid rgba(65, 255, 161,.22); border-radius: 11px; background: rgba(65, 255, 161,.07); color: var(--ink);
  cursor: pointer; font: 700 11px "Instrument Sans", sans-serif;
}
.ml-quick-fixes button:first-child { background: linear-gradient(120deg, rgba(65, 255, 161,.2), rgba(22, 217, 133,.11)); color: var(--neon); }
.ml-quick-fixes button:hover, .ml-smart-frame:hover { border-color: rgba(65, 255, 161,.5); background: rgba(65, 255, 161,.14); }
.ml-quick-fixes button:disabled { opacity: .55; cursor: wait; }
.ml-quick-fixes .ic, .ml-smart-frame .ic { width: 14px; height: 14px; }
.ml-edit-section { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--glass); }
.ml-edit-section summary {
  min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px;
  cursor: pointer; list-style: none; color: var(--ink); font-size: 12px; font-weight: 700;
}
.ml-edit-section summary::-webkit-details-marker { display: none; }
.ml-edit-section summary::after { content: "+"; color: var(--dim); font-size: 16px; }
.ml-edit-section[open] summary::after { content: "–"; color: var(--neon); }
.ml-edit-section summary b { margin-left: auto; color: var(--dim); font: 700 9px "Spline Sans Mono", monospace; text-transform: uppercase; }
.ml-edit-section summary .ic { width: 13px; height: 13px; color: var(--neon); }
.ml-edit-section-body { display: grid; gap: 11px; padding: 0 12px 13px; border-top: 1px solid rgba(65, 255, 161,.07); }
.ml-edit-section-body > :first-child { margin-top: 12px; }
.ml-asset-manager-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 34px;
  gap: 7px;
  align-items: center;
}
.ml-asset-manager-tools input,
.ml-asset-manager-tools select {
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(12, 24, 18, 0.04);
  color: var(--ink);
  padding: 0 10px;
  font: 700 11px "DM Sans", sans-serif;
}
.ml-asset-manager-tools button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(65, 255, 161,.08);
  color: var(--neon);
  cursor: pointer;
}
.ml-asset-manager-tools button:hover { border-color: rgba(65, 255, 161,.5); background: rgba(65, 255, 161,.14); }
.ml-asset-manager-tools .ic { width: 14px; height: 14px; }
.ml-asset-cache-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}
.ml-asset-cache-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(12, 24, 18, 0.036);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.ml-asset-cache-card:focus-visible { outline: 2px solid rgba(65, 255, 161,.7); outline-offset: 2px; }
.ml-asset-cache-card:hover { border-color: rgba(65, 255, 161,.5); background: rgba(65, 255, 161,.08); }
.ml-asset-cache-card img {
  width: 52px;
  height: 52px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--glass-2);
}
.ml-asset-cache-card span { min-width: 0; display: grid; gap: 2px; }
.ml-asset-cache-card b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.ml-asset-cache-card i {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dim);
  font-style: normal;
  font-size: 9.5px;
}
.ml-layer-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 6px;
}
.ml-layer-actions button,
.ml-layer-row button {
  min-width: 0;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(65, 255, 161,.065);
  color: var(--ink);
  cursor: pointer;
  font: 700 10.5px "Instrument Sans", sans-serif;
}
.ml-layer-actions button:disabled,
.ml-layer-row button:disabled { opacity: .45; cursor: default; }
.ml-layer-actions .ic { width: 13px; height: 13px; }
.ml-layer-list { display: grid; gap: 7px; }
.ml-layer-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 11px;
  background: rgba(12, 24, 18, 0.036);
}
.ml-layer-row[draggable="true"] { cursor: grab; }
.ml-layer-row.is-dragging { opacity: .42; cursor: grabbing; }
.ml-layer-row.is-drop-target { border-color: #c77e00; background: rgba(199, 126, 0,.1); box-shadow: inset 3px 0 #c77e00; }
.ml-layer-row.is-selected { border-color: rgba(65, 255, 161,.56); background: rgba(65, 255, 161,.09); box-shadow: inset 3px 0 var(--neon); }
.ml-layer-row.is-off { opacity: .58; }
.ml-layer-row.is-locked {
  border-style: dashed;
  border-color: rgba(199, 126, 0,.32);
  background: rgba(199, 126, 0,.055);
}
.ml-layer-row.is-locked .ml-layer-name i { color: var(--warn); }
.ml-layer-name {
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 3px 2px !important;
  border: 0 !important;
  background: transparent !important;
  text-align: left;
}
.ml-layer-name b,
.ml-layer-name i {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ml-layer-name b { color: var(--ink); font-size: 12px; }
.ml-layer-name i { color: var(--dim); font-size: 10px; font-style: normal; }
.ml-layer-row-actions { display: flex; gap: 3px; }
.ml-layer-row-actions button { width: 27px; min-width: 27px; padding: 0; }
.ml-layer-inspector { padding-top: 11px; border-top: 1px solid var(--line); }
.ml-layer-inspector-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.ml-layer-inspector-head b { color: var(--ink); font-size: 12px; }
.ml-layer-inspector-head span { color: var(--neon); font: 700 9px "Spline Sans Mono", monospace; text-transform: uppercase; }
.ml-layer-transform-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 10px;
}
.ml-layer-transform-actions button,
.ml-layer-align-actions button {
  min-width: 0;
  min-height: 30px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(65, 255, 161,.06);
  color: var(--ink);
  cursor: pointer;
  font: 800 9.5px "Instrument Sans", sans-serif;
}
.ml-layer-transform-actions button:hover,
.ml-layer-align-actions button:hover { border-color: rgba(65, 255, 161,.46); background: rgba(65, 255, 161,.12); color: var(--ink); }
.ml-layer-transform-actions button:disabled,
.ml-layer-align-actions button:disabled { opacity: .34; cursor: default; }
.ml-layer-align-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 6px;
  margin: -2px 0 11px;
}
.ml-layer-field { display: grid; gap: 5px; margin-bottom: 9px; color: var(--dim); font-size: 10px; }
.ml-layer-field input,
.ml-layer-field select,
.ml-layer-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(12, 24, 18, 0.056);
  color: var(--ink);
  padding: 8px;
  outline: none;
  resize: vertical;
  font: 500 11px "Instrument Sans", sans-serif;
}
.ml-layer-field input[type="color"] { min-height: 36px; padding: 4px; }
.ml-layer-text-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ml-layer-toggle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ml-layer-toggle-row button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(65, 255, 161,.055);
  color: var(--dim);
  cursor: pointer;
  font: 800 11px "Instrument Sans", sans-serif;
}
.ml-layer-toggle-row button.is-on {
  color: #ffffff;
  border-color: rgba(65, 255, 161,.7);
  background: var(--neon);
}
.ml-paint-controls { display: grid; gap: 9px; }
.ml-paint-controls .ml-field { margin: 0; }
.ml-paint-controls input[type="color"] {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(12, 24, 18, 0.048);
  padding: 3px;
}
.ml-paint-mode { width: 100%; }
.ml-paint-mode button { flex: 1 1 0; }
.ml-crop-presets { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 6px; }
.ml-crop-presets button {
  min-width: 0; min-height: 66px; display: grid; place-items: center; align-content: center; gap: 6px; padding: 7px 3px;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(12, 24, 18, 0.04); color: var(--dim); cursor: pointer; font-size: 9px;
}
.ml-crop-presets button:hover, .ml-crop-presets button.is-on { border-color: rgba(65, 255, 161,.55); color: var(--neon); background: rgba(65, 255, 161,.1); }
.ml-crop-shape { display: block; border: 1px solid currentColor; border-radius: 2px; width: 22px; height: 16px; }
.ml-crop-shape.is-square { width: 18px; height: 18px; }
.ml-crop-shape.is-portrait { width: 15px; height: 19px; }
.ml-crop-shape.is-story { width: 11px; height: 20px; }
.ml-crop-shape.is-wide { width: 24px; height: 14px; }
.ml-smart-frame { width: 100%; background: rgba(12, 24, 18, 0.032); color: var(--dim); }
.ml-tool-head { font: 600 9.5px "Spline Sans Mono", monospace; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin-top: 6px; }
.ml-tutorial-btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(12, 24, 18, 0.044); color: var(--dim);
  padding: 8px 10px; font: 700 11px "Instrument Sans";
}
.ml-tutorial-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.ml-tutorial-btn .ic { width: 13px; height: 13px; }
.ml-slider { display: flex; flex-direction: column; gap: 5px; }
.ml-slider span { font-size: 12px; color: var(--dim); display: flex; justify-content: space-between; }
.ml-slider b { color: var(--neon); font: 500 11px "Spline Sans Mono", monospace; }
.ml-slider input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 999px; background: rgba(65, 255, 161,0.18); outline: none; }
.ml-slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--neon); cursor: pointer; box-shadow: 0 0 8px rgba(65, 255, 161,0.5); }
.ml-slider input[type=range]::-moz-range-thumb { width: 15px; height: 15px; border: 0; border-radius: 50%; background: var(--neon); cursor: pointer; }
.ml-editor-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* Media Lab Create is a full-screen workbench on desktop: the page itself
   stays locked to the viewport, while dense controls and result grids own
   their internal overflow. This keeps 100% browser zoom feeling like an app
   canvas instead of a half-height panel with dead space below it. */
@media (min-width: 901px) {
  .app-main:has(.workspace-page[data-workspace-page="media"]) {
    height: 100dvh;
    overflow: hidden;
  }

  .app-main:has(.workspace-page[data-workspace-page="media"]) .console-workspace {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: clamp(8px, 1vw, 14px);
  }

  .workspace-page[data-workspace-page="media"] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .workspace-page[data-workspace-page="media"] .workspace-page-body {
    height: auto;
    min-height: 0;
    overflow: auto;
    padding: 0;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    scrollbar-width: thin;
    overscroll-behavior: contain;
  }

  .workspace-page[data-workspace-page="media"] .ml {
    height: 100%;
    min-height: 0;
    gap: 8px;
  }

  .workspace-page[data-workspace-page="media"] .ml-topbar {
    flex: 0 0 auto;
    min-height: 36px;
  }

  .workspace-page[data-workspace-page="media"] .ml-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
    padding-right: 4px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    scrollbar-width: thin;
  }

  .workspace-page[data-workspace-page="media"] .ml-body:has(.ml-grid-lib) {
    overflow: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(65, 255, 161,0.38) rgba(0,0,0,0.2);
  }

  .workspace-page[data-workspace-page="media"] .ml-body:has(.ml-editor) {
    min-height: 0;
    height: 100%;
    max-height: 100%;
  }

  .workspace-page[data-workspace-page="media"] .ml-editor {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    grid-template-columns: minmax(360px, 1fr) clamp(320px, 22vw, 380px);
    gap: clamp(10px, 1vw, 16px);
    align-items: stretch;
  }

  .workspace-page[data-workspace-page="media"] .ml-editor > * {
    min-height: 0;
  }

  .workspace-page[data-workspace-page="media"] .ml-canvas-wrap {
    align-self: stretch;
    min-height: 0;
    height: 100%;
    max-height: none;
    padding: clamp(10px, 1vw, 16px);
  }

  .workspace-page[data-workspace-page="media"] .ml-canvas {
    max-width: 100%;
    max-height: min(100%, calc(100dvh - 260px));
    object-fit: contain;
  }

  .workspace-page[data-workspace-page="media"] .ml-tools {
    align-self: stretch;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(65, 255, 161,0.38) rgba(0,0,0,0.2);
  }

  .workspace-page[data-workspace-page="media"] .ml-tools::-webkit-scrollbar { width: 8px; }
  .workspace-page[data-workspace-page="media"] .ml-tools::-webkit-scrollbar-track { background: rgba(12, 24, 18, 0.036); border-radius: 999px; }
  .workspace-page[data-workspace-page="media"] .ml-tools::-webkit-scrollbar-thumb { background: rgba(65, 255, 161,0.38); border-radius: 999px; }

  .workspace-page[data-workspace-page="media"] .ml-tools .ml-edit-title {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: 0 0 2px;
    padding: 0 0 8px;
    background: var(--glass);
  }

  .workspace-page[data-workspace-page="media"] .ml-editor-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin: 2px -6px 0;
    padding: 10px 6px 0;
    background: var(--glass);
  }

  .workspace-page[data-workspace-page="media"] .ml-workspace {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    grid-template-columns: minmax(260px, clamp(280px, 18vw, 340px)) minmax(0, 1fr);
    gap: clamp(8px, 0.8vw, 12px);
  }

  .workspace-page[data-workspace-page="media"] .ml-brief {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px clamp(12px, 1vw, 16px);
    gap: 6px;
    scrollbar-width: thin;
  }

  .workspace-page[data-workspace-page="media"] .ml-card-head {
    padding-bottom: 8px;
  }

  .workspace-page[data-workspace-page="media"] .ml-drop {
    padding: 8px 10px;
  }

  .workspace-page[data-workspace-page="media"] .ml-field-brief .ml-prompt {
    min-height: clamp(58px, 9dvh, 92px);
    max-height: 17dvh;
  }

  .workspace-page[data-workspace-page="media"] .ml-generate.ml-hero {
    padding: 10px 14px 9px;
  }

  .workspace-page[data-workspace-page="media"] .ml-stage,
  .workspace-page[data-workspace-page="media"] .ml-stage-frame {
    min-height: 0;
    height: 100%;
  }

  .workspace-page[data-workspace-page="media"] .ml-stage-frame {
    border-radius: 18px;
  }

  .workspace-page[data-workspace-page="media"] .ml-stage-top {
    flex: 0 0 auto;
    padding: 8px 13px;
  }

  .workspace-page[data-workspace-page="media"] .ml-stage-view {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    align-content: stretch;
    place-items: stretch;
    overflow: hidden;
    padding: clamp(12px, 1.35vw, 18px);
  }

  .workspace-page[data-workspace-page="media"] .ml-idle {
    min-height: 0;
    height: 100%;
    align-content: center;
  }

  .workspace-page[data-workspace-page="media"] .ml-stage-grid {
    width: 100%;
    height: 100%;
    overflow: auto;
    scrollbar-width: thin;
    align-content: start;
  }

  .workspace-page[data-workspace-page="media"] .ml-stage-grid .ml-tile:first-child img {
    max-height: min(72dvh, 100%);
  }

  .workspace-page[data-workspace-page="media"] .ml-stage-meta {
    flex: 0 0 auto;
    padding: 8px 13px;
  }

  .workspace-page[data-workspace-page="media"] .ml-next {
    flex: 0 0 auto;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .workspace-page[data-workspace-page="media"] .ml-next-head {
    margin-bottom: 6px;
  }

  .workspace-page[data-workspace-page="media"] .ml-next-card {
    padding: 9px 10px;
    gap: 4px;
  }

  .workspace-page[data-workspace-page="media"] .ml-joblog {
    flex: 0 0 auto;
    margin-top: 0;
    padding: 6px 10px;
  }

  /* Media Lab must always be scrollable from the page itself. The previous
     fixed workbench layout depended on several nested overflow containers; a
     wheel/touch event over the stage could land on a non-scrollable ancestor
     and feel completely stuck. Keep dense editor/tool panes scrollable, but
     let the workspace document own vertical movement. */
  .app-main:has(.workspace-page[data-workspace-page="media"]) {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-main:has(.workspace-page[data-workspace-page="media"]) .console-workspace,
  .workspace-page[data-workspace-page="media"],
  .workspace-page[data-workspace-page="media"] .workspace-page-body,
  .workspace-page[data-workspace-page="media"] .media-suite,
  .workspace-page[data-workspace-page="media"] .media-suite-body,
  .workspace-page[data-workspace-page="media"] .ml,
  .workspace-page[data-workspace-page="media"] .ml-body {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: visible;
    overscroll-behavior-y: auto;
  }

  .app-main:has(.workspace-page[data-workspace-page="media"]) .console-workspace,
  .workspace-page[data-workspace-page="media"] .workspace-page-body,
  .workspace-page[data-workspace-page="media"] .media-suite-body,
  .workspace-page[data-workspace-page="media"] .ml-body {
    padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px));
  }

  .workspace-page[data-workspace-page="media"] .ml-workspace {
    height: auto;
    min-height: min(820px, calc(100dvh - 140px));
    align-items: stretch;
  }

  .workspace-page[data-workspace-page="media"] .ml-stage,
  .workspace-page[data-workspace-page="media"] .ml-stage-frame,
  .workspace-page[data-workspace-page="media"] .ml-stage-view {
    height: auto;
    min-height: clamp(520px, calc(100dvh - 170px), 900px);
  }

  .workspace-page[data-workspace-page="media"] .ml-idle {
    height: auto;
    min-height: clamp(420px, calc(100dvh - 230px), 760px);
  }

  .workspace-page[data-workspace-page="media"] .ml-brief,
  .workspace-page[data-workspace-page="media"] .ml-stage-grid,
  .workspace-page[data-workspace-page="media"] .ml-tools {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}


/* =====================  CONTENT HUB + ANALYTICS  ============= */
/* ============================================================= */
.ch, .an { display: flex; flex-direction: column; gap: 16px; }
.ch-tabs { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 12px; flex-wrap: wrap; }
.ch-workbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; }
.ch-workbar > div { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ch-workbar h3 { margin: 0; font-size: 17px; }
.ch-workbar span { color: var(--dim); font: 600 10px "Spline Sans Mono", monospace; letter-spacing: 0; text-transform: uppercase; }
.ch-tab { padding: 8px 14px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--dim); cursor: pointer; font: 600 13px "Instrument Sans"; transition: background .18s, color .18s; }
.ch-tab:hover { color: var(--ink); background: rgba(65, 255, 161,.05); }
.ch-tab.is-active { color: #ffffff; background: linear-gradient(120deg, var(--neon), #41ffa1); }
.ch-subtabs {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-top: -10px; padding: 0 0 8px 2px; border-bottom: 1px solid rgba(130, 155, 143,.08);
}
.ch-subtab {
  min-height: 32px; padding: 7px 12px; border: 1px solid rgba(130, 155, 143,.12); border-radius: 999px;
  background: var(--glass); color: #a49fb7; cursor: pointer;
  font: 700 11.5px "Instrument Sans"; transition: border-color .16s, color .16s, background .16s;
}
.ch-subtab:hover { color: var(--ink); border-color: rgba(65, 255, 161,.28); background: rgba(65, 255, 161,.07); }
.ch-subtab.is-active { color: var(--neon); border-color: var(--neon); background: rgba(65, 255, 161,.1); }
.ch-src { margin-left: auto; font: 500 11px "Spline Sans Mono", monospace; color: var(--dim); }
.ch-body, .an { min-width: 0; }
.ch-creator-head, .an-hero {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 18px;
  border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 14px; background: var(--glass);
}
.ch-creator-head h3, .an-hero h3 { margin: 0; font-size: 22px; }
.ch-tenant-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.ch-tenant-pill {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; border: 1px solid rgba(65, 255, 161,.22); border-radius: 999px;
  background: rgba(65, 255, 161,.08); color: var(--ink); font: 700 10px "Spline Sans Mono", monospace; letter-spacing: .08em; text-transform: uppercase;
}
.ch-creator-head p, .an-hero p { margin: 6px 0 0; max-width: 720px; color: var(--dim); font-size: 13px; line-height: 1.55; }
.ch-eyebrow { margin: 0 !important; font: 700 9px "Spline Sans Mono", monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--neon) !important; }

.ch-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.ch-kpi { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--glass); }
.ch-kpi-k { font: 600 9px "Spline Sans Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.ch-kpi-v { font: 600 24px "Instrument Sans"; color: var(--ink); line-height: 1.05; }
.ch-kpi-s { font-size: 11px; color: var(--dim); }
.ch-kpi.good .ch-kpi-v { color: var(--neon); }

.ch-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
.ch-card { border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; background: var(--glass); }
.ch-card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ch-card-h h3 { margin: 0; font-size: 14px; }

/* Managed Growth stays visually distinct from social analytics: it reports
   tenant-scoped operational records, never modeled reach or engagement. */
.analytics-stack,
.mg-report { display: grid; gap: 14px; min-width: 0; }
.mg-report .ch-card { border-radius: 8px; }
.mg-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.mg-hero h3,
.mg-sources h3 { margin: 3px 0 7px; letter-spacing: 0; }
.mg-hero p:not(.ch-eyebrow),
.mg-row p,
.mg-module p,
.mg-metric p,
.mg-sources small { margin: 0; color: var(--dim); line-height: 1.45; }
.mg-setup,
.mg-metrics,
.mg-grid,
.mg-module-grid { display: grid; gap: 10px; min-width: 0; }
.mg-setup { grid-template-columns: repeat(3, minmax(90px, 1fr)); min-width: min(100%, 390px); }
.mg-setup span,
.mg-sources span {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--dim);
  font-size: 11px;
}
.mg-setup b { color: var(--neon); font-size: 18px; }
.mg-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mg-metric { min-width: 0; }
.mg-metric > span,
.mg-metric small,
.mg-row > span,
.mg-module > div > span {
  color: var(--neon);
  font: 700 10px "Spline Sans Mono", monospace;
  text-transform: uppercase;
}
.mg-metric > b { display: block; margin: 6px 0; font-size: 24px; overflow-wrap: anywhere; }
.mg-module-grid { grid-template-columns: repeat(5, minmax(160px, 1fr)); }
.mg-module {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--glass) 86%, transparent);
  display: grid;
  align-content: start;
  gap: 9px;
}
.mg-module.is-needs_action { border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.mg-module.is-live { border-color: color-mix(in srgb, var(--neon) 42%, transparent); }
.mg-module > div:first-child { display: grid; gap: 3px; }
.mg-module b,
.mg-row b { overflow-wrap: anywhere; }
.mg-module small { color: var(--warn); line-height: 1.35; }
.mg-module dl { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.mg-module dl div { min-width: 0; padding-top: 7px; border-top: 1px solid var(--line); }
.mg-module dt { color: var(--dim); font-size: 9px; }
.mg-module dd { margin: 2px 0 0; overflow-wrap: anywhere; font-size: 11px; }
.mg-module .btn { width: 100%; min-height: 34px; white-space: normal; }
.mg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mg-list { display: grid; gap: 8px; }
.mg-row {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.mg-row:first-child { border-top: 0; }
.mg-row.is-critical > span { color: var(--risk); }
.mg-row.is-warning > span { color: var(--warn); }
.mg-row .btn { justify-self: start; }
.mg-sources { display: grid; grid-template-columns: minmax(160px, 0.6fr) minmax(0, 1.4fr); gap: 14px; }
.mg-sources > div:nth-child(2) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.mg-sources i { color: var(--dim); font-style: normal; font-size: 9px; overflow-wrap: anywhere; }
.mg-sources small { grid-column: 1 / -1; }
.mg-safe { color: var(--neon); font: 700 10px "Spline Sans Mono", monospace; }

@media (max-width: 1280px) {
  .mg-module-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .mg-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .mg-hero { display: grid; }
  .mg-setup { min-width: 0; width: 100%; }
  .mg-module-grid,
  .mg-grid,
  .mg-sources,
  .mg-sources > div:nth-child(2) { grid-template-columns: 1fr; }
}
.ch-bars { display: flex; flex-direction: column; gap: 10px; }
.ch-bar-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 10px; }
.ch-bar-lab { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dim); }
.ch-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.ch-bar-track { height: 8px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.ch-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--neon); transition: width .5s cubic-bezier(.22,1,.36,1); }
.ch-bar-val { font: 500 12px "Spline Sans Mono", monospace; color: var(--neon); }
.ch-mix { display: flex; flex-direction: column; gap: 8px; }
.ch-mix-row { display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 10px; font-size: 12.5px; color: var(--dim); }
.ch-mix-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.ch-mix-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--neon), #16d985); }
.ch-mix-row b { font: 500 12px "Spline Sans Mono", monospace; color: var(--ink); }

.ch-creator-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .72fr); gap: 14px; align-items: start; }
.ch-idea-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ch-idea-card, .ch-draft, .ch-production-step, .an-trend, .an-reco-grid article {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--glass);
}
.ch-idea-card { display: flex; flex-direction: column; gap: 11px; }
.ch-removable { position: relative; }
.ch-remove {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 24px; height: 24px; display: grid; place-items: center;
  border: 1px solid rgba(12, 24, 18,.18); border-radius: 50%;
  background: var(--glass); color: #c22b52; cursor: pointer;
  font: 700 13px "Spline Sans Mono", monospace; line-height: 1;
}
.ch-remove:hover { border-color: rgba(224, 52, 94,.62); background: rgba(224, 52, 94,.14); color: #ffc7ce; }
.ch-idea-card .ch-remove, .ch-draft .ch-remove, .ch-calendar-item .ch-remove { opacity: .9; }
.ch-calendar-item.ch-removable { padding-right: 44px; }
.ch-idea-top { display: flex; flex-direction: column; gap: 5px; }
.ch-idea-top span, .ch-draft-meta span, .ch-calendar-item em, .an-trend span {
  align-self: flex-start; font: 700 8.5px "Spline Sans Mono", monospace; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 999px; color: var(--neon); background: rgba(65, 255, 161,.1);
}
.ch-idea-top b, .ch-draft h4, .ch-production-step h4, .an-trend b, .an-reco-grid b { color: var(--ink); font-size: 14px; }
.ch-idea-card p, .ch-draft p, .ch-production-step p, .an-trend p, .an-reco-grid p, .ch-creator-side p { margin: 0; color: var(--dim); font-size: 12.5px; line-height: 1.5; }
.ch-idea-platforms, .ch-draft-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-idea-platforms span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--dim); }
.ch-idea-next { margin-top: auto; color: var(--dim); font-size: 12px; line-height: 1.45; }
.ch-idea-next b { color: var(--neon); }
.ch-idea-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-idea-actions .btn { flex: 1 1 118px; min-height: 38px; }
.ch-profile-hint { padding: 11px 12px; border: 1px solid rgba(65, 255, 161,.2); border-radius: 13px; background: rgba(65, 255, 161,.055); }
.ch-idea-form { display: grid; gap: 9px; }
.ch-idea-form label { display: grid; gap: 6px; color: var(--muted); font: 700 9px "Spline Sans Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.ch-idea-form input, .ch-idea-form textarea {
  width: 100%; border: 1px solid rgba(65, 255, 161,.16); border-radius: 12px;
  background: var(--glass); color: var(--ink); padding: 10px 11px; font: 500 13px "Inter", sans-serif;
}
.ch-idea-form textarea { min-height: 76px; resize: vertical; }
.ch-saved-ideas { display: grid; gap: 7px; padding-top: 2px; }
.ch-saved-ideas b { color: var(--ink); font-size: 12px; }
.ch-saved-ideas span {
  display: block; padding: 8px 10px; border: 1px solid rgba(65, 255, 161,.12);
  border-radius: 10px; background: rgba(12, 24, 18, 0.036); color: var(--dim); font-size: 12px;
}
.ch-creator-side { display: flex; flex-direction: column; gap: 12px; }
.ch-creator-side h3 { margin: 0; font-size: 16px; }
.ch-brief-list { display: grid; gap: 8px; }
.ch-brief-list span { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 10px; background: rgba(12, 24, 18, 0.04); color: var(--dim); font-size: 12px; }
.ch-brief-list b { color: var(--dim); font-weight: 500; }
.ch-draft-list { display: flex; flex-direction: column; gap: 10px; }
.ch-draft { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.ch-draft-step, .ch-production-step span {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px;
  background: rgba(65, 255, 161,.12); color: var(--neon); font: 700 11px "Spline Sans Mono", monospace;
}
.ch-calendar-list { display: flex; flex-direction: column; gap: 9px; }
.ch-calendar-item {
  display: grid; grid-template-columns: 92px auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px; background: var(--glass);
  color: var(--ink); text-align: left; cursor: pointer;
}
.ch-calendar-item:hover { border-color: var(--line-strong); background: rgba(65, 255, 161,.05); }
.ch-calendar-date { color: var(--warn); font: 600 10px "Spline Sans Mono", monospace; text-transform: uppercase; }
.ch-calendar-item b { display: block; font-size: 13px; }
.ch-calendar-item i { display: block; margin-top: 2px; color: var(--dim); font-style: normal; font-size: 11.5px; }
.ch-production { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ch-production-step { display: flex; flex-direction: column; gap: 9px; min-height: 142px; }
.ch-post-creator span { color: var(--dim); }

.ch-publish-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr); gap: 14px; align-items: start; }
.ch-pub-composer, .ch-pub-preview, .ch-pub-queue { min-width: 0; }
.ch-pub-safe {
  flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; border: 1px solid rgba(65, 255, 161,.25);
  background: rgba(65, 255, 161,.08); color: var(--neon); font: 700 9px "Spline Sans Mono", monospace; letter-spacing: .08em; text-transform: uppercase;
}
.ch-pub-section { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.ch-pub-section:first-of-type { margin-top: 0; }
.ch-pub-label, .ch-pub-row label span, .ch-pub-caption span, .ch-pub-schedule span {
  color: var(--dim); font: 700 9px "Spline Sans Mono", monospace; letter-spacing: .13em; text-transform: uppercase;
}
.ch-pub-presets, .ch-pub-tone-row, .ch-pub-format-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ch-pub-platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 8px; }
.ch-pub-platform {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px;
  min-height: 58px; border: 1px solid var(--line); border-radius: 14px; padding: 10px;
  background: var(--glass); color: var(--ink); text-align: left; cursor: pointer;
}
.ch-pub-platform:hover, .ch-pub-platform.is-on { border-color: color-mix(in srgb, var(--pc) 65%, var(--neon)); background: var(--glass); }
.ch-pub-platform .ch-post-plat { position: static; width: 30px; height: 30px; border-radius: 10px; }
.ch-pub-platform b, .ch-pub-source b { display: block; color: var(--ink); font-size: 12.5px; line-height: 1.15; }
.ch-pub-platform i, .ch-pub-source i { display: block; margin-top: 2px; color: var(--dim); font-style: normal; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-pub-source-section { gap: 10px; }
.ch-pub-source-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ch-pub-drop {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 94px;
  padding: 14px;
  border: 1px dashed rgba(65, 255, 161,.28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(65, 255, 161,.06), rgba(255, 255, 255,.62));
  color: var(--dim);
  text-align: center;
  cursor: pointer;
}
.ch-pub-drop:hover, .ch-pub-drop.is-over { border-color: var(--neon); background: rgba(65, 255, 161,.1); color: var(--dim); box-shadow: 0 0 24px rgba(65, 255, 161,.1); }
.ch-pub-drop b { color: var(--ink); font-size: 13px; }
.ch-pub-drop span { max-width: 520px; font-size: 11.5px; line-height: 1.45; }
.ch-pub-source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; max-height: 260px; overflow: auto; padding-right: 2px; }
.ch-pub-thumb-section { gap: 8px; }
.ch-pub-thumb-grid { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); max-height: 172px; }
.ch-pub-source {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: var(--glass);
  color: var(--ink); text-align: left; cursor: pointer; min-width: 0;
}
.ch-pub-source:hover, .ch-pub-source.is-on { border-color: var(--neon); box-shadow: 0 0 0 1px rgba(65, 255, 161,.18); }
.ch-pub-source-thumb { display: block; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; background: rgba(12, 24, 18, 0.056); }
.ch-pub-source-thumb.is-auto { display: grid; place-items: center; color: var(--neon); border: 1px solid rgba(65, 255, 161,.18); background: linear-gradient(135deg, rgba(65, 255, 161,.08), rgba(255,255,255,.58)); }
.ch-pub-source-thumb.is-auto .ic { width: 20px; height: 20px; }
.ch-pub-source-thumb img, .ch-pub-source-thumb video, .ch-pub-preview-media img, .ch-pub-preview-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-pub-media-empty { position: relative; display: grid; place-items: center; width: 100%; height: 100%; color: var(--dim-2); font: 700 9px "Spline Sans Mono", monospace; letter-spacing: .1em; text-transform: uppercase; overflow: hidden; }
.ch-pub-ai-box {
  border: 1px solid rgba(65, 255, 161,.14); border-radius: 16px; padding: 12px;
  background: linear-gradient(135deg, rgba(65, 255, 161,.06), rgba(255, 255, 255,.58));
}
.ch-pub-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .45fr); gap: 10px; }
.ch-pub-row label, .ch-pub-caption, .ch-pub-schedule { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ch-pub-brief-field > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ch-pub-brief-field > span button {
  min-height: 26px;
  padding: 5px 8px;
  border: 1px solid rgba(65, 255, 161,.28);
  border-radius: 999px;
  background: rgba(65, 255, 161,.08);
  color: var(--neon);
  cursor: pointer;
  font: 800 9px "Spline Sans Mono", monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.ch-pub-brief-field > span button:hover { border-color: var(--neon); background: rgba(65, 255, 161,.14); }
.ch-pub-ai-box textarea, .ch-pub-ai-box input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--glass);
  color: var(--ink); padding: 10px 11px; font: 500 12.5px "Instrument Sans"; outline: none;
}
.ch-pub-ai-box textarea:focus, .ch-pub-ai-box input:focus { border-color: var(--neon); box-shadow: 0 0 0 2px rgba(65, 255, 161,.12); }
.ch-pub-schedule { min-width: 190px; margin-left: auto; }
.ch-pub-actions { justify-content: flex-start; }
.ch-pub-note { margin: 0; color: var(--dim); font-size: 11.5px; line-height: 1.45; }
.ch-pub-preview { position: sticky; top: 14px; }
.ch-pub-preview-stack { display: block; }
.ch-pub-preview-card {
  border: 1px solid color-mix(in srgb, var(--pc) 30%, var(--line)); border-radius: 18px; overflow: hidden;
  background: var(--glass); box-shadow: 0 18px 50px rgba(0,0,0,.24);
}
.ch-pub-preview-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; }
.ch-pub-preview-top .ch-post-plat { position: static; width: 32px; height: 32px; border-radius: 10px; }
.ch-pub-preview-destinations { display: flex; align-items: center; padding-left: 6px; }
.ch-pub-preview-destinations .ch-post-plat { display: grid; place-items: center; margin-left: -6px; border: 2px solid #ffffff; font-style: normal; box-shadow: 0 4px 12px rgba(0,0,0,.28); }
.ch-pub-preview-top b { display: block; color: var(--ink); font-size: 12.5px; }
.ch-pub-preview-top i { display: block; color: var(--dim); font-style: normal; font-size: 11px; }
.ch-pub-preview-top em {
  color: color-mix(in srgb, var(--pc) 70%, var(--neon)); font: 700 8.5px "Spline Sans Mono", monospace; letter-spacing: .08em; text-transform: uppercase; font-style: normal;
}
.ch-pub-preview-media { position: relative; aspect-ratio: 4/3; background: var(--glass-2); overflow: hidden; }
.ch-pub-preview-media .ch-post-plat { position: absolute; top: 10px; left: 10px; }
.ch-pub-preview-actions { display: flex; gap: 13px; padding: 10px 12px 2px; color: var(--dim); }
.ch-pub-preview-actions .ic { width: 15px; height: 15px; }
.ch-pub-preview-caption { margin: 0; padding: 8px 12px 12px; color: var(--dim); font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; }
.ch-pub-preview-caption b { color: var(--ink); }
.ch-pub-preview-foot { padding: 0 12px 12px; color: var(--dim); font: 700 9px "Spline Sans Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.ch-pub-queue { margin-top: 14px; }
.ch-pub-queue-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.ch-pub-queue-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--glass); }
.ch-pub-queue-item b { display: block; margin-top: 8px; color: var(--ink); font-size: 13px; }
.ch-pub-queue-item p { margin: 6px 0; color: var(--dim); font-size: 12px; line-height: 1.45; }
.ch-pub-queue-item i { color: var(--dim); font-style: normal; font-size: 11px; }
.ch-pub-status { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: rgba(65, 255, 161,.1); color: var(--neon); font: 700 8.5px "Spline Sans Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.ch-pub-status-approval { color: var(--warn); background: rgba(199, 126, 0,.12); }
.ch-pub-status-manual-posted { color: #16d985; background: rgba(22, 217, 133,.12); }

/* Content Hub planner: one weekly operating surface for content and business time. */
.ch-planner-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 14px; }
.ch-planner-hero h3 { margin: 0; font-size: clamp(20px, 2.6vw, 32px); }
.ch-planner-hero > div > span { display: block; margin-top: 6px; color: var(--dim); font-size: 13px; }
.ch-planner-kicker { margin: 0 0 6px; color: var(--neon); font: 700 9px "Spline Sans Mono", monospace; letter-spacing: .17em; }
.ch-planner-metrics { display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)); gap: 8px; }
.ch-planner-metrics span { min-width: 105px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(12, 24, 18, 0.04); }
.ch-planner-metrics b, .ch-planner-metrics i { display: block; }
.ch-planner-metrics b { color: var(--ink); font-size: 20px; }
.ch-planner-metrics i { margin-top: 2px; color: var(--dim); font: 500 9px "Spline Sans Mono", monospace; font-style: normal; }
.ch-planner-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, .55fr); gap: 14px; align-items: start; }
.ch-planner-calendar, .ch-planner-add { min-width: 0; }
.ch-planner-head { gap: 12px; }
.ch-planner-nav { display: flex; gap: 6px; }
.ch-planner-nav button { min-width: 34px; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); color: var(--ink); cursor: pointer; }
.ch-planner-nav button:hover { border-color: var(--neon); color: var(--neon); }
.ch-planner-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.ch-planner-day { min-width: 0; min-height: 230px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255,.34); overflow: hidden; }
.ch-planner-day.is-today { border-color: rgba(65, 255, 161,.52); box-shadow: inset 0 0 0 1px rgba(65, 255, 161,.09); }
.ch-planner-day > header { display: flex; align-items: center; justify-content: space-between; padding: 9px; border-bottom: 1px solid var(--line); }
.ch-planner-day > header b { color: var(--dim); font: 700 9px "Spline Sans Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.ch-planner-day > header span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: var(--ink); font-size: 11px; }
.ch-planner-day.is-today > header span { background: var(--neon); color: #ffffff; font-weight: 800; }
.ch-planner-day > div { display: grid; gap: 6px; padding: 7px; }
.ch-planner-open { padding: 9px 3px; color: var(--dim-2); font: 600 9px "Spline Sans Mono", monospace; text-align: center; }
.ch-planner-event { position: relative; display: grid; gap: 3px; min-width: 0; padding: 8px; border-left: 3px solid #16d985; border-radius: 8px; background: rgba(22, 217, 133,.09); cursor: default; }
.ch-planner-event[role="button"] { cursor: pointer; }
.ch-planner-event.is-content { border-left-color: #ff7aa8; background: rgba(255,76,139,.09); }
.ch-planner-event.is-follow_up { border-left-color: #c77e00; background: rgba(199, 126, 0,.09); }
.ch-planner-event.is-deadline { border-left-color: #ff6578; background: rgba(255,101,120,.09); }
.ch-planner-event time { color: var(--dim); font: 700 8px "Spline Sans Mono", monospace; }
.ch-planner-event b { color: var(--ink); font-size: 10px; line-height: 1.25; overflow-wrap: anywhere; }
.ch-planner-event i { color: var(--dim); font-size: 9px; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-planner-event > button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: 0; background: transparent; color: #c22b52; cursor: pointer; }
.ch-planner-add form { display: grid; gap: 10px; }
.ch-planner-add label { display: grid; gap: 6px; color: var(--dim); font: 700 9px "Spline Sans Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.ch-planner-add input, .ch-planner-add select, .ch-planner-add textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--glass); color: var(--ink); font: 500 12px "Instrument Sans"; text-transform: none; letter-spacing: 0; }
.ch-planner-add textarea { resize: vertical; }
.ch-planner-connectors { margin-top: 14px; }
.ch-planner-connector-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ch-planner-connector-groups > section > h4 { margin: 0 0 8px; color: var(--ink); font-size: 13px; }
.ch-planner-connector-groups > section > div { display: grid; gap: 7px; }
.ch-planner-connector { border: 1px solid var(--line); border-radius: 12px; background: rgba(12, 24, 18, 0.034); overflow: hidden; }
.ch-planner-connector-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; width: 100%; padding: 11px 12px; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.ch-planner-connector-head b, .ch-planner-connector-head i { display: block; }
.ch-planner-connector-head b { font-size: 12.5px; }
.ch-planner-connector-head i { margin-top: 2px; color: var(--dim); font-size: 10.5px; font-style: normal; }
.ch-planner-connector-head em { align-self: center; color: var(--warn); font: 700 8px "Spline Sans Mono", monospace; font-style: normal; letter-spacing: .06em; text-transform: uppercase; }
.ch-planner-connector-body { padding: 0 12px 12px; }
.ch-planner-connector-body p { margin: 0 0 9px; color: var(--dim); font-size: 11.5px; line-height: 1.45; }
.ch-planner-connector-body p b { color: var(--ink); }

.ch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.ch-grid-lg { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ch-created-media { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.ch-library-head { gap: 14px; align-items: flex-start; }
.ch-library-head .ch-src { display: block; margin: 3px 0 0; }
.ch-storage { min-width: 150px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; color: var(--dim); font: 600 10px "Spline Sans Mono", monospace; }
.ch-storage i { width: 150px; height: 7px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.07); }
.ch-storage b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--neon), #16d985); box-shadow: 0 0 14px rgba(65, 255, 161,.35); }
.ch-library-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 4px;
}
.ch-library-actions.is-open {
  display: grid;
  grid-template-columns: minmax(190px, .7fr) minmax(0, 1.3fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(65, 255, 161,.14);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(65, 255, 161,.07), rgba(255, 255, 255,.72));
}
.ch-select-summary { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ch-select-summary b { color: var(--ink); font-size: 13.5px; }
.ch-select-summary span { color: var(--dim); font: 600 10px "Spline Sans Mono", monospace; line-height: 1.35; text-transform: uppercase; letter-spacing: .06em; }
.ch-action-row { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.ch-tool {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--dim);
  cursor: pointer;
  font: 700 11px "Instrument Sans";
  white-space: nowrap;
}
.ch-tool:hover:not(:disabled), .ch-tool.is-on {
  border-color: var(--neon);
  background: rgba(65, 255, 161,.12);
  color: var(--neon);
  box-shadow: 0 0 18px rgba(65, 255, 161,.12);
}
.ch-tool:disabled { opacity: .42; cursor: not-allowed; }
.ch-kbd {
  font: 700 9px "Spline Sans Mono", monospace; letter-spacing: .02em; color: var(--dim); background: rgba(12, 24, 18, 0.07);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; margin-left: 2px;
}
.ch-tool.is-on .ch-kbd, .ch-tool:hover .ch-kbd { color: rgba(255, 255, 255,.65); border-color: rgba(255, 255, 255,.25); }
.ch-tool-danger { color: #ffb0bb; border-color: rgba(224, 52, 94,.28); }
.ch-tool-danger:hover:not(:disabled) { color: #ffdce1; border-color: rgba(224, 52, 94,.75); background: rgba(224, 52, 94,.12); box-shadow: 0 0 18px rgba(224, 52, 94,.12); }
.ch-post-creator { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.ch-creation-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ch-creation-flow span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass);
  color: var(--dim);
  font: 700 11px "Instrument Sans";
}
.ch-creation-flow b {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(65, 255, 161,.14);
  color: var(--neon);
  font: 900 10px "Spline Sans Mono", monospace;
}
.ch-creation-layout { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(260px, .58fr); gap: 12px; align-items: start; }
.ch-creation-panel {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
}
.ch-creation-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ch-creation-panel-head b, .ch-creation-next > b { display: block; color: var(--ink); font-size: 13.5px; }
.ch-creation-panel-head span { display: block; margin-top: 3px; color: var(--dim); font: 700 9px "Spline Sans Mono", monospace; letter-spacing: .06em; text-transform: uppercase; }
.ch-creation-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  max-height: min(58vh, 520px);
  overflow: auto;
  padding-right: 2px;
}
.ch-creation-source {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.ch-creation-source:hover, .ch-creation-source.is-on { border-color: var(--neon); box-shadow: 0 0 0 1px rgba(65, 255, 161,.16), 0 12px 24px rgba(0,0,0,.18); }
.ch-creation-thumb {
  position: relative;
  display: block;
  width: 96px;
  aspect-ratio: 16/10;
  border-radius: 10px;
  overflow: hidden;
  background: var(--glass-2);
  border: 1px solid rgba(65, 255, 161,.14);
}
.ch-creation-thumb img, .ch-creation-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-creation-thumb .ch-pub-media-empty { width: 100%; height: 100%; display: grid; place-items: center; font-size: 8px; text-align: center; }
.ch-creation-source-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ch-creation-source-body b { color: var(--ink); font-size: 12.5px; line-height: 1.2; }
.ch-creation-source-body i { color: var(--dim); font-style: normal; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-creation-source-body em { color: var(--dim-2); font-style: normal; font-size: 11px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ch-creation-source > strong {
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border-left: 1px solid rgba(65, 255, 161,.16);
  color: var(--neon);
  font-size: 11px;
  white-space: nowrap;
}
.ch-creation-next { display: flex; flex-direction: column; gap: 10px; }
.ch-creation-next p { margin: 0; color: var(--dim); font-size: 12.5px; line-height: 1.5; }
.ch-empty-hint {
  min-height: 180px;
  display: grid;
  place-items: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--dim);
  text-align: center;
}
.ch-empty-hint b { color: var(--ink); font-size: 14px; }
.ch-empty-hint p { max-width: 480px; margin: 0; font-size: 12.5px; line-height: 1.5; }
.ch-post-creator-recent, .ch-post-creator-note { margin-top: 12px; }
.ch-asset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.ch-asset-card { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: var(--glass); overflow: hidden; transition: border-color .18s, background .18s, transform .15s; }
.ch-asset-card:hover { border-color: var(--line-strong); background: var(--glass); transform: translateY(-1px); }
.ch-selectable { position: relative; }
.ch-selectable.is-selected {
  border-color: var(--neon);
  box-shadow: 0 0 0 1px rgba(65, 255, 161,.26), 0 0 28px rgba(65, 255, 161,.13);
}
.ch-selectable.is-selected .ch-asset-thumb,
.ch-selectable.is-selected .ch-post-thumb { outline: 1px solid rgba(65, 255, 161,.22); outline-offset: -1px; }
.ch-select-box {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(12, 24, 18,.4);
  border-radius: 8px;
  background: var(--glass);
  color: #ffffff;
  font: 900 14px "Spline Sans Mono", monospace;
  box-shadow: 0 0 16px rgba(12, 24, 18, 0.122);
}
.ch-selectable.is-selected .ch-select-box { border-color: var(--neon); background: var(--neon); color: #ffffff; box-shadow: 0 0 18px rgba(65, 255, 161,.34); }
.ch-asset-x { opacity: .95; z-index: 6; }
.ch-asset-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16/10; min-height: 150px; border-radius: 11px; overflow: hidden; color: var(--dim); font: 700 9px "Spline Sans Mono", monospace; text-transform: uppercase; letter-spacing: .12em; background: rgba(12, 24, 18, 0.056); }
.ch-asset-thumb img, .ch-asset-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-asset-thumb.has-real-media img,
.ch-asset-thumb.has-real-media video { object-fit: contain; background: var(--glass-2); }
.ch-asset-card .ch-asset-thumb.has-real-media { border: 1px solid rgba(65, 255, 161,.16); }
.ch-asset-card:hover .ch-asset-thumb.has-real-media { border-color: rgba(65, 255, 161,.36); }
.ch-asset-thumb em { position: relative; z-index: 1; font-style: normal; color: #a39fb8; }
.ch-asset-thumb b { position: absolute; top: 8px; right: 8px; z-index: 2; padding: 3px 7px; border-radius: 999px; background: var(--glass); color: var(--dim); font: 700 8px "Spline Sans Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.ch-asset-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ch-asset-body strong { color: var(--ink); font-size: 13.5px; }
.ch-asset-body small { color: var(--dim); font-size: 11px; line-height: 1.35; }
.ch-asset-body span { color: var(--dim-2); font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ch-post { display: flex; flex-direction: column; gap: 7px; padding: 0 0 12px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--glass-2); cursor: pointer; text-align: left; transition: border-color .2s, transform .15s; }
.ch-post:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.ch-post-thumb { position: relative; display: block; aspect-ratio: 16/10; }
.ch-post-plat { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: #fff; font: 700 12px "Spline Sans Mono", monospace; }
.ch-post-type { position: absolute; top: 8px; right: 8px; font: 600 8.5px "Spline Sans Mono", monospace; letter-spacing: .1em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: var(--glass); color: var(--dim); }
.ch-post-play { position: absolute; inset: 0; margin: auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--glass); color: var(--ink); font-size: 15px; }
.ch-post-play.big { width: 64px; height: 64px; font-size: 24px; }
.ch-post-sched { position: absolute; left: 8px; bottom: 8px; font: 600 9px "Spline Sans Mono", monospace; padding: 3px 8px; border-radius: 999px; background: rgba(199, 126, 0,.16); color: var(--warn); }
.ch-post-cap { padding: 0 12px; font-size: 13px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ch-post-meta { padding: 0 12px; font-size: 11px; color: var(--dim); }
.ch-post-stats { display: flex; gap: 10px; padding: 2px 12px 0; flex-wrap: wrap; }
.ch-post-stats span { display: inline-flex; align-items: center; gap: 4px; font: 500 11px "Spline Sans Mono", monospace; color: var(--dim); }
.ch-post-stats .ic { width: 12px; height: 12px; color: var(--neon); }

.ch-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); color: var(--dim); cursor: pointer; font: 500 12.5px "Instrument Sans"; }
.ch-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.ch-chip.is-on { border-color: var(--neon); color: var(--neon); background: rgba(65, 255, 161,.08); }
.ch-chip em { font-style: normal; font: 600 10px "Spline Sans Mono", monospace; opacity: .7; }
.ch-platstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(120deg, color-mix(in srgb, var(--pc) 12%, transparent), transparent); }

.ch-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ch-tr { display: grid; grid-template-columns: 2.5fr 1.2fr .8fr .8fr; align-items: center; gap: 10px; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left; cursor: pointer; font-size: 12.5px; }
.ch-tr:last-child { border-bottom: 0; }
.ch-tr:not(.ch-th):hover { background: rgba(65, 255, 161,.05); }
.ch-th { color: var(--dim); font: 600 9.5px "Spline Sans Mono", monospace; letter-spacing: .12em; text-transform: uppercase; cursor: default; background: rgba(12, 24, 18, 0.04); }
.ch-th .ic { width: 12px; height: 12px; vertical-align: middle; }
.ch-tr-post { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
.ch-tr-thumb { width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto; }
.ch-num { font: 500 13px "Spline Sans Mono", monospace; color: var(--neon); }
.ch-comments { display: flex; flex-direction: column; gap: 8px; }
.ch-comment { display: flex; gap: 11px; padding: 11px 13px; border: 1px solid var(--line); border-left-width: 3px; border-radius: 12px; background: var(--glass); }
.ch-s-pos { border-left-color: var(--neon); }
.ch-s-neg { border-left-color: var(--risk); }
.ch-s-neu { border-left-color: var(--dim-2); }
.ch-c-av { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font: 700 12px "Spline Sans Mono", monospace; color: #ffffff; background: linear-gradient(120deg, var(--neon), #41ffa1); }
.ch-c-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ch-c-body b { font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.ch-c-sent { font: 600 8.5px "Spline Sans Mono", monospace; text-transform: uppercase; letter-spacing: .08em; padding: 2px 6px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--dim); }
.ch-s-pos .ch-c-sent { color: var(--neon); background: rgba(65, 255, 161,.1); }
.ch-s-neg .ch-c-sent { color: #c22b52; background: rgba(224, 52, 94,.1); }
.ch-c-text { font-size: 13px; color: var(--dim); }
.ch-c-meta { display: inline-flex; align-items: center; gap: 6px; font: 400 10.5px "Spline Sans Mono", monospace; color: var(--dim); }
.ch-c-meta .ic { width: 11px; height: 11px; }
.ch-react { display: flex; flex-direction: column; gap: 11px; max-width: 560px; }
.ch-react-row { display: grid; grid-template-columns: 30px 70px 1fr auto; align-items: center; gap: 10px; }
.ch-react-emo { font-size: 19px; }
.ch-react-lab { font-size: 12.5px; text-transform: capitalize; color: var(--dim); }

.ch-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.ch-modal-bg { position: absolute; inset: 0; border: 0; cursor: pointer; background: var(--glass); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ch-detail { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; width: min(940px, 100%); max-height: 88vh; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 22px; background: var(--glass); box-shadow: 0 40px 120px rgba(12, 24, 18, 0.16); animation: panelIn .3s ease both; }
.ch-detail-x { position: absolute; top: 14px; right: 14px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); color: #285141; cursor: pointer; }
.ch-detail-media { position: relative; min-height: 340px; }
.ch-detail-media .ch-post-plat { width: 30px; height: 30px; }
.ch-detail-side { display: flex; flex-direction: column; gap: 10px; padding: 22px; overflow-y: auto; }
.ch-detail-h { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ch-detail-h b { font-size: 14px; }
.ch-detail-h span { color: var(--dim); }
.ch-detail-h em { margin-left: auto; font-style: normal; font: 400 11px "Spline Sans Mono", monospace; color: var(--dim); }
.ch-detail-cap { margin: 0; font-size: 14.5px; line-height: 1.5; }
.ch-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.ch-detail-tags span { font: 500 11px "Spline Sans Mono", monospace; color: var(--neon-2); }
.ch-dstats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0; }
.ch-dstat { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(65, 255, 161,.03); }
.ch-dstat span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--dim); }
.ch-dstat .ic { width: 13px; height: 13px; color: var(--neon); }
.ch-dstat b { font: 500 14px "Spline Sans Mono", monospace; color: var(--ink); }
.ch-detail-react { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--dim); }
.ch-detail-cmh { margin-top: 6px; font: 600 10px "Spline Sans Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.ch-detail-comments { display: flex; flex-direction: column; gap: 8px; }

.an-src { display: inline-flex; align-items: center; gap: 8px; font: 500 12px "Spline Sans Mono", monospace; color: var(--dim); }
.an-src .ic { width: 14px; height: 14px; color: var(--neon); }
.an-src b { color: var(--neon); }
.an { display: grid; gap: 16px; min-width: 0; }
.an .an-hero { margin: 0; }
.an .ch-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.an .ch-kpi { min-height: 106px; justify-content: center; border-radius: 14px; background: var(--glass); }
.an .ch-kpi:nth-child(1) { border-top: 2px solid #41ffa1; }
.an .ch-kpi:nth-child(2) { border-top: 2px solid #16d985; }
.an .ch-kpi:nth-child(3) { border-top: 2px solid #ff7aa8; }
.an .ch-kpi:nth-child(4) { border-top: 2px solid #c77e00; }
.an-flash { padding: 10px 13px; border-left: 3px solid var(--neon); background: rgba(65, 255, 161,.07); color: var(--dim); font-size: 12.5px; }
.an-visual-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(250px, .55fr); gap: 14px; align-items: stretch; }
.an-trend-card, .an-coverage-card, .an-engagement-card { margin: 0; }
.an-trend-card { min-height: 310px; overflow: hidden; }
.an-trend-card .ch-card-h { align-items: flex-start; margin-bottom: 4px; }
.an-trend-card .ch-card-h h3, .an-engagement-card .ch-card-h h3, .an-section-head h3 { margin: 3px 0 0; font-size: 16px; }
.an-live-label { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--dim); font: 700 8.5px "Spline Sans Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.an-chart-wrap { position: relative; display: grid; min-height: 238px; align-content: end; }
.an-chart-wrap .an-chart { width: 100%; height: 190px; overflow: visible; }
.an-grid-line { stroke: rgba(154, 148, 184,.1); stroke-width: 1; vector-effect: non-scaling-stroke; }
.an-channel-line { fill: none; stroke: var(--channel); stroke-width: 3; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--channel) 48%, transparent)); }
.an-channel-line.is-waiting { opacity: .24; stroke-width: 2; stroke-dasharray: 7 9; filter: none; }
.an-chart-empty { position: absolute; inset: 58px 20px 48px; display: grid; place-content: center; gap: 5px; text-align: center; pointer-events: none; }
.an-chart-empty b { color: var(--ink); font-size: 14px; }
.an-chart-empty span { color: var(--dim); font-size: 11.5px; }
.an-chart-legend { display: flex; flex-wrap: wrap; gap: 7px 14px; min-height: 22px; padding-top: 6px; }
.an-chart-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font: 600 9px "Spline Sans Mono", monospace; }
.an-chart-legend i { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.an-coverage-card { display: grid; align-content: start; gap: 22px; background: radial-gradient(circle at 50% 40%, rgba(22, 217, 133,.08), transparent 52%), var(--glass); }
.an-coverage { display: grid; place-items: center; gap: 18px; min-height: 240px; text-align: center; }
.an-coverage-ring { position: relative; width: 152px; height: 152px; display: grid; place-items: center; border-radius: 50%; transform: rotate(-2deg); box-shadow: 0 0 42px rgba(65, 255, 161,.08); }
.an-coverage-ring::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: var(--glass-2); border: 1px solid rgba(65, 255, 161,.12); box-shadow: inset 0 0 22px rgba(12, 24, 18, 0.16); }
.an-coverage-ring span { position: relative; z-index: 1; display: grid; gap: 2px; transform: rotate(2deg); }
.an-coverage-ring b { color: var(--ink); font: 700 26px "Spline Sans Mono", monospace; }
.an-coverage-ring i { color: var(--dim); font: 700 8px "Spline Sans Mono", monospace; letter-spacing: .1em; text-transform: uppercase; font-style: normal; }
.an-coverage-copy b { color: var(--ink); font-size: 14px; }
.an-coverage-copy p { margin: 5px auto 0; max-width: 220px; color: var(--dim); font-size: 11.5px; line-height: 1.45; }
.an-engagement-card .ch-bars { gap: 12px; }
.an-engagement-card .ch-bar-row { grid-template-columns: 150px minmax(0, 1fr) 64px; }
.an-engagement-card .ch-bar-track { height: 10px; background: rgba(255,255,255,.045); }
.an-engagement-card .ch-bar-fill { min-width: 0; }
.an-empty-note {
  display: grid;
  gap: 4px;
  min-height: 86px;
  align-content: center;
  padding: 18px;
  border: 1px dashed rgba(65, 255, 161,.22);
  border-radius: 14px;
  background: rgba(65, 255, 161,.035);
}
.an-empty-note b { color: var(--ink); font-size: 14px; }
.an-empty-note span { color: var(--dim); font-size: 12px; line-height: 1.45; }
.an-section-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-top: 4px; }
.an-section-head > span { color: var(--dim); font: 700 9px "Spline Sans Mono", monospace; letter-spacing: .08em; }
.an-channel-list { display: grid; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--glass); }
.an-channel-row { display: grid; grid-template-columns: minmax(210px,.8fr) minmax(320px,1.35fr) minmax(150px,.55fr) auto; align-items: center; gap: 16px; min-height: 82px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.an-channel-row:last-child { border-bottom: 0; }
.an-channel-row.is-missing { grid-template-columns: minmax(210px,.8fr) minmax(300px,1.4fr) auto; }
.an-channel-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.an-channel-id > span:last-child { min-width: 0; }
.an-channel-id b, .an-channel-id i { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-channel-id b { color: var(--ink); font-size: 13.5px; }
.an-channel-id i { margin-top: 3px; color: var(--dim); font-size: 11px; font-style: normal; }
.an-channel-metrics { display: grid; grid-template-columns: repeat(4,minmax(68px,1fr)); gap: 8px; }
.an-channel-metrics span { display: grid; gap: 2px; color: var(--dim); font: 700 8px "Spline Sans Mono",monospace; letter-spacing: .08em; text-transform: uppercase; }
.an-channel-metrics b { color: var(--ink); font-size: 14px; letter-spacing: 0; }
.an-channel-source, .an-channel-empty { display: grid; gap: 3px; min-width: 0; }
.an-channel-source b, .an-channel-empty b { color: var(--dim); font-size: 11.5px; }
.an-channel-source i, .an-channel-empty span { color: var(--dim); font-size: 10.5px; font-style: normal; }
.an-target-safe {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 3px;
  padding: 4px 7px;
  border: 1px solid rgba(65, 255, 161,.22);
  border-radius: 999px;
  background: rgba(65, 255, 161,.055);
  color: var(--ink);
  font: 700 8.5px "Spline Sans Mono", monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: normal;
}
.an-channel-actions { display: flex; justify-content: flex-end; gap: 7px; }
.an-channel-actions .btn { min-height: 36px; white-space: nowrap; cursor: pointer; }
.an-wide { grid-column: auto; }
.an-gate { justify-content: center; min-height: 60vh; }
.an-connect-card {
  align-self: center; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
  max-width: 420px; margin: 0 auto; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--glass);
}
.an-connect-lede { margin: 0; color: var(--dim); font-size: 13px; }
.an-connected-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.an-account-chip {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(65, 255, 161,.05); font-size: 12.5px;
}
.an-account-chip b { color: var(--ink); }
.an-account-chip i { font-style: normal; color: var(--dim); }
.an-notice b { display: block; margin-bottom: 6px; font-size: 14px; color: #7a5200; }
.an-notice p { margin: 0; color: var(--dim); font-size: 12.5px; line-height: 1.55; }
.an-assets-line { margin: 0; color: var(--dim); font-size: 12.5px; }
.an-feed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.an-feed-card {
  display: flex; flex-direction: column; gap: 10px; min-height: 160px; padding: 16px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--glass);
}
.an-feed-card > div:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.an-feed-card > div:first-child b { color: var(--ink); }
.an-feed-card > div:first-child i { min-width: 0; color: var(--dim); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-feed-card strong { color: var(--neon); font-size: 14px; }
.an-feed-card p { margin: 0; color: var(--dim); font-size: 12.5px; line-height: 1.55; }
.an-feed-card.is-missing { border-color: rgba(199, 126, 0,.24); background: rgba(199, 126, 0,.035); }
.an-feed-card.is-missing strong { color: #7a5200; }
.an-feed-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: auto; }
.an-feed-metrics span {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 10px; color: var(--dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
}
.an-feed-metrics b { color: var(--ink); font: 600 15px "Spline Sans Mono", monospace; letter-spacing: 0; text-transform: none; }
.an-hero { align-items: center; background: linear-gradient(135deg, rgba(65, 255, 161,.08), rgba(255, 255, 255,.7)); }
.an-chart { width: 100%; height: 150px; display: block; }
.an-area { fill: rgba(65, 255, 161,.12); }
.an-line { fill: none; stroke: var(--neon); stroke-width: 2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgba(65, 255, 161,.5)); }
.an-donut-wrap { display: flex; align-items: center; gap: 16px; }
.an-donut { width: 120px; height: 120px; flex: 0 0 auto; transform: rotate(-90deg); }
.an-donut-c { transform: rotate(90deg); transform-origin: center; fill: var(--ink); font: 600 8px "Instrument Sans"; text-anchor: middle; }
.an-seg { transition: stroke-dasharray .6s; }
.an-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--dim); }
.an-legend span { display: inline-flex; align-items: center; gap: 7px; }
.an-legend i { width: 9px; height: 9px; border-radius: 2px; }
.an-legend b { color: var(--ink); font: 500 12px "Spline Sans Mono", monospace; margin-left: auto; }
.an-insight-card { display: flex; flex-direction: column; gap: 10px; min-height: 100%; }
.an-insight-card > b { font-size: 18px; color: var(--ink); }
.an-insight-card p { margin: 0; color: var(--dim); font-size: 13px; line-height: 1.55; }
.an-business-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; align-items: start; }
.an-trend-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.an-trend { display: flex; flex-direction: column; gap: 8px; }
.an-reco-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

@media (max-width: 980px) {
  .an .ch-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-visual-grid { grid-template-columns: 1fr; }
  .an-coverage-card { min-height: 260px; }
  .an-coverage { grid-template-columns: auto minmax(0, 1fr); min-height: 190px; text-align: left; }
  .an-channel-row, .an-channel-row.is-missing { grid-template-columns: minmax(0, 1fr) auto; }
  .an-channel-metrics, .an-channel-empty { grid-column: 1 / -1; }
  .an-channel-source { grid-column: 1; }
  .an-channel-actions { grid-column: 2; grid-row: 1; }
  .ch-kpis { grid-template-columns: repeat(3, 1fr); }
  .ch-cols, .ch-creator-layout, .ch-creation-layout, .ch-publish-grid, .an-business-grid { grid-template-columns: 1fr; }
  .ch-planner-layout { grid-template-columns: 1fr; }
  .ch-pub-preview { position: static; }
  .ch-production, .an-trend-list, .an-reco-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-library-actions.is-open { grid-template-columns: 1fr; }
  .ch-action-row { justify-content: flex-start; }
  .ch-detail { grid-template-columns: 1fr; max-height: 92vh; overflow-y: auto; }
  .ch-detail-media { min-height: 220px; }
}
@media (max-width: 640px) {
  .workspace-page[data-workspace-page="media"] .ml-topbar { flex-wrap: nowrap; }
  .workspace-page[data-workspace-page="media"] .ml-tabs { width: auto; flex: 1 1 auto; flex-wrap: nowrap; overflow-x: auto; }
  .workspace-page[data-workspace-page="media"] .ml-tab { flex: 0 0 auto; padding-inline: 12px; }
  .an-coverage { grid-template-columns: 1fr; text-align: center; }
  .an-channel-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-engagement-card .ch-bar-row { grid-template-columns: 104px minmax(0, 1fr) 42px; }
  .an-channel-row, .an-channel-row.is-missing { padding: 12px; gap: 11px; }
  .ch-kpis { grid-template-columns: repeat(2, 1fr); }
  .ch-creator-head, .an-hero { flex-direction: column; align-items: stretch; }
  .ch-tenant-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
  .ch-tenant-actions .btn,
  .ch-tenant-actions .ch-tool { width: 100%; }
  .ch-draft, .ch-calendar-item { grid-template-columns: 1fr; }
  .ch-production, .an-trend-list, .an-reco-grid { grid-template-columns: 1fr; }
  .ch-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; overflow: visible; flex-wrap: nowrap; }
  .ch-chips { overflow: visible; flex-wrap: wrap; }
  .ch-tab { min-width: 0; padding: 9px 3px; text-align: center; font-size: 11px; white-space: nowrap; }
  .ch-tabs > .ch-src { grid-column: 1 / -1; width: 100%; line-height: 1.45; }
  .ch-card-h { align-items: flex-start; flex-direction: column; gap: 8px; }
  .ch-card-h > div { min-width: 0; }
  .ch-card-h .ch-src {
    display: block;
    width: 100%;
    line-height: 1.4;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .ch-card-h > .ch-tool,
  .ch-card-h > .ch-pub-safe {
    width: 100%;
    justify-content: center;
  }
  .ch-subtabs { overflow: visible; flex-wrap: wrap; margin-top: -8px; padding-bottom: 10px; scrollbar-width: none; }
  .ch-subtabs::-webkit-scrollbar { display: none; }
  .ch-subtab { flex: 1 1 calc(50% - 7px); min-height: 38px; text-align: center; }
  .ch-src { flex-basis: 100%; margin-left: 0; }
  .ch-library-head { flex-direction: column; }
  .ch-storage { width: 100%; align-items: stretch; }
  .ch-storage i { width: 100%; }
  .ch-creation-flow { grid-template-columns: 1fr; }
  .ch-creation-panel-head { align-items: stretch; flex-direction: column; }
  .ch-creation-source-grid { grid-template-columns: 1fr; max-height: none; overflow: visible; }
  .ch-creation-source { grid-template-columns: 82px minmax(0, 1fr); }
  .ch-creation-thumb { width: 82px; }
  .ch-creation-source > strong { grid-column: 1 / -1; min-height: 34px; border-left: 0; border-top: 1px solid rgba(65, 255, 161,.16); }
  .ch-action-row { display: grid; grid-template-columns: 1fr; width: 100%; }
  .ch-tool { width: 100%; min-height: 40px; white-space: normal; }
  .ch-pub-source-head { align-items: stretch; flex-direction: column; }
  .ch-pub-platforms, .ch-pub-source-grid, .ch-pub-row, .ch-pub-queue-grid { grid-template-columns: 1fr; }
  .ch-pub-presets,
  .ch-pub-format-row,
  .ch-pub-tone-row { display: grid; grid-template-columns: 1fr; }
  .ch-chip { width: 100%; justify-content: center; white-space: normal; }
  .ch-pub-schedule { min-width: 0; margin-left: 0; grid-column: 1 / -1; }
  .ch-planner-hero { align-items: stretch; flex-direction: column; }
  .ch-planner-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ch-planner-metrics span { min-width: 0; padding: 9px; }
  .ch-planner-metrics b { font-size: 17px; }
  .ch-planner-head { align-items: flex-start; flex-direction: column; }
  .ch-planner-week { grid-template-columns: 1fr; }
  .ch-planner-day { min-height: 0; }
  .ch-planner-day > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-planner-open { grid-column: 1 / -1; }
  .ch-planner-connector-groups { grid-template-columns: 1fr; }
  .ch-asset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; scroll-snap-type: none; padding-bottom: 0; }
  .ch-asset-card { min-width: 0; scroll-snap-align: none; padding: 8px; }
  .ch-asset-body span { -webkit-line-clamp: 1; }
  .ch-bar-row { grid-template-columns: 100px 1fr auto; }
  .ch-tr { grid-template-columns: 2fr 1fr .8fr; }
  .ch-tr span:nth-child(4) { display: none; }
}


/* ==============  CONTENT HUB — inline image editor  ========== */
/* ============================================================= */
.ch-asset-card { cursor: pointer; }
.ch-lightbox { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: clamp(10px, 2.4vw, 32px); }
.ch-lb-backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(65, 255, 161,0.06), transparent 55%), rgba(255, 255, 255,0.86);
  backdrop-filter: blur(6px);
}
.ch-lb-shell {
  /* height (not just max-height) so .ch-lb-body's flex:1 1 auto resolves to a
     definite size - otherwise .ch-lb-canvas's max-width/max-height: 100% has
     no definite ancestor height to resolve against, so it's ignored and a
     tall/portrait source image renders at its native pixel size and gets
     silently clipped by this shell's own overflow: hidden. */
  position: relative; width: min(1540px, 100%); height: min(960px, 96dvh); display: flex; flex-direction: column;
  border: 1px solid var(--line-strong); border-radius: 26px; overflow: hidden;
  background: var(--glass);
  box-shadow: 0 30px 90px rgba(12, 24, 18, 0.16), 0 0 0 1px rgba(65, 255, 161,0.05), 0 0 60px rgba(65, 255, 161,0.06);
  animation: chLbIn .28s cubic-bezier(.22,1,.36,1);
}
@keyframes chLbIn { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
.ch-lb-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.ch-lb-head b { font-size: 15px; }
.ch-lb-head span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--dim); max-width: 70vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-lb-head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ch-lb-x {
  flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(12, 24, 18, 0.048); color: var(--dim); cursor: pointer;
  font: 700 13px "Instrument Sans"; padding: 0;
}
.ch-lb-x:hover { color: var(--ink); border-color: var(--line-strong); }
.ch-lb-x .ic { width: 15px; height: 15px; }
.ch-lb-tutorial {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 20px;
  border-bottom: 1px solid var(--line); background: rgba(65, 255, 161,0.04); max-height: 34vh; overflow-y: auto;
}
.ch-lb-tutorial-row { display: grid; grid-template-columns: 200px 1fr; gap: 14px; font-size: 12px; line-height: 1.5; }
.ch-lb-tutorial-row b { color: var(--neon); }
.ch-lb-tutorial-row span { color: var(--dim); }
@media (max-width: 900px) { .ch-lb-tutorial-row { grid-template-columns: 1fr; gap: 2px; } }
.ml-tools .ch-lb-tutorial { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; max-height: none; }
.ml-tools .ch-lb-tutorial-row { grid-template-columns: 1fr; gap: 2px; }

.ch-lb-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 370px; }
.ch-lb-canvas-wrap {
  position: relative; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--glass-2);
}
.ch-editor-toolbar {
  flex: 0 0 auto; min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--glass); overflow-x: auto; scrollbar-width: none;
}
.ch-editor-toolbar::-webkit-scrollbar { display: none; }
.ch-editor-toolgroup { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.ch-editor-toolgroup button {
  min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: rgba(255,255,255,.025); cursor: pointer;
  font: 650 11px "Instrument Sans";
}
.ch-editor-toolgroup button:hover:not(:disabled) { border-color: var(--neon); background: rgba(65, 255, 161,.08); }
.ch-editor-toolgroup button:disabled { opacity: .34; cursor: default; }
.ch-editor-toolgroup button .ic { width: 14px; height: 14px; }
.ch-editor-toolgroup span { min-width: 44px; text-align: center; color: var(--dim); font: 700 10px "Spline Sans Mono", monospace; }
.ch-editor-stage {
  position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 34px; display: flex; align-items: flex-start; justify-content: center;
  background-color: var(--glass-2);
  background-image: linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.025) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255,255,255,.025) 75%), linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.025) 75%);
  background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.ch-editor-surface {
  position: relative; flex: 0 0 auto; width: 100%; max-width: none; margin: auto; line-height: 0; transform-origin: top center;
  box-shadow: 0 24px 70px rgba(12, 24, 18, 0.16), 0 0 0 1px rgba(65, 255, 161,.11); transition: width .14s ease;
}
.ch-lb-canvas { display: block; width: 100%; height: auto; max-width: none; max-height: none; border-radius: 0; box-shadow: none; }
.ch-editor-overlay { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; cursor: move; touch-action: none; }
.ch-editor-overlay.is-dragging { cursor: grabbing; }
.ch-editor-overlay.is-picking { cursor: crosshair; outline: 2px dashed rgba(65, 255, 161,.72); outline-offset: 3px; }
.ch-lb-load-error {
  position: absolute; inset: 22px; z-index: 2; display: flex; flex-direction: column; gap: 6px;
  align-items: center; justify-content: center; text-align: center; padding: 24px;
  border: 1px dashed rgba(199, 126, 0,0.4); border-radius: 16px; background: var(--glass); color: var(--warn);
}
.ch-lb-load-error span { color: var(--dim); font-size: 12.5px; max-width: 340px; }
.ch-lb-canvas.is-picking { cursor: crosshair; outline: 2px dashed rgba(65, 255, 161,0.65); outline-offset: 4px; }
.ch-lb-bokeh-marker {
  position: absolute; min-width: 24px; min-height: 24px; transform: translate(-50%, -50%); border-radius: 50%;
  border: 2px solid var(--neon); box-shadow: 0 0 0 4px rgba(65, 255, 161,0.16), 0 0 18px rgba(65, 255, 161,0.55);
  pointer-events: auto; cursor: grab; display: grid; place-items: center; animation: chBokehPulse 2.2s ease-in-out infinite;
  touch-action: none;
}
.ch-lb-bokeh-marker:active { cursor: grabbing; }
.ch-lb-bokeh-marker.is-selected { border-color: #c77e00; box-shadow: 0 0 0 4px rgba(199, 126, 0,0.2), 0 0 18px rgba(199, 126, 0,0.6); }
.ch-lb-bokeh-marker::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--neon); box-shadow: 0 0 8px rgba(65, 255, 161,0.9); }
.ch-lb-bokeh-marker.is-selected::before { background: #c77e00; box-shadow: 0 0 8px rgba(199, 126, 0,0.9); }
@keyframes chBokehPulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(65, 255, 161,0.16), 0 0 18px rgba(65, 255, 161,0.55); } 50% { box-shadow: 0 0 0 7px rgba(65, 255, 161,0.08), 0 0 22px rgba(65, 255, 161,0.4); } }
.ch-lb-pick-hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(65, 255, 161,0.4); background: var(--glass);
  color: var(--neon); font: 700 11px "Instrument Sans"; box-shadow: 0 10px 26px rgba(12, 24, 18, 0.122); pointer-events: none;
}
.ch-lb-pick-hint .ic { width: 13px; height: 13px; }

.ch-lb-tools {
  border-left: 1px solid var(--line); background: rgba(12, 24, 18, 0.036); padding: 16px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px; scrollbar-width: thin;
}
.ch-lb-layers {
  padding: 12px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.1);
  background: linear-gradient(155deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015));
}
.ch-layer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.ch-layer-head .ch-lb-ai-label { margin: 0; }
.ch-layer-head > span { color: var(--dim); font: 700 10px "Spline Sans Mono", monospace; }
.ch-layer-add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.ch-layer-add-row button {
  min-height: 34px; border: 1px solid var(--line); border-radius: 9px; background: rgba(65, 255, 161,.055); color: var(--ink);
  cursor: pointer; font: 650 11px "Instrument Sans";
}
.ch-layer-add-row button:hover { border-color: var(--neon); background: rgba(65, 255, 161,.11); }
.ch-lb-layer-list { display: flex; flex-direction: column; gap: 7px; }
.ch-lb-layer {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 9px;
  padding: 8px; border: 1px solid rgba(255,255,255,0.08); border-radius: 11px; background: rgba(12, 24, 18, 0.036);
}
.ch-lb-layer button {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(65, 255, 161,0.08); color: var(--neon); cursor: pointer; padding: 0;
}
.ch-lb-layer button .ic { width: 14px; height: 14px; }
.ch-lb-layer button:disabled { cursor: default; opacity: 0.78; }
.ch-lb-layer span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ch-lb-layer b { font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-lb-layer small { font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-lb-layer.is-off { opacity: 0.58; }
.ch-lb-layer.is-off button { color: var(--dim); background: rgba(12, 24, 18, 0.048); }
.ch-lb-layer.is-off b { color: var(--ink); }
.ch-compose-layer { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 6px; }
.ch-compose-layer.is-selected { border-color: rgba(65, 255, 161,.56); background: rgba(65, 255, 161,.09); box-shadow: inset 3px 0 var(--neon); }
.ch-lb-layer .ch-layer-name { width: auto; height: auto; min-width: 0; display: flex; align-items: flex-start; padding: 3px 2px; border: 0; background: transparent; text-align: left; }
.ch-lb-layer .ch-layer-name:hover { background: transparent; }
.ch-layer-row-actions { display: flex !important; flex-direction: row !important; gap: 3px !important; }
.ch-lb-layer .ch-layer-row-actions button { width: 25px; height: 25px; border-radius: 7px; font-size: 12px; }
.ch-effect-layer { opacity: .72; }
.ch-effect-layer.is-subject-guide { opacity: 1; border-color: rgba(65, 255, 161,.38); background: rgba(65, 255, 161,.08); }
.ch-effect-layer.is-subject-guide b { color: var(--neon); }
.ch-layer-inspector { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ch-layer-inspector.is-empty { min-height: 54px; display: grid; place-items: center; color: var(--dim); font-size: 11px; }
.ch-layer-inspector-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ch-layer-inspector-head b { color: var(--ink); font-size: 12px; }
.ch-layer-inspector-head span { color: var(--neon); font: 700 9px "Spline Sans Mono", monospace; text-transform: uppercase; }
.ch-layer-prop-grid, .ch-layer-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ch-layer-action-row {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 10px;
}
.ch-layer-action-row button {
  min-height: 32px; border: 1px solid var(--line); border-radius: 9px; background: rgba(65, 255, 161,.055);
  color: var(--ink); cursor: pointer; font: 700 10.5px "Instrument Sans";
}
.ch-layer-action-row button:first-child {
  grid-column: 1 / -1; border-color: rgba(199, 126, 0,.26); color: #7a5200; background: rgba(199, 126, 0,.055);
}
.ch-layer-action-row button:hover { border-color: var(--neon); background: rgba(65, 255, 161,.12); color: var(--ink); }
.ch-layer-toggle-row { margin: 0 0 10px; }
.ch-layer-prop { display: block; margin: 0 0 8px; min-width: 0; }
.ch-layer-prop > span { display: flex; justify-content: space-between; gap: 8px; color: var(--dim); font-size: 10.5px; }
.ch-layer-prop b { color: var(--neon); font: 650 9.5px "Spline Sans Mono", monospace; }
.ch-layer-prop input { width: 100%; accent-color: var(--neon); }
.ch-layer-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 9px; color: var(--dim); font-size: 10px; }
.ch-layer-field input, .ch-layer-field select, .ch-layer-field textarea {
  width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: rgba(12, 24, 18, 0.056); color: var(--ink);
  padding: 8px; outline: none; resize: vertical; font: 500 11px "Instrument Sans";
}
.ch-layer-field input:focus, .ch-layer-field select:focus, .ch-layer-field textarea:focus { border-color: var(--neon); }
.ch-layer-field input[type="color"] { height: 34px; padding: 3px; cursor: pointer; }
.ch-lb-ai {
  padding: 12px; border-radius: 16px; border: 1px solid rgba(65, 255, 161,0.28);
  background: linear-gradient(155deg, rgba(65, 255, 161,0.1), rgba(65, 255, 161,0.02));
}
.ch-lb-ai-label {
  margin: 0 0 8px; display: flex; align-items: center; gap: 6px; font: 700 10px "Spline Sans Mono", monospace;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--neon);
}
.ch-lb-ai-label .ic { width: 13px; height: 13px; }
.ch-lb-ai-row { display: flex; gap: 6px; }
.ch-image-tools { display: contents; }
.ch-lb-ai-compact { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.ch-lb-ai-compact .ch-lb-ai-label { margin: 0; }
.ch-lb-bg-one { min-width: 84px; justify-content: center; }
.ch-lb-ai-compact .ch-lb-ai-note { grid-column: 1 / -1; margin: 0; }
.ch-layer-tool-empty { padding: 11px; border: 1px dashed var(--line); border-radius: 8px; color: var(--dim); font-size: 11.5px; text-align: center; }
.ch-lb-bokeh-cta { width: 100%; justify-content: center; }
.ch-lb-bokeh-note { margin: 0 0 10px; font-size: 11.5px; color: var(--dim); line-height: 1.5; }
.ch-lb-bokeh-count {
  font-style: normal; margin-left: 6px; font: 700 9px "Spline Sans Mono", monospace; color: #ffffff;
  background: var(--neon); border-radius: 999px; padding: 2px 7px;
}
.ch-lb-bokeh .ch-lb-slider { margin-bottom: 8px; }
.ch-lb-bokeh .ch-lb-chips { margin-top: 4px; }
.ch-lb-bokeh-markers { position: absolute; inset: 0; z-index: 4; pointer-events: none; transition: opacity 0.15s ease; }
.ch-lb-bokeh-markers.is-hidden { opacity: 0; pointer-events: none; }
.ch-lb-bokeh-markers.is-hidden .ch-lb-bokeh-marker { pointer-events: none; }
.ch-bokeh-brush-cursor {
  position: absolute; z-index: 6; transform: translate(-50%, -50%); border-radius: 50%;
  border: 2px solid #c77e00; background: rgba(199, 126, 0,.07);
  box-shadow: 0 0 0 5px rgba(65, 255, 161,.1), 0 0 22px rgba(65, 255, 161,.38);
  opacity: 0; pointer-events: none; transition: width .08s ease, height .08s ease, opacity .08s ease;
}
.ch-bokeh-brush-cursor::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; transform: translate(-50%, -50%);
  border-radius: 50%; background: #c77e00; box-shadow: 0 0 8px rgba(199, 126, 0,.9);
}
.ch-bokeh-brush-cursor.is-visible { opacity: 1; }
.ch-lb-ai-input, .ch-lb-tools input[type="text"] {
  flex: 1 1 auto; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: rgba(12, 24, 18, 0.064);
  color: var(--ink); padding: 9px 11px; font-size: 12.5px; outline: none;
}
.ch-lb-ai-input:focus { border-color: var(--neon); }
.ch-lb-ai-input:disabled { opacity: 0.5; cursor: not-allowed; }
.ch-lb-ai-note { margin: 8px 0 0; font-size: 11px; line-height: 1.5; color: var(--dim); }
.ch-lb-ai-note-warn { color: var(--warn); }
.ch-lb-ai-note-ok { color: var(--neon); }
.ch-lb-check { display: flex; align-items: center; gap: 7px; margin: 8px 0; font-size: 11.5px; color: var(--dim); }
.ch-lb-check input { accent-color: var(--neon); }
.ch-lb-bokeh-selected { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(65, 255, 161,0.22); }
.ch-lb-bokeh-selected .ch-lb-ai-label { color: #c77e00; }
.ch-lb-bg-preview-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.ch-lb-bg-preview-imgs figure { margin: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background:
  repeating-conic-gradient(rgba(255,255,255,0.06) 0% 25%, transparent 0% 50%) 0 0/12px 12px; }
.ch-lb-bg-preview-imgs img { display: block; width: 100%; height: 88px; object-fit: cover; }
.ch-lb-bg-preview-imgs figcaption { padding: 3px 6px; font: 700 9px "Spline Sans Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.ch-lb-text-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ch-lb-preset-chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; background: rgba(255,255,255,0.02);
  color: var(--dim); font-size: 10.5px; text-transform: capitalize; cursor: pointer;
}
.ch-lb-preset-chip:hover { border-color: var(--neon); }
.ch-lb-preset-chip.is-on { color: #ffffff; background: linear-gradient(120deg, var(--neon), #41ffa1); border-color: transparent; }
.ch-lb-text-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.ch-lb-mini { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; color: var(--dim); }
.ch-lb-mini select, .ch-lb-mini input[type="color"] {
  border: 1px solid var(--line); border-radius: 8px; background: rgba(12, 24, 18, 0.064); color: var(--ink);
  padding: 6px 8px; font-size: 12px;
}
.ch-lb-mini input[type="color"] { padding: 2px; height: 30px; cursor: pointer; }
.ch-lb-section p { margin: 0 0 8px; font: 700 9.5px "Spline Sans Mono", monospace; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
details.ch-lb-section { border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: rgba(12, 24, 18, 0.028); }
details.ch-lb-section[open] { padding-bottom: 12px; }
details.ch-lb-section summary {
  cursor: pointer; list-style: none; padding: 11px 0; font: 700 10px "Spline Sans Mono", monospace; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--dim); display: flex; align-items: center; justify-content: space-between;
}
details.ch-lb-section summary::-webkit-details-marker { display: none; }
details.ch-lb-section summary::after { content: "+"; font-size: 14px; color: var(--dim); }
details.ch-lb-section[open] summary::after { content: "–"; }
details.ch-lb-section summary:hover { color: var(--ink); }
details.ch-lb-section .ch-lb-slider:last-child, details.ch-lb-section .ch-lb-chips:last-child { margin-bottom: 0; }
.ch-lb-slider { display: block; margin-bottom: 9px; }
.ch-lb-slider span { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--dim); margin-bottom: 4px; }
.ch-lb-slider span b { color: var(--neon); font: 600 11px "Spline Sans Mono", monospace; }
.ch-lb-slider input[type="range"] { width: 100%; accent-color: var(--neon); }
.ch-lb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-lb-chips button {
  cursor: pointer; border: 1px solid var(--line); border-radius: 9px; background: rgba(12, 24, 18, 0.048);
  color: var(--ink); padding: 7px 10px; font: 600 11.5px "Instrument Sans"; display: inline-flex; align-items: center; gap: 5px;
}
.ch-lb-chips button:hover { border-color: var(--neon); background: rgba(65, 255, 161,0.1); }
.ch-lb-chips button.is-on { color: #ffffff; background: linear-gradient(120deg, var(--neon), #41ffa1); border-color: transparent; }
.ch-lb-chips button .ic { width: 12px; height: 12px; }
.ch-lb-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 4px; }
.ch-lb-actions .btn { width: 100%; justify-content: center; }

.ch-lb-view-only .ch-lb-view-body { padding: 18px; display: grid; place-items: center; min-height: 0; }
.ch-lb-view-body video { max-width: 100%; max-height: 78dvh; border-radius: 14px; box-shadow: 0 20px 60px rgba(12, 24, 18, 0.16); }

@media (max-width: 900px) {
  .dev-provider-row { grid-template-columns: 88px minmax(130px, 1fr) repeat(2, minmax(72px, .65fr)); }
  .dev-provider-row > span:last-child { display: none; }
  .ch-lb-body { grid-template-columns: 1fr; grid-template-rows: minmax(260px, 52dvh) auto; overflow-y: auto; }
  .ch-lb-canvas-wrap { min-height: 260px; }
  .ch-lb-tools { border-left: none; border-top: 1px solid var(--line); max-height: none; overflow: visible; }
  .ch-lb-shell { max-height: 96dvh; }
  .ch-editor-presets { order: 3; }
}
@media (max-width: 767px) {
  .ch-lightbox { padding: 0; place-items: stretch; }
  .ch-lb-shell {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .ch-lb-head {
    padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 12px;
    align-items: flex-start;
  }
  .ch-lb-head span { max-width: 62vw; }
  .ch-lb-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ch-lb-canvas-wrap {
    flex: 0 0 min(54svh, 430px);
    min-height: 300px;
  }
  .ch-editor-toolbar { min-height: 48px; padding: 7px 8px; justify-content: flex-start; }
  .ch-editor-toolgroup button { min-width: 38px; min-height: 38px; }
  .ch-editor-presets button { white-space: nowrap; }
  .ch-editor-stage { padding: 18px; }
  .ch-lb-canvas { max-height: none; }
  .ch-lb-tools {
    padding: 12px;
    gap: 12px;
    background: var(--glass);
  }
  .ch-lb-ai-row { flex-direction: column; }
  .ch-lb-text-grid, .ch-lb-bg-preview-imgs { grid-template-columns: 1fr; }
  .ch-lb-chips button { min-height: 40px; flex: 1 1 auto; justify-content: center; }
  .ch-lb-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    margin: 0 -12px -12px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--glass);
  }
  .ch-lb-actions .btn { min-height: 44px; }
  .ch-layer-add-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ch-layer-add-row button { padding: 5px 3px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .ch-lb-shell, .ch-editor-surface, .ch-lb-bokeh-marker { animation: none !important; transition: none !important; }
}

/* Mobile admin fit pass: keep the command cockpit and taskbar in one phone viewport. */
@media (max-width: 767px) {
  :root {
    --mobile-admin-topbar: 64px;
    --mobile-admin-taskbar: 80px;
  }

  html,
  body,
  .phantom {
    min-height: 100svh;
  }

  .phantom {
    padding-bottom: 0;
  }

  .mobile-admin-homebar {
    min-height: calc(var(--mobile-admin-topbar) + env(safe-area-inset-top, 0px));
    padding: calc(7px + env(safe-area-inset-top, 0px)) 12px 7px;
  }

  .mobile-admin-brand {
    gap: 8px;
  }

  .mobile-admin-brand .brand-ghost {
    width: 30px;
    height: 30px;
  }

  .mobile-admin-brand b {
    max-width: 148px;
    font-size: 13px;
    letter-spacing: 0.1em;
  }

  .mobile-admin-brand i {
    font-size: 8.5px;
    letter-spacing: 0.14em;
  }

  .mobile-admin-actions {
    gap: 7px;
  }

  .mobile-icon-btn,
  .mobile-avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .app-main {
    min-height: calc(100svh - var(--mobile-admin-topbar));
    padding: 0 0 calc(var(--mobile-admin-taskbar) + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: hidden;
  }

  .app-main:has(> .console:not(.console-workspace)) {
    height: auto;
    min-height: calc(100svh - var(--mobile-admin-topbar));
    padding-bottom: 0 !important;
    overflow: visible;
  }

  .app-main:has(> .console:not(.console-workspace)) .console {
    overflow: visible;
  }

  .console {
    min-height: calc(100svh - var(--mobile-admin-topbar));
    padding: 10px 10px calc(var(--mobile-admin-taskbar) + 14px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
  }

  .console-center {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    gap: 0;
  }

  .console .hero2 {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: calc(100svh - var(--mobile-admin-topbar) - var(--mobile-admin-taskbar) - 24px - env(safe-area-inset-bottom, 0px)) !important;
    padding: 10px !important;
    border-radius: 20px;
  }

  .console .hero2-copy {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: 100%;
  }

  .console .chatbox {
    min-height: 0;
    height: 100%;
    border-radius: 18px;
  }

  .console .chatbox-head {
    padding: 10px 12px;
  }

  .console .chatbox-log {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px;
    gap: 8px;
  }

  .console .msg-body {
    max-width: 92%;
  }

  .console .msg-phantom .msg-body {
    padding: 8px 11px;
  }

  .console .msg-text {
    font-size: 13px;
    line-height: 1.45;
  }

  .console .chat-start {
    padding: 3px 0 6px;
  }

  .console .chat-start-t {
    font-size: 18px;
  }

  .console .chat-start-s {
    margin-bottom: 8px;
    font-size: 12.5px;
    line-height: 1.35;
  }

  .console .chat-start-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .console .chat-start-btn {
    min-height: 40px;
    padding: 8px;
    border-radius: 10px;
    font-size: 12px;
    text-align: center;
  }

  .console .chat-start-btn:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .console .chatbox-composer {
    margin: 0 8px 8px;
    padding: 8px 8px 8px 13px;
    border-radius: 17px;
  }

  .console .chatbox-composer input {
    height: 36px;
    font-size: 15px;
  }

  .console .chatbox-composer .cmd-send {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .console .chatbox-tools,
  .console .chatbox-trust {
    display: none !important;
  }

  .pc {
    gap: 9px;
  }

  .pc-avatar {
    width: 44px !important;
    height: 44px !important;
  }

  .pc-title {
    gap: 6px;
  }

  .pc-title b {
    max-width: 114px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
  }

  .pc-label {
    display: none;
  }

  .pc-mode {
    padding: 5px 9px;
    font-size: 9.5px;
    letter-spacing: 0.08em;
  }

  .pc-settings {
    width: 34px;
    height: 34px;
    min-height: 34px;
  }

  .mobile-bottom-nav {
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    min-height: 66px;
    padding: 7px 10px;
    gap: 6px;
    mask-image: none;
    -webkit-mask-image: none;
    scroll-padding-inline: 10px;
  }

  .mobile-bottom-item {
    flex: 0 0 74px;
    min-height: 52px;
    border-radius: 16px;
    font-size: 9.5px;
  }

  .mobile-bottom-item.is-active {
    flex-basis: 80px;
  }

  .mobile-bottom-item span {
    max-width: 68px;
  }
}

@media (max-width: 390px) {
  .mobile-admin-brand b {
    max-width: 132px;
  }

  .mobile-bottom-item {
    flex-basis: 70px;
  }

  .mobile-bottom-item.is-active {
    flex-basis: 76px;
  }
}

/* Mobile dock polish: the taskbar is a solid control surface, not a glass layer
   over active page text. Keep enough scroll runway below workspace pages so
   the final cards never park behind the fixed nav. */
@media (max-width: 767px) {
  .app-main {
    padding-bottom: calc(var(--mobile-admin-taskbar) + 34px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .console-workspace {
    padding-bottom: calc(var(--mobile-admin-taskbar) + 42px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .workspace-page {
    margin-bottom: calc(var(--mobile-admin-taskbar) + 26px + env(safe-area-inset-bottom, 0px));
  }

  .workspace-page-body {
    padding-bottom: calc(var(--mobile-admin-taskbar) + 30px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .mobile-bottom-nav {
    overflow-x: auto;
    overflow-y: hidden;
    background: var(--glass);
    border-color: rgba(65, 255, 161, 0.32);
    box-shadow:
      0 -30px 58px 14px rgba(255, 255, 255, 0.9),
      0 -10px 30px rgba(12, 24, 18, 0.16),
      0 0 0 1px rgba(12, 24, 18, 0.16),
      inset 0 1px 0 rgba(12, 24, 18, 0.08),
      0 0 26px rgba(65, 255, 161, 0.12);
    mask-image: none !important;
    -webkit-mask-image: none !important;
    isolation: isolate;
  }

  .mobile-bottom-nav::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: var(--glass);
  }

  .mobile-bottom-item {
    background: rgba(255, 255, 255, 0.01);
  }

  .mobile-bottom-item.is-active {
    background: linear-gradient(135deg, rgba(65, 255, 161, 0.26), rgba(37, 13, 132, 0.2));
  }
}

/* Mobile keyboard focus: the active chat input is .chatbox-composer. Older
   focus rules moved .cmd-input, which left the real composer buried under the
   iOS keyboard. Pin the real composer above the visual viewport keyboard gap. */
@media (max-width: 767px) {
  .phantom.is-command-focused {
    overflow-x: hidden;
  }

  .phantom.is-command-focused .app-main {
    padding-bottom: calc(150px + var(--phantom-keyboard-offset) + env(safe-area-inset-bottom, 0px)) !important;
  }

  .phantom.is-command-focused .console,
  .phantom.is-command-focused .console-workspace {
    padding-bottom: calc(158px + var(--phantom-keyboard-offset) + env(safe-area-inset-bottom, 0px)) !important;
  }

  .phantom.is-command-focused .console .hero2 {
    min-height: calc(100svh - var(--mobile-admin-topbar) - 22px) !important;
    overflow: visible;
  }

  .phantom.is-command-focused .console .chatbox {
    overflow: visible;
  }

  .phantom.is-command-focused .console .chatbox-log {
    padding-bottom: 92px;
  }

  .phantom.is-command-focused .console .chatbox-composer {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + var(--phantom-keyboard-offset) + env(safe-area-inset-bottom, 0px));
    z-index: 140;
    width: auto;
    max-width: none;
    min-height: 58px;
    margin: 0;
    padding: 8px 8px 8px 15px;
    border: 1px solid rgba(65, 255, 161, 0.44);
    border-radius: 18px;
    background: var(--glass);
    box-shadow:
      0 18px 44px rgba(12, 24, 18, 0.16),
      0 0 0 1px rgba(12, 24, 18, 0.16),
      0 0 34px rgba(65, 255, 161, 0.2);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    transform: translateZ(0);
  }

  .phantom.is-command-focused .console .chatbox-composer input {
    height: 40px;
    font-size: 16px;
    color: var(--ink);
    opacity: 1;
  }

  .phantom.is-command-focused .console .chatbox-composer input::placeholder {
    color: var(--ink);
  }

  .phantom.is-command-focused .console .chatbox-composer .cmd-send {
    width: 44px;
    height: 44px;
  }

  .phantom.is-command-focused .mobile-bottom-nav,
  body.phantom-keyboard-active .mobile-bottom-nav {
    opacity: 0;
    transform: translateY(120%);
    pointer-events: none;
  }
}

/* Current Command OS is dark-first; keep restored creator cards legible even
   where the historical stylesheet used opaque light-theme material. */
.phantom .ml-choose-card,
.phantom .ml-pending-card,
.phantom .ml-pool-pending-card {
  background: linear-gradient(150deg, rgba(24,242,143,.12), rgba(7,12,20,.98));
  border-color: rgba(65,255,161,.24);
  color: var(--ink);
}

.phantom .ml-pool-act.is-primary {
  background: rgba(24,242,143,.18);
  border-color: rgba(65,255,161,.48);
}
