/* Xưởng ảnh (#/studio). Scoped to .xs; theme via data-theme on the root. */
.xs {
  /* Dark = Wriline ink navy as one rounded card on the light page; the page itself stays the site's. */
  --frame: #0F1630; --float: rgba(21,29,59,.94); --node: #151D3B; --inset: #1C2547;
  --line: rgba(201,213,245,.1); --line2: rgba(201,213,245,.22); --text: #EEF2FF; --muted: #9AA5C8;
  --dot: rgba(201,213,245,.12); --canvas: #0B1126; --wire: #34406B; --pill: #EEF2FF; --pill-text: #0E1530;
  --sel: #6C8CFF; --shadow: 0 24px 50px -24px rgba(5,10,30,.8); --page: transparent;
  --ok: #34d399; --warn: #f59e4b; --bad: #f87171; --a1: #2B57F2; --a2: #6C8CFF;
  --frame-shadow: 0 30px 70px -30px rgba(14,21,48,.55); --tint: rgba(108,140,255,.18);
  font-family: 'Be Vietnam Pro', system-ui, sans-serif; color: var(--text); background: var(--page);
  padding: 12px; min-height: calc(100vh - 24px); box-sizing: border-box;
}
/* Light = the Wriline page tokens (white paper cards, #E4E9F7 lines, ink #0E1530, blue accent). */
.xs[data-theme="light"] {
  --frame: var(--p3a-glass-reg-bg, rgba(255,255,255,.78)); --float: rgba(255,255,255,.94); --node: var(--workspace-paper, #fff); --inset: var(--p3a-surface-soft, #F3F6FF);
  --line: var(--wl-line, #E4E9F7); --line2: var(--p3a-border-strong, #C9D5F5); --text: var(--wl-ink, #0E1530); --muted: var(--p3a-text-muted, #5A6380);
  --dot: rgba(36,72,216,.16); --canvas: #F7F9FF; --wire: #C9D5F5; --pill: var(--wl-ink, #0E1530); --pill-text: #fff;
  --sel: var(--wl-link, #2F5BEA); --shadow: 0 18px 40px -26px rgba(40,70,180,.35); --page: transparent; --a1: #2B57F2; --a2: #6C8CFF;
  --frame-shadow: var(--wl-shadow-paper, 0 24px 60px rgb(40 70 180 / 12%)); --tint: rgba(47,91,234,.1);
}
.xs *, .xs *::before, .xs *::after { box-sizing: border-box; }
:where(.xs) :where(button, input, textarea, select) { font: inherit; color: inherit; }
:where(.xs) button { cursor: pointer; }
:where(.xs) button:disabled { cursor: default; opacity: .5; }
.xs :focus-visible { outline: 2px solid var(--a2); outline-offset: 2px; }
.xs .ms { font-family: 'Material Symbols Outlined'; font-size: 20px; line-height: 1; font-weight: normal; }
.xs-frame { position: relative; border-radius: var(--radius-card, 26px); background: var(--frame); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--frame-shadow); backdrop-filter: blur(18px); }
.xs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top bar */
.xs-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.xs-brand { width: 34px; height: 34px; border-radius: 11px; background: var(--pill); color: var(--pill-text); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.xs-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 600; font-size: 18px; }
.xs-tabs { flex: 999 1 280px; min-width: 0; display: flex; align-items: center; gap: 6px; overflow-x: auto; }
.xs-tab { display: flex; align-items: center; gap: 2px; padding: 0 4px 0 12px; border-radius: 12px; flex: none; color: var(--muted); }
.xs-tab.is-active { background: var(--inset); color: var(--text); }
.xs-tab button { border: 0; background: transparent; padding: 0; min-height: 36px; display: flex; align-items: center; gap: 8px; max-width: 200px; }
.xs-tab-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 600; }
.xs-tab-x { width: 26px; height: 26px; border-radius: 8px; color: var(--muted); justify-content: center; }
.xs-seg { display: inline-flex; flex-wrap: wrap; padding: 4px; border-radius: 16px; background: var(--inset); gap: 3px; }
.xs-seg button { display: inline-flex; align-items: center; justify-content: center; text-align: center; border: 0; background: transparent; color: var(--muted); min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.xs-seg button[aria-pressed="true"] { background: var(--pill); color: var(--pill-text); }
.xs-btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 0 14px; min-height: 40px; border-radius: 999px; border: 0; background: var(--inset); color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.xs-btn--primary { background: var(--pill); color: var(--pill-text); font-weight: 700; padding: 0 20px; }
.xs-btn--grad { background: linear-gradient(90deg, var(--a1), var(--a2)); color: #fff; font-weight: 700; }
.xs-btn--stop { min-height: 44px; color: var(--bad); font-weight: 700; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bad) 55%, transparent); }
.xs[data-theme="light"] .xs-btn--stop { --bad: #b91c1c; }
.xs-btn--small { min-height: 32px; padding: 0 12px; font-size: 12px; }
.xs-icon-btn { width: 40px; min-height: 40px; padding: 0; flex: none; }
.xs-quota { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); min-width: 92px; }
.xs-bar { height: 5px; border-radius: 99px; background: var(--inset); overflow: hidden; }
.xs-bar > span { display: block; height: 100%; width: var(--w, 0%); border-radius: 99px; background: linear-gradient(90deg, var(--a1), var(--a2)); transition: width .3s; }
.xs-welcome { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--tint), transparent 70%); font-size: 13px; }
.xs-welcome > span { flex: 1 1 320px; }

