/* AI Studio: shell, hub and the shared UI kit. Layout only; every look is a DS class or token. */
[hidden] { display: none !important; }
html { font-synthesis-weight: none; }
body { margin: 0; font: var(--body-md); color: var(--type-primary); background: var(--neutral-25); -webkit-font-smoothing: antialiased; overflow-x: clip; }
body *, body *::before, body *::after { box-sizing: border-box; }
h1, h2, h3, h4, p, ol, ul { margin: 0; }
ul, ol { padding: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tnum { font-variant-numeric: tabular-nums; }

/* WP chrome (scaffolding, not product UI) */
.nuf-wp-bar, .nuf-wp-side { position: fixed; background: #1E1E1E; font-family: Helvetica, Arial, sans-serif; }
.nuf-wp-bar { left: 0; top: 0; width: 100%; height: 32px; z-index: 50; }
.nuf-wp-side { left: 0; top: 0; bottom: 0; width: 160px; z-index: 40; }
.nuf-wp-active { position: absolute; left: 0; top: 226px; width: 160px; height: 34px; background: var(--button-primary); }
.nuf-wp-ico { position: absolute; display: block; max-width: none; }
.nuf-wp-lbl { position: absolute; font-size: 14px; line-height: 21px; color: var(--neutral-white); white-space: nowrap; }
.nuf-wp-lbl--on { font-weight: 500; }
.p-wp-toggle, .p-wp-scrim { display: none !important; }
main.pgm { margin: 32px 0 0 160px; min-height: calc(100vh - 32px); display: flex; flex-direction: column; }
#app { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.view { flex: 1; display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 782px) {
  .nuf-wp-side { display: none; }
  main.pgm { margin-left: 0; }
  .ds-topnav { padding-inline: 16px; }
  .ds-topnav-tabs { display: none; }
  .ds-topnav-logo img { width: 140px; height: auto; }
}

/* ---- field and row kit ---- */
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f .ds-select { width: 100%; }
.f__opt { color: var(--type-tertiary); font-weight: 400; }
.r { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; min-width: 0; }
.rs { display: grid; }
.rs > .r + .r { border-top: 1px solid var(--stroke-tertiary); }
.r__t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.r__l { font: var(--body-md); color: var(--type-primary); }
.r__h { font: var(--body-sm); color: var(--type-secondary); }
.r__c { display: flex; align-items: center; gap: 12px; flex: none; }
.r__c .ds-select { min-width: 150px; }
.k { display: inline-flex; align-items: flex-start; gap: 8px; font: var(--body-md); color: var(--type-primary); cursor: pointer; }
.k .ds-check { margin-top: 1px; flex: none; }
.k__u { display: block; font: var(--body-sm); color: var(--type-secondary); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lockl { display: flex; align-items: flex-start; gap: 8px; font: var(--body-sm); color: var(--type-secondary); }
.lockl .fa { margin-top: 2px; }
.ds-select .arrow .fa { font-size: 14px; }

/* ---- Flow pill ---- */
.fpill { position: fixed; left: 12px; bottom: 12px; z-index: 3000; }
.fpill__b { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; border-radius: var(--radius-full); background: var(--neutral-600); color: var(--neutral-white); font: var(--btn-sm); cursor: pointer; box-shadow: var(--shadow-modal); }
.fpill__b:focus-visible, .fpill__l button:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: 2px; }
.fpill__l { position: absolute; left: 0; bottom: 44px; width: 264px; max-height: 70vh; overflow: auto; padding: 6px; background: var(--neutral-600); border-radius: var(--radius-12); box-shadow: var(--shadow-modal); animation: m-pop var(--m-fast) var(--m-ease) both; transform-origin: bottom left; }
.fpill__l ul { list-style: none; }
.fpill__g { padding: 8px 10px 2px; font: var(--btn-sm); color: var(--brand-50); text-transform: none; }
.fpill__l button { display: block; width: 100%; padding: 6px 10px; border: 0; border-radius: var(--radius-8); background: transparent; color: var(--neutral-white); font: var(--body-md); text-align: left; cursor: pointer; }
.fpill__l button:hover { background: rgba(255, 255, 255, .16); }
.toast { z-index: 2100; }
.toast .undo { margin-left: 4px; }

/* ---- dialog ---- */
.ais-modal { animation: m-fade var(--m-fast) var(--m-ease) both; z-index: 2050; }
.ais-modal .tpldialog { animation: m-pop var(--m-base) var(--m-ease) both; max-width: calc(100vw - 32px); }
.ais-modal.is-out { opacity: 0; transition: opacity var(--m-fast) var(--m-exit); pointer-events: none; }
.mo__p { font: var(--body-md); color: var(--type-secondary); }
.mo__l { list-style: none; display: grid; gap: 10px; margin: 12px 0; }
.mo__l li { display: grid; grid-template-columns: 84px 1fr; gap: 12px; font: var(--body-md); } .mo__l b { font-weight: 500; } .mo__l span { color: var(--type-secondary); }

/* ---- sheet: right drawer, bottom sheet at 390 ---- */
.ais-sheet { position: fixed; inset: 0; z-index: 2040; pointer-events: none; }
.ais-sheet__s { position: absolute; inset: 0; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity var(--m-base) var(--m-ease); pointer-events: auto; }
.ais-sheet__p { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); display: flex; flex-direction: column; background: var(--surface-screen); box-shadow: var(--shadow-modal); transform: translateX(100%); transition: transform var(--m-slow) var(--m-ease); pointer-events: auto; outline: none; }
.ais-sheet.is-open .ais-sheet__s { opacity: 1; } .ais-sheet.is-open .ais-sheet__p { transform: none; }
.ais-sheet__h { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 16px 24px; border-bottom: 1px solid var(--stroke-tertiary); font: var(--heading-sm); }
.ais-sheet__b { flex: 1; overflow: auto; padding: 24px; display: grid; gap: 16px; align-content: start; }
.ais-sheet .grab { display: none; }
@media (max-width: 600px) {
  .ais-sheet__p { top: auto; width: 100%; max-height: 86vh; border-radius: var(--radius-16) var(--radius-16) 0 0; transform: translateY(100%); }
  .ais-sheet .grab { display: block; width: 36px; height: 4px; margin: 8px auto 0; border-radius: var(--radius-full); background: var(--stroke-secondary); }
}

/* ---- placeholder ---- */
.ph { margin: 80px auto; max-width: 480px; display: grid; justify-items: center; gap: 12px; padding: 0 16px; text-align: center; }
.ph .icotile { --icotile-size: 44px; } .ph__t { font: var(--heading-lg); } .ph__s { color: var(--type-secondary); }

/* ---- HUB ---- */
.hub { width: 100%; max-width: 1500px; margin: 0 auto; padding: 48px 40px 96px; display: grid; gap: 48px; }
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.hero__x { display: grid; gap: 20px; align-content: center; justify-items: start; }
.hero__e { display: inline-flex; align-items: center; gap: 8px; font: var(--btn-sm); color: var(--brand-300); }
.hero__t { font: 500 40px/1.15 var(--font); letter-spacing: -.01em; color: var(--type-primary); }
.hero__p { font: var(--body-lg); color: var(--type-secondary); max-width: 46ch; }
.hero__a { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.hero__s { font: var(--body-sm); color: var(--type-secondary); }
.choose { display: grid; gap: 10px; width: 100%; max-width: 440px; }
.choose__l { font: var(--btn-sm); color: var(--type-secondary); }
.choose a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--stroke-secondary); border-radius: var(--radius-12); background: var(--surface-screen); color: inherit; text-decoration: none; transition: border-color var(--m-fast) var(--m-ease), transform var(--m-fast) var(--m-ease); }
.choose a:hover { border-color: var(--brand-100); transform: translateY(-1px); }
.choose a:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: var(--focus-ring-offset); }
.choose b { font-weight: 500; display: block; } .choose small { font: var(--body-sm); color: var(--type-secondary); }
.choose .icotile { --icotile-size: 36px; flex: none; }
.choose .fa-arrow-right { margin-left: auto; color: var(--type-tertiary); }