/* body + rail */
.xs-body { display: flex; }
.xs-rail { flex: none; width: 78px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; border-right: 1px solid var(--line); }
.xs-rail-btn { position: relative; width: 64px; min-height: 58px; border-radius: 16px; border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 600; text-align: center; }
.xs-rail-btn[aria-pressed="true"] { background: var(--inset); color: var(--text); }
.xs-rail-btn input[type="file"], .xs-file input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.xs-file { position: relative; }

/* canvas */
.xs-view { position: relative; flex: 1; min-width: 0; height: 780px; overflow: hidden; touch-action: none; background-color: var(--canvas);
  background-image: radial-gradient(circle, var(--dot) var(--dot-r, 1px), transparent calc(var(--dot-r, 1px) + .4px));
  background-size: var(--grid, 22px) var(--grid, 22px); background-position: var(--px, 0) var(--py, 0); }
.xs-view.is-hand { cursor: grab; }
.xs-view.is-panning { cursor: grabbing; }
.xs-plane { position: absolute; left: 0; top: 0; width: 1500px; height: 1120px; transform-origin: 0 0; }
.xs-wires { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.xs-wire { fill: none; stroke: var(--wire); stroke-width: 1.6; }
.xs-wire.is-lit { stroke: url(#xsWireGrad); stroke-width: 2.6; }
.xs-wire-flow { fill: none; stroke: #fff; stroke-width: 3; stroke-dasharray: 4 14; stroke-linecap: round; opacity: 0; }
.xs-wire-flow.is-on { opacity: .9; animation: xsDash .6s linear infinite; }
.xs-node { position: absolute; width: var(--w, 280px); background: var(--node); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); z-index: 2; }
.xs-node.is-sel { border-color: var(--sel); box-shadow: 0 0 0 3px var(--tint), var(--shadow); z-index: 3; }
.xs-node.is-run { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent), 0 0 40px -6px var(--c), var(--shadow); }
.xs-node-head { height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 14px; cursor: grab; user-select: none; touch-action: none; }
.xs-node-title { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xs-cat { width: 8px; height: 8px; border-radius: 99px; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent); flex: none; }
.xs-status { display: inline-flex; align-items: center; justify-content: center; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; line-height: 1.1; color: #0c0d10; background: var(--c); white-space: nowrap; }
.xs-status.is-done { background: var(--ok); }
.xs-status.is-run { animation: xsGlow 1.4s ease-in-out infinite; }
.xs-node-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.xs-port { position: absolute; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--node); background: var(--wire); }
.xs-port.is-lit { background: var(--c); }
.xs-port--out { right: -7px; top: 19px; }
.xs-port--in { left: -7px; top: 19px; }
.xs-inrow { position: relative; height: 26px; display: flex; align-items: center; padding-left: 16px; font-size: 11px; color: var(--muted); }
/* On the card's left edge, where the wire ends (the wire x is the node x); without `left` the dot sat at the row's padding edge, on top of the label. */
.xs-inrow .xs-port { left: -7px; top: 7px; }
.xs-inset { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; background: var(--inset); }
.xs-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.xs-muted { color: var(--muted); font-size: 12px; line-height: 1.45; }
.xs-textarea { width: 100%; resize: none; border: 0; outline: none; background: transparent; font-size: 13px; line-height: 1.55; padding: 0; min-height: 84px; max-height: 420px; overflow-y: auto; }
/* Canvas nodes sit at fixed positions: their text boxes stop growing before they reach the node below. */
.xs-node .xs-textarea { max-height: 220px; }
/* While the editor types or selects in a node's text box it shows all its text above the blocks around it:
   a capped box auto-scrolled to its end within half a second of dragging past its edge (2026-10-16). */
.xs-node .xs-textarea:focus { max-height: none; }
.xs-node:focus-within { z-index: 6; }
/* Dragging across a block never paints its labels blue; text boxes stay selectable. */
.xs-node { user-select: none; -webkit-user-select: none; }
.xs-node :is(input, textarea, [contenteditable="true"]) { user-select: text; -webkit-user-select: text; }
.xs-input { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--inset); padding: 10px 12px; font-size: 13px; }
/* The site's global field styles (white glass) win over class selectors; the id keeps studio fields on the studio theme. */
#view-studio .xs-textarea { background: transparent; color: var(--text); border: 0; box-shadow: none; }
#view-studio .xs-input { background: var(--inset); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
#view-studio .xs-textarea::placeholder, #view-studio .xs-input::placeholder { color: var(--muted); }
.xs-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.xs-chips--row { gap: 4px; }
.xs-chips--row .xs-btn { padding: 0 8px; gap: 4px; flex: none; }
.xs-chips--row .xs-btn .ms { font-size: 16px; }
.xs-chips--row .xs-btn[aria-pressed="true"] { background: var(--pill); color: var(--pill-text); }
.xs-chip { display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 4px; border: 1px solid var(--line); min-height: 32px; padding: 4px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; line-height: 1.2; background: var(--node); color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xs-chip[aria-pressed="true"] { background: var(--pill); color: var(--pill-text); border-color: var(--pill); }
.xs-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
/* batch contents: layout switch, per-content look, alerts */
.xs-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.xs-item { gap: 10px; }
.xs-item-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.xs-item-head > .xs-label, .xs-item-head > b { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xs-icon-btn--sm { width: 30px; min-height: 30px; }
.xs-icon-btn--sm .ms { font-size: 18px; }
.xs-btn--dashed { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line2); color: var(--muted); }
.xs-btn--dashed:hover { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--sel); }
.xs-alert { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 14px; font-size: 12.5px; line-height: 1.45; color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); overflow-wrap: anywhere; }
.xs[data-theme="light"] .xs-alert { color: #b42318; }
.xs-alert .ms { font-size: 18px; flex: none; }
.xs-appear-wrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.xs-appear { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 6px 10px 6px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--node); color: var(--text); font-size: 12.5px; font-weight: 600; text-align: left; }
.xs-appear:hover, .xs-appear[aria-expanded="true"] { border-color: var(--sel); }
.xs-appear-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xs-appear .ms { font-size: 18px; color: var(--muted); }
.xs-appear-dot { display: block; flex: none; width: 24px; height: 24px; border-radius: 8px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.xs-appear-dot.is-inherit, .xs-palette-colors i.is-inherit { background: repeating-linear-gradient(135deg, var(--inset) 0 4px, var(--line2) 4px 5px); }
.xs-appear .xs-palette-colors i { width: 9px; height: 18px; }
.xs-appear-pick { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 14px; background: var(--node); border: 1px solid var(--line); }
.xs-appear-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 4px; }
.xs-appear-styles button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 2px 6px; border: 1.5px solid transparent; border-radius: 12px; background: transparent; font-size: 11px; font-weight: 600; color: var(--muted); line-height: 1.2; text-align: center; }
.xs-appear-styles button .xs-appear-dot { width: 100%; height: 22px; border-radius: 7px; }
.xs-appear-styles button[aria-pressed="true"] { border-color: var(--sel); color: var(--text); }
.xs-appear-pals { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 0 6px; }
.xs-appear-pals button { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; }
.xs-appear-pals button > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xs-appear-pals button .xs-palette-colors i { width: 9px; height: 16px; }
.xs-appear-pals button[aria-pressed="true"] { background: var(--inset); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--sel); }
.xs-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.xs-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.xs-libgrid { max-height: 300px; overflow-y: auto; align-content: start; }
.xs-grid5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.xs-grid5 .xs-chip { padding: 4px 2px; font-size: 11.5px; }
.xs-tile { display: flex; flex-direction: column; gap: 6px; padding: 5px 5px 8px; border-radius: 14px; border: 1.5px solid transparent; background: var(--inset); text-align: left; font-size: 12px; font-weight: 600; }
.xs-tile[aria-pressed="true"] { border-color: var(--sel); }
.xs-swatch { display: block; height: 48px; border-radius: 10px; background: var(--bg); }
.xs-swatch--auto { background: repeating-linear-gradient(135deg, var(--inset) 0 6px, var(--line2) 6px 7px); }
.xs-palette { display: flex; align-items: center; gap: 10px; padding: 4px; min-height: 30px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.xs-palette[aria-pressed="true"] { background: var(--node); color: var(--text); }
.xs-palette-colors { display: flex; border-radius: 6px; overflow: hidden; }
.xs-palette-colors i { display: block; width: 16px; height: 18px; background: var(--bg); }
.xs-thumb { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--inset); }
.xs-thumb img, .xs-hero img, .xs-out img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xs-thumb-x { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; border-radius: 99px; border: 0; background: rgba(0,0,0,.6); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.xs-role { display: inline-flex; align-items: center; justify-content: center; text-align: center; border: 0; min-height: 24px; padding: 2px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; line-height: 1.1; color: #0c0d10; background: var(--c); width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xs-role .ms { font-size: 12px; margin-left: 2px; opacity: .7; }
.xs-drop { position: relative; aspect-ratio: 1 / 1; border-radius: 12px; border: 1.5px dashed var(--line2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 600; text-align: center; }
.xs-drop.is-over, .xs-node.is-over { border-color: var(--a2); }
.xs-hero { position: relative; display: block; border-radius: 16px; overflow: hidden; background: var(--inset); aspect-ratio: var(--ar, 4 / 5); }
.xs-out { position: relative; display: block; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--inset); aspect-ratio: var(--ar, 4 / 5); }
.xs-out[aria-pressed="true"] { outline: 2px solid var(--sel); outline-offset: 2px; }
.xs-badge { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; justify-content: center; text-align: center; padding: 3px 9px; min-height: 20px; border-radius: 999px; font-size: 10px; font-weight: 700; line-height: 1; color: #0c0d10; background: var(--ok); white-space: nowrap; }
.xs-badge.is-fix { background: var(--warn); }
.xs-badge--inline { position: static; align-self: center; }

.xs-badge.is-reject { background: var(--bad); }
.xs-badge.is-run { background: var(--a2); }
.xs-gen { background: linear-gradient(110deg, var(--tint) 15%, rgba(108,140,255,.24) 40%, rgba(43,87,242,.12) 65%, var(--tint) 90%); background-size: 200% 100%; animation: xsShimmer 1.8s linear infinite; }
.xs-crit { display: flex; align-items: center; gap: 10px; font-size: 12px; min-height: 22px; }
.xs-crit i { width: 8px; height: 8px; border-radius: 99px; background: var(--wire); flex: none; }
.xs-crit i.is-ok { background: var(--ok); } .xs-crit i.is-warn { background: var(--warn); } .xs-crit i.is-bad { background: var(--bad); } .xs-crit i.is-run { background: var(--a2); animation: xsGlow 1.2s infinite; }
.xs-crit span:nth-child(2) { flex: 1; }
.xs-progress { height: 4px; border-radius: 99px; background: var(--inset); overflow: hidden; }
.xs-progress > span { display: block; height: 100%; width: var(--w, 0%); background: linear-gradient(90deg, var(--a1), var(--a2)); transition: width .4s; }
.xs-note { font-size: 11px; line-height: 1.4; padding: 6px 10px; border-radius: 10px; background: rgba(245,158,75,.16); }
.xs-sugg { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--inset); font-size: 12px; line-height: 1.5; }
.xs-sugg button { align-self: flex-end; }

/* floating chrome */
.xs-float { position: absolute; z-index: 20; background: var(--float); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.xs-session { right: 12px; top: 12px; width: 240px; padding: 12px; border-radius: 22px; display: flex; flex-direction: column; gap: 10px; }
.xs-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.xs-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; background: var(--inset); }
.xs-stat b { font-family: 'Bricolage Grotesque', sans-serif; font-size: 20px; font-weight: 500; }
.xs-stat span { font-size: 10px; color: var(--muted); }
.xs-pipe { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 14px; background: var(--inset); }
.xs-pipe span { display: flex; align-items: center; gap: 10px; min-height: 24px; font-size: 12px; color: var(--muted); }
.xs-pipe i { width: 12px; height: 12px; border-radius: 99px; border: 1.5px solid var(--line2); flex: none; }
.xs-steps { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.xs-steps span { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 32px; border-radius: 999px; background: var(--inset); font-size: 12px; font-weight: 700; color: var(--muted); }
.xs-steps i { width: 8px; height: 8px; border-radius: 99px; background: var(--line2); }
.xs-steps .is-done { color: var(--text); } .xs-steps .is-done i { background: var(--ok); }
.xs-steps .is-on { color: var(--text); } .xs-steps .is-on i { background: var(--a2); box-shadow: 0 0 0 4px rgba(56,189,248,.3); }
.xs-pipe .is-done { color: var(--text); } .xs-pipe .is-done i { background: var(--text); border-color: var(--text); }
.xs-pipe .is-on { color: var(--text); font-weight: 700; } .xs-pipe .is-on i { border: 3px solid var(--a1); box-shadow: 0 0 0 4px var(--tint); }
.xs-minimap { position: relative; height: 92px; border-radius: 14px; background: var(--inset); overflow: hidden; }
.xs-minimap i { position: absolute; border-radius: 3px; background: var(--c); opacity: .6; }
.xs-minimap b { position: absolute; border: 1.5px solid var(--text); border-radius: 5px; opacity: .6; }
.xs-actionbar { left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 2px; padding: 6px; border-radius: 20px; }
.xs-action { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 72px; min-height: 54px; padding: 6px 8px; border-radius: 14px; border: 0; background: transparent; font-size: 11px; font-weight: 600; white-space: nowrap; }
.xs-action:hover:not(:disabled) { background: var(--inset); }
.xs-session-open { right: 12px; top: 12px; }
.xs-zoom { right: 12px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.xs-round { width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--float); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow); font-size: 10px; font-family: 'JetBrains Mono', monospace; }
.xs-coords { position: absolute; left: 14px; bottom: 18px; z-index: 19; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); pointer-events: none; }
.xs-panel { left: 12px; top: 12px; width: 380px; max-height: calc(100% - 100px); overflow: auto; padding: 18px; border-radius: 24px; display: flex; flex-direction: column; gap: 14px; }
.xs-panel h3 { margin: 0; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 500; font-size: 20px; }
.xs-goal { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; min-height: 52px; border-radius: 14px; border: 0; background: var(--inset); text-align: left; }
.xs-goal[aria-pressed="true"] { background: var(--pill); color: var(--pill-text); }
.xs-goal b { font-size: 13px; }
.xs-goal small { font-size: 10px; opacity: .75; }
.xs-plan { display: flex; gap: 10px; padding: 12px; border-radius: 16px; background: var(--inset); }
.xs-plan i { width: 8px; height: 8px; margin-top: 5px; border-radius: 99px; background: var(--c); flex: none; }
.xs-plan div { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.xs-tline { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.xs-tline i { width: 12px; height: 12px; border-radius: 99px; border: 1.5px solid var(--line2); flex: none; }
.xs-tline.is-done { color: var(--text); } .xs-tline.is-done i { background: var(--ok); border-color: var(--ok); }
.xs-tline.is-on { color: var(--text); font-weight: 700; } .xs-tline.is-on i { border: 3px solid var(--a1); }
.xs-tpl { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 16px; background: var(--inset); }
.xs-tpl .xs-swatch { width: 56px; height: 70px; flex: none; }
.xs-tpl-img { position: relative; overflow: hidden; }
.xs-tpl-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.xs-node .xs-tpl-img { height: 110px; }
.xs-tpl div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 600; }

/* dock */
.xs-dock { border-top: 1px solid var(--line); }
.xs-dock-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; }
.xs-dock-head .xs-seg button { display: inline-flex; align-items: center; gap: 8px; }
.xs-count { min-width: 18px; padding: 1px 6px; border-radius: 999px; font-size: 10px; background: var(--inset); color: var(--text); }
.xs-dock-body { padding: 0 14px 14px; }
/* Dock cards run in one horizontal row so the page never grows tall. */
.xs-cards { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; cursor: grab; }
.xs-cards.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
.xs-cards::-webkit-scrollbar { height: 8px; }
.xs-cards::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 99px; }
.xs-strip-wrap { position: relative; }
.xs-strip-nav { position: absolute; top: calc(50% - 22px); z-index: 2; width: 40px; min-height: 40px; padding: 0; border-radius: 999px; border: 1px solid var(--line); background: var(--float); color: var(--text); box-shadow: var(--shadow); display: inline-flex; align-items: center; justify-content: center; }
.xs-strip-nav[data-dir="-1"] { left: -6px; } .xs-strip-nav[data-dir="1"] { right: -6px; }
.xs-strip-nav[hidden] { display: none; }
.xs-cards > * { flex: 0 0 300px; scroll-snap-align: start; }
.xs-cards.xs-cards--wide > * { flex-basis: 380px; }
.xs-pre { margin: 0; white-space: pre-wrap; font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.5; max-height: 240px; overflow: auto; }
details.xs-inset > summary { cursor: pointer; list-style: none; }
/* "Lấy nội dung từ bài viết": one quiet row until opened */
.xs-article { min-width: 0; border-radius: 14px; border: 1px dashed var(--line2); overflow-wrap: anywhere; }
.xs-article[open] { border-style: solid; border-color: var(--line); background: var(--inset); }
.xs-article > summary { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 10px 0 12px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: var(--muted); }
.xs-article > summary::-webkit-details-marker { display: none; }
.xs-article > summary:hover, .xs-article[open] > summary { color: var(--text); }
.xs-article > summary .ms { font-size: 18px; }
.xs-article-title { flex: 1 1 auto; }
.xs-article-chev { transition: transform .2s; }
.xs-article[open] .xs-article-chev { transform: rotate(180deg); }
.xs-article-body { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; }
.xs-article-body .xs-input { background: var(--node); }
.xs-article-body .xs-textarea { min-height: 0; }
.xs-article-body > .xs-btn { align-self: flex-start; }
.xs-article-body > .xs-btn--primary { align-self: stretch; }
.xs-article-plan { font-size: 13px; }
.xs-article-item { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: var(--node); border: 1px solid var(--line); }
.xs-article-check { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.xs-article-check input { width: 16px; height: 16px; accent-color: var(--sel); flex: none; }
.xs-article-src > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.xs-article-src p { margin: 6px 0 0; }
.xs-article-origin { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.xs-article-origin .ms { font-size: 16px; }
.xs-article-origin a { color: var(--sel); text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
details.xs-inset > summary::-webkit-details-marker { display: none; }
.xs-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 20px; background: var(--node); border: 1px solid var(--line); font-size: 12px; line-height: 1.5; }
.xs-card h4 { margin: 0; font-size: 14px; line-height: 1.35; }
.xs-card--read { background: linear-gradient(135deg, var(--tint), transparent); flex-direction: row; }
.xs-card--read .xs-thumb { width: 64px; flex: none; }
.xs-tag { align-self: flex-start; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; background: var(--inset); box-shadow: inset 3px 0 0 var(--c); }
.xs-qcard { display: flex; gap: 12px; padding: 12px; border-radius: 20px; background: var(--node); border: 1px solid var(--line); }
.xs-qcard .xs-out { width: 110px; flex: none; align-self: flex-start; }
.xs-qcard { text-align: left; color: var(--text); }
.xs-qcard > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.45; }
.xs-score { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 300; font-size: 30px; line-height: 1; margin-left: auto; }
.xs-bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; }
.xs-bars i { display: block; height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--c) var(--w), var(--inset) var(--w)); }
.xs-log { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; padding: 12px 14px; border-radius: 16px; background: var(--inset); font-family: 'JetBrains Mono', monospace; font-size: 12px; line-height: 1.6; }
.xs-log span { display: flex; gap: 10px; } .xs-log time { color: var(--muted); flex: none; }
.xs-log .is-ok { color: var(--ok); } .xs-log .is-warn { color: var(--warn); } .xs-log .is-muted { color: var(--muted); }

/* guide + tour */
.xs-scrim { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; background: rgba(5,6,10,.45); z-index: 40; cursor: default; }
.xs-guide { right: 14px; top: 14px; width: min(420px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow: auto; z-index: 41; padding: 20px; border-radius: 26px; background: var(--node); display: flex; flex-direction: column; gap: 12px; }
.xs-guide h3 { margin: 0; flex: 1; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 500; font-size: 24px; }
/* team watermarks */
.xs-wm-chip { display: inline-flex; align-items: center; gap: 6px; }
.xs-wm-chip img { height: 18px; width: auto; max-width: 64px; object-fit: contain; }
.xs-wm-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 18px; background: var(--inset); }
.xs-wm-previews { display: flex; flex-direction: column; gap: 6px; flex: none; }
.xs-wm-prev { display: flex; align-items: center; justify-content: center; width: 120px; height: 44px; border-radius: 10px; border: 1px solid var(--line); padding: 6px; }
.xs-wm-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.xs-wm-prev--light { background: #F4F5F8; }
.xs-wm-prev--dark { background: #1B1F2A; }
.xs-wm-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.xs-wm .xs-input { width: 100%; }
.xs-wm-ghost { position: absolute; z-index: 3; display: flex; align-items: center; justify-content: center; padding: 2px; border: 2px dashed var(--warn); border-radius: 6px; background: rgba(245,158,75,.14); pointer-events: none; }
.xs-wm-ghost img { width: 100%; height: 100%; object-fit: contain; opacity: .85; }
.xs-chapter { border-radius: 18px; background: var(--inset); overflow: hidden; }
.xs-chapter > button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px; min-height: 50px; border: 0; background: transparent; text-align: left; font-weight: 700; font-size: 14px; }
.xs-chapter > button b { width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; background: var(--node); flex: none; }
.xs-chapter > button span { flex: 1; }
.xs-chapter ul { margin: 0; padding: 0 14px 14px 52px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.55; }
.xs-tour { left: 50%; top: 140px; transform: translateX(-50%); width: min(440px, calc(100% - 32px)); z-index: 45; padding: 18px; border-radius: 24px; background: var(--node); display: flex; flex-direction: column; gap: 10px; }
.xs-tour-num { width: 26px; height: 26px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--a1); flex: none; }
.xs-ping { position: absolute; z-index: 30; animation: xsPing 1.4s ease-out infinite; }