/* loop diagram */
.loop { position: relative; height: 440px; max-width: 640px; width: 100%; justify-self: end; }
.loop__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.loop__path { fill: none; stroke: var(--stroke-secondary); stroke-width: 1.5; stroke-dasharray: 2 6; stroke-linecap: round; }
.loop__dot { fill: var(--brand-100); }
.node { position: absolute; width: 38%; min-height: 170px; display: grid; gap: 4px; align-content: start; padding: 16px; border-radius: var(--radius-12); background: var(--surface-screen); border: 1px solid var(--stroke-tertiary); box-shadow: var(--shadow-card); color: inherit; text-decoration: none; transition: transform var(--m-base) var(--m-ease), box-shadow var(--m-base) var(--m-ease); }
.node:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.node:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: var(--focus-ring-offset); }
.node--find { left: 0; top: 0; } .node--cap { right: 0; top: 0; } .node--show { right: 0; bottom: 0; } .node--gap { left: 0; bottom: 0; }
.node__h { display: flex; align-items: center; gap: 10px; }
.node .icotile { --icotile-size: 32px; flex: none; }
.node__k { font: var(--btn-sm); color: var(--type-secondary); }
.node__v { font: 500 26px/1.2 var(--font); color: var(--type-primary); }
.node__c { font: var(--body-sm); color: var(--type-secondary); }
.node.is-off { background: var(--neutral-25); border: 1.5px dashed var(--stroke-primary); box-shadow: none; }
.node.is-off .icotile { background: var(--surface-overlay-1); color: var(--type-tertiary); }
.node.is-off .node__v { font-size: 18px; color: var(--type-secondary); }
.node__go { margin-top: 6px; font: var(--btn-sm); color: var(--button-primary); display: inline-flex; gap: 6px; align-items: center; }

.hub__below { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; }
.nba { align-self: start; display: grid; gap: 12px; padding: 24px; border-radius: var(--radius-16); background: var(--surface-screen); border: 1px solid var(--stroke-tertiary); box-shadow: var(--shadow-card); align-content: start; }
.nba__k { font: var(--btn-sm); color: var(--brand-300); }
.nba__t { font: var(--heading-md); }
.nba__p { color: var(--type-secondary); }
.nba .btn-wp, .nba .btn-wpo { justify-self: start; margin-top: 4px; }
.act-h { font: var(--heading-sm); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.tl { list-style: none; display: grid; position: relative; }
.tl li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; position: relative; }
.tl li::before { content: ""; position: absolute; left: 13px; top: 36px; bottom: -10px; width: 1px; background: var(--stroke-tertiary); }
.tl li:last-child::before { display: none; }
.tl__i { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radius-full); background: var(--brand-10); color: var(--brand-300); font-size: 12px; }
.tl__t { font: var(--body-md); } .tl__s { font: var(--body-sm); color: var(--type-secondary); }
.tl__w { font: var(--body-sm); color: var(--type-tertiary); white-space: nowrap; }
.empty-tl { padding: 20px; border: 1.5px dashed var(--stroke-secondary); border-radius: var(--radius-12); color: var(--type-secondary); }

@media (max-width: 1100px) {
  .hub { padding: 32px 24px 96px; gap: 32px; }
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .loop { justify-self: center; }
  .hub__below { grid-template-columns: 1fr; gap: 32px; }
  .hero__t { font-size: 34px; }
}
@media (max-width: 600px) {
  .hub { padding: 24px 16px 96px; }
  .hero__t { font-size: 30px; }
  .loop { height: auto; display: grid; gap: 12px; }
  .loop__svg { display: none; }
  .node { position: relative; width: 100%; min-height: 0; inset: auto; }
  .node + .node::before { content: ""; position: absolute; left: 31px; top: -13px; height: 12px; border-left: 1.5px dotted var(--stroke-primary); }
}