/* review + text sub-pages */
.xs-page { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px; align-items: flex-start; }
.xs-page-main { flex: 3 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.xs-page-side { flex: 2 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.xs-box { padding: 16px; border-radius: 24px; background: var(--node); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.xs-box h3 { margin: 0; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 500; font-size: 19px; }
.xs-stage { position: relative; border-radius: 20px; overflow: hidden; background: var(--inset); aspect-ratio: var(--ar, 4 / 5); max-height: 720px; margin: 0 auto; width: 100%; max-width: calc(720px * var(--arn, .8)); }
.xs-stage > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.xs-region { position: absolute; border: 2.5px dashed var(--warn); border-radius: 10px; background: rgba(245,158,75,.12); z-index: 2; pointer-events: auto; }
.xs-region b { position: absolute; left: 6px; top: 6px; width: 24px; height: 24px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #0c0d10; background: var(--warn); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.xs-region.is-minor { border-color: #facc15; } .xs-region.is-minor b { background: #facc15; }
.xs-verdict { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 26px; color: #fff; background: linear-gradient(135deg, #17804f, #22a06b 55%, #3e6bff); }
.xs-verdict.is-fix { background: linear-gradient(135deg, #c25e24, #e07a3f 50%, #b83a74); }
.xs-verdict.is-reject { background: linear-gradient(135deg, #8f1d1d, #c42b30 55%, #6a1b4d); }
.xs-verdict big { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 300; font-size: 76px; line-height: .9; }
.xs-q { display: flex; gap: 10px; align-items: center; min-height: 42px; padding: 8px 12px; border-radius: 14px; background: var(--inset); font-size: 13px; line-height: 1.35; }
.xs-q.is-sub { margin-left: 16px; }
.xs-q.is-no { background: rgba(229,72,77,.12); box-shadow: inset 0 0 0 1px rgba(229,72,77,.35); }
.xs-q b { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 24px; padding: 0 10px; border-radius: 999px; text-align: center; font-size: 11px; font-weight: 700; line-height: 1; color: #fff; background: #17804f; flex: none; white-space: nowrap; }
.xs-q.is-no b { background: #c42b30; }
.xs-q span { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; overflow-wrap: anywhere; }
.xs-product-audit .xs-q { flex-wrap: wrap; }
.xs-product-audit .xs-q span { flex-basis: 130px; }
.xs-subject-integrity .xs-q { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: start; }
.xs-subject-integrity .xs-q b { justify-self: start; }
.xs-subject-integrity .xs-q p { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) { .xs-product-audit .xs-grid2 { grid-template-columns: 1fr; } }
.xs-issue { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; background: var(--inset); font-size: 12px; line-height: 1.5; }
.xs-issue header { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.xs-issue header b { width: 24px; height: 24px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #0c0d10; background: var(--warn); flex: none; }
.xs-issue.is-closed { opacity: .7; }
.xs-strip { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 16px 0; }
.xs-strip .xs-out { width: 84px; }
.xs-tl-stage { position: relative; border-radius: 20px; overflow: hidden; background: var(--inset); width: 100%; aspect-ratio: var(--ar, 4 / 5); max-width: calc(720px * var(--arn, .8)); margin: 0 auto; }
.xs-tl-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.xs-tl-box { position: absolute; border: 1.5px dashed transparent; border-radius: 6px; cursor: pointer; background: transparent; padding: 0; }
.xs-tl-box.is-sel, .xs-tl-box:hover { border-color: var(--a2); }
.xs-font { display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 52px; border-radius: 14px; border: 0; background: transparent; box-shadow: inset 0 0 0 1px var(--line); text-align: left; }
.xs-font[aria-pressed="true"] { background: var(--inset); box-shadow: inset 0 0 0 1.5px var(--sel); }
.xs-font-sample { width: 96px; flex: none; font-size: 22px; white-space: nowrap; overflow: hidden; }
.xs-font span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; }
.xs-color { width: 36px; height: 36px; border-radius: 999px; border: 0; background: var(--bg); box-shadow: 0 0 0 2px var(--node), 0 0 0 3px var(--line); }
.xs-color[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--node), 0 0 0 4px var(--sel); }
.xs-empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.6; }

@keyframes xsShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes xsDash { to { stroke-dashoffset: -36; } }
@keyframes xsGlow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes xsPing { 0% { box-shadow: 0 0 0 0 rgba(139,108,246,.6); } 100% { box-shadow: 0 0 0 12px rgba(139,108,246,0); } }
@keyframes xsIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.xs-in { animation: xsIn .45s cubic-bezier(.2,.7,.2,1); }
@media (prefers-reduced-motion: reduce) { .xs-gen, .xs-wire-flow.is-on, .xs-status.is-run, .xs-ping, .xs-in, .xs-crit i.is-run { animation: none; } }
@media (max-width: 900px) {
  .xs-rail { width: 60px; } .xs-rail-btn { width: 52px; font-size: 10px; }
  .xs-session, .xs-coords { display: none; }
  .xs-panel { width: calc(100% - 24px); }
  .xs-actionbar { max-width: calc(100% - 24px); overflow-x: auto; }
}

/* Kho mẫu + Làm giống mẫu pages */
.xs-seg-link { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; }
.xs-seg-link[aria-current="page"] { background: var(--pill); color: var(--pill-text); }
.xs-hero-band { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; padding: 22px 20px 6px; }
.xs-hero-band h2 { margin: 4px 0 6px; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 500; font-size: 30px; line-height: 1.15; }
.xs-search { flex: 0 1 380px; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 14px; border-radius: 999px; background: var(--inset); border: 1px solid var(--line); }
#view-studio .xs-search .xs-input { border: 0; background: transparent; padding-left: 0; }
.xs-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 20px 0; }
.xs-filters .xs-chip, .xs-crawler-controls .xs-chip { border: 1px solid var(--line); background: var(--node); color: var(--text); min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.xs-filters .xs-chip[aria-pressed="true"], .xs-crawler-controls .xs-chip[aria-pressed="true"] { background: var(--pill); color: var(--pill-text); border-color: var(--pill); }
.xs-masonry { columns: 3 220px; column-gap: 14px; }
.xs-mcard { break-inside: avoid; margin: 0 0 14px; padding: 8px; border-radius: 22px; background: var(--node); border: 2px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.xs-mcard.is-sel { border-color: var(--sel); box-shadow: 0 0 0 3px var(--tint); }
.xs-mcard-img { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 16px; overflow: hidden; aspect-ratio: var(--ar, 4 / 5); background: var(--bg, var(--inset)); }
.xs-mcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.xs-mcard-img:hover img { transform: scale(1.03); }
.xs-mcard-body { display: flex; flex-direction: column; gap: 4px; padding: 2px 6px 6px; font-size: 13px; }
.xs-mcard-body .xs-btn { align-self: flex-start; margin-top: 4px; }
.xs-btn--danger { color: var(--bad); }
.xs-btn--danger:hover { border-color: var(--bad); }
.xs-recipe { position: sticky; top: 12px; }
.xs-recipe-img { display: block; width: 100%; max-height: 420px; aspect-ratio: var(--ar, 4 / 5); border-radius: 18px; overflow: hidden; background: var(--bg, var(--inset)); }
.xs-recipe-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xs-spec { display: grid; grid-template-columns: 92px 1fr; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--inset); font-size: 13px; }
.xs-swatches { display: flex; gap: 6px; }
.xs-swatches i { flex: 1; height: 34px; border-radius: 10px; background: var(--c); border: 1px solid var(--line); }
.xs-page--rep { align-items: flex-start; }
.xs-rep-steps { flex: 1 1 300px; max-width: 360px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.xs-content-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (max-width: 1099px) {
  .xs-rep-steps { width: 100%; max-width: none; flex: none; }
}
@media (min-width: 1100px) {
  .xs-rep-steps { flex: 1 1 380px; max-width: 420px; }
}
.xs-step { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.xs-step b { width: 24px; height: 24px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: var(--pill-text); background: var(--pill); }
.xs-rep-tpl { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.xs-rep-tpl .xs-thumb { width: 64px; flex: none; }
.xs-rep-tpl div { display: flex; flex-direction: column; gap: 3px; }
.xs-btn--big { min-height: 52px; font-size: 15px; border-radius: 16px; }
.xs-cmp { position: relative; width: 100%; max-height: 640px; aspect-ratio: var(--ar, 4 / 5); border-radius: 18px; overflow: hidden; background: var(--inset); }
.xs-cmp-after, .xs-cmp-before, .xs-cmp-before img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.xs-cmp-before { background: var(--bg, var(--inset)); }
.xs-cmp-after ~ .xs-cmp-before, .xs-cmp .xs-gen ~ .xs-cmp-before { clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0); }
.xs-cmp-bar { position: absolute; top: 0; bottom: 0; left: calc(var(--split, 50%) - 2px); width: 4px; background: #fff; box-shadow: 0 0 12px rgba(0,0,0,.35); pointer-events: none; }
.xs-cmp-tag { left: 10px; top: 10px; }
.xs-cmp + label input[type="range"] { flex: 1; accent-color: var(--sel); }
.xs-out--mini { width: 76px; }
.xs-out--mini[aria-pressed="true"] { outline: 3px solid var(--sel); outline-offset: 2px; }
.xs-chain { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--node); color: var(--text); text-align: left; font-size: 13px; }
.xs-chain.is-sel { border-color: var(--sel); background: var(--inset); }
.xs-chain .xs-thumb { width: 44px; flex: none; }
.xs-chain > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.xs-copy { display: flex; flex-direction: column; gap: 3px; }
.xs-copy .xs-input { padding: 7px 10px; font-size: 12px; }

/* 2026-10-13: readable critique on the coloured verdict card, more references, product groups. */
.xs-verdict .xs-muted, .xs-verdict-row { color: rgba(255,255,255,.94); font-size: 12.5px; line-height: 1.5; }
.xs-verdict-row b { color: #fff; font-weight: 700; }
.xs-verdict span { text-shadow: 0 1px 2px rgba(0,0,0,.18); }
.xs-refgrid { max-height: 300px; overflow-y: auto; padding-right: 2px; }
.xs-pgroup { gap: 6px; }
.xs-pgroup .xs-input { min-height: 32px; font-weight: 700; }
.xs-sugg { max-height: 240px; overflow-y: auto; }
.xs-lightbox { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(920px, calc(100% - 32px)); max-height: calc(100% - 48px); overflow: auto; z-index: 41; padding: 20px; border-radius: 26px; background: var(--node); display: flex; flex-direction: column; gap: 14px; }
.xs-lightbox h3 { margin: 0; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 500; font-size: 22px; }
.xs-lightbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.xs-lightbox-grid figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.xs-lightbox-grid .xs-thumb { aspect-ratio: 1 / 1; }
.xs-lightbox-grid figcaption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 2026-10-14: Template Crawler Band & Multi-Agent Canva Studio (#/studio/canvas) */
.xs-crawler-box { margin: 12px 20px 4px; padding: 16px 18px; border-radius: 22px; border: 2px solid var(--sel); background: var(--node); display: flex; flex-direction: column; gap: 12px; }
.xs-crawler-controls { display: flex; flex-direction: column; gap: 10px; }


.xs-content-audit p { overflow-wrap: anywhere; }

/* Result blocks: one per content of a batch. A waiting or finished frame stays still; only drawing shimmers. */
.xs-wait { background: var(--inset); box-shadow: inset 0 0 0 1px var(--line2); }
.xs-out-title { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xs-out-status { font-size: 12px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.xs-out-status.is-error { color: var(--text); font-weight: 600; }

/* Review page: reference photo rows, fact check rows, named score deductions (2026-10-16 redesign). */
.xs-ref-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 16px; background: var(--inset); min-width: 0; }
.xs-ref-thumb { flex: none; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--node); border: 1px solid var(--line); }
.xs-ref-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.xs-ref-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.xs-ref-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.xs-ref-title b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xs-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; flex: none; color: #fff; background: #17804f; }
.xs-pill.is-unk { color: #1d1d1f; background: var(--warn); }
.xs-pill.is-no { background: #c42b30; }
.xs-marks { display: flex; flex-wrap: wrap; gap: 6px; }
.xs-mark { max-width: 100%; padding: 3px 9px; border-radius: 999px; font-size: 11px; background: var(--node); border: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xs-fold { font-size: 12px; }
.xs-fold > summary { min-height: 32px; display: flex; align-items: center; color: var(--muted); font-weight: 600; }
.xs-fold p { margin: 6px 0; line-height: 1.5; overflow-wrap: anywhere; }
.xs-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 6px 0 0; }
.xs-dl dt { color: var(--muted); font-weight: 600; }
.xs-dl dd { margin: 0; overflow-wrap: anywhere; line-height: 1.45; }
.xs-q.is-unk { background: var(--inset); box-shadow: inset 0 0 0 1px var(--line2); }
.xs-q.is-unk b { color: #1d1d1f; background: var(--warn); }
.xs-q small { display: block; font-size: 12px; color: var(--muted); }
.xs-src { flex: none; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); text-decoration: none; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.xs-src:hover { color: var(--text); text-decoration: underline; }
.xs-src .ms { font-size: 14px; }
.xs-deduct { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 1.4; }
.xs-deduct li { display: flex; gap: 6px; color: var(--text); overflow-wrap: anywhere; }
.xs-deduct li::before { content: '−'; flex: none; font-weight: 700; color: #c42b30; }
.xs-deduct-one { margin: 0; font-size: 12px; line-height: 1.4; color: var(--text); overflow-wrap: anywhere; }
