/* Workflows (workflows.html, app/workflow.html). Same world as AI News and the Radar: their tokens, type and components
   (app.css, news.css). Its own parts, from the design canvas (B and C together, Spoorthi, 2026-09-26): the run frame
   (our run's screenshot leads every workflow), the folder line (the top of the folder you get), the file tree, the
   file sheet, the full-size run viewer and the story form. No verdicts, no kickers, no shadows on cards. */

.wf-app { --side-w: 0px; }
.wf-col { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); }
.wf-head .nx-actions { display: flex; align-items: center; gap: 2px; }
.wf-sub { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.wf-tabs { margin-top: 18px; }
.wf-list { display: grid; gap: 14px; margin-top: 14px; }
.wf-sec { display: none; }
.wf-sec h2 { margin: 0; font: 600 28px/1.12 var(--sans); }

/* our run: a screenshot, or (before a run exists, in previews only) a plain frame that says so */
.wf-shot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: top left; background: var(--code-bg); }
.wf-shot.none { display: flex; align-items: center; justify-content: center; color: #CFC3B9; font-size: 13px; }
.wf-runline { font-size: 13.5px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.wf-runline b { font-weight: 600; color: var(--ink); }

/* one workflow in the list (a phone, a tablet): our run on top, what it showed, the name, the folder, time and Free */
.wf-card { display: grid; border-radius: var(--r-lg); background: var(--sheet); box-shadow: 0 0 0 1px var(--line); overflow: hidden; color: var(--ink); text-decoration: none; transition: box-shadow .15s; }
.wf-card:hover { box-shadow: 0 0 0 1px var(--line-strong); }
.wf-card:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.wf-card .bd { display: grid; gap: 10px; padding: 16px 20px 20px; border-top: 1px solid var(--line); }
.wf-card h3, .wf-row h3 { margin: 0; font: 600 20px/1.12 var(--sans); text-wrap: balance; }
.wf-ft { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wf-ft > .ico { width: 20px; height: 20px; color: var(--accent); }
.wf-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.wf-pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--sand-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.wf-pill .ico { width: 13px; height: 13px; }
.wf-pill.free { background: var(--peach-soft); box-shadow: none; color: var(--accent-ink); }

/* the top of the folder you get, in one line */
.wf-folder { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 9px 12px; border-radius: var(--r-md); background: var(--sand-2); box-shadow: inset 0 0 0 1px var(--line); }
.wf-folder span { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; white-space: nowrap; min-width: 0; }
.wf-folder .ico { width: 15px; height: 15px; color: var(--muted); }
.wf-folder .dir .ico { color: var(--accent-ink); }
.wf-folder code, .wf-tree code { font: 400 12.5px/1.3 var(--mono); }
.wf-folder small { font-size: 12px; color: var(--faint); }

/* a computer: each workflow is one row: our run, the name, the folder */
.wf-rows { border-radius: var(--r-lg); background: var(--sheet); box-shadow: 0 0 0 1px var(--line); overflow: hidden; margin-top: 14px; }
.wf-row { display: grid; grid-template-columns: 260px minmax(0, 1fr) 280px 24px; gap: 32px; align-items: center; padding: 24px 28px; color: var(--ink); text-decoration: none; }
.wf-row + .wf-row { border-top: 1px solid var(--line); }
.wf-row .wf-shot { border-radius: var(--r-md); }
.wf-row .tx { display: grid; gap: 10px; min-width: 0; }
.wf-row h3 { font-size: 24px; line-height: 1.12; }
.wf-row:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.wf-row > .ico { width: 20px; height: 20px; color: var(--accent); }

/* the file tree: the folder as you'll have it in your project */
.wf-tree { padding: 8px 12px; border-radius: var(--r-md); background: var(--sand-2); box-shadow: inset 0 0 0 1px var(--line); }
.wf-tree ul { list-style: none; margin: 0; padding: 0; }
.wf-tree ul ul { margin-left: 8px; padding-left: 13px; border-left: 1px solid var(--line-strong); }
.wf-tree li > span, .wf-tree .f { display: flex; align-items: center; gap: 8px; min-height: 26px; min-width: 0; }
.wf-tree .ico { width: 15px; height: 15px; color: var(--muted); }
.wf-tree .d > span .ico { color: var(--accent-ink); }
.wf-tree small { font-size: 12px; color: var(--faint); }
.wf-tree code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the full tree on a workflow's page: each file opens, with what it does */
.wf-files { padding: 6px 16px; border-radius: 16px; background: var(--sheet); box-shadow: 0 0 0 1px var(--line); }
.wf-files ul { list-style: none; margin: 0; padding: 0; }
.wf-files ul ul { margin-left: 8px; padding-left: 13px; border-left: 1px solid var(--line-strong); }
.wf-files .d > span { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.wf-files .d > span .ico { width: 17px; height: 17px; color: var(--accent-ink); }
.wf-files .d > span code { font: 400 13px/1.3 var(--mono); }
.wf-files .f { display: grid; grid-template-columns: 17px minmax(0, 1fr) 16px; align-items: center; gap: 8px; width: 100%; min-height: 52px; padding: 7px 0; border: 0; background: transparent; color: var(--ink); text-align: left; font: inherit; }
.wf-files button.f { cursor: pointer; border-radius: 8px; }
.wf-files button.f:hover code { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.wf-files .f > .ico { width: 17px; height: 17px; color: var(--muted); }
.wf-files .f > .ico:last-child { width: 16px; height: 16px; color: var(--faint); }
.wf-files .f > span { display: grid; min-width: 0; }
.wf-files .f code { font: 500 13px/1.35 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-files .f small { font-size: 12.5px; line-height: 1.35; color: var(--faint); }

/* one workflow's page */
.wf-item-col .st-bar { margin-bottom: 4px; }
.wf-page { display: grid; gap: 28px; }
.wf-aside { display: none; }
.wf-run { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 8px 0 0; } /* one column the width of the page: an auto one took the screenshots' own width and pushed a 320px phone 61px sideways (5 Oct) */
.wf-track { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); scrollbar-width: none; }
.wf-track::-webkit-scrollbar { display: none; }
.wf-track button { display: block; padding: 0; border: 0; background: var(--code-bg); scroll-snap-align: start; cursor: zoom-in; }
.wf-track button:focus-visible { outline-offset: -3px; }
.wf-dots { display: flex; gap: 5px; }
.wf-dots button { flex: 0 1 32px; min-width: 0; width: 32px; height: 32px; margin: -14px 0; padding: 0; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; }
.wf-dots button i { display: block; width: 18px; height: 4px; border-radius: 2px; background: var(--line-strong); }
.wf-dots button[aria-current="true"] i { background: var(--accent); }
.wf-dots:has(button:only-child) { display: none; }
@media (max-width: 374px) { .wf-dots { gap: 0; } } /* ten dots still fit a 320px phone, touching, each about 29px wide */
.wf-run figcaption { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.wf-hd { display: grid; gap: 12px; }
.wf-hd h1 { margin: 0; font: 600 30px/1.1 var(--sans); letter-spacing: -.01em; text-wrap: balance; }
.wf-hd .promise { margin: 0; font: 400 20px/1.4 var(--sans); color: var(--ink); text-wrap: pretty; }
.wf-need { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.wf-need .ico { width: 15px; height: 15px; margin-top: 2px; }
.wf-need b { font-weight: 600; color: var(--ink); }
.wf-sec2 { display: grid; gap: 12px; }
.wf-sec2 > .sh { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wf-sec2 h2 { margin: 0; font: 600 24px/1.12 var(--sans); }
.wf-sec2 .sh small { font-size: 13px; font-weight: 500; color: var(--faint); }
.wf-dl { width: 100%; }
.wf-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.wf-steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; counter-increment: s; }
.wf-steps li::before { content: counter(s); display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sand); font-size: 13.5px; font-weight: 600; }
.wf-steps b { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.wf-steps span { display: block; margin-top: 2px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.wf-breaks { padding: 18px; border-radius: 16px; background: var(--sand-2); box-shadow: 0 0 0 1px var(--line); }
.wf-breaks h2 { font-size: 20px; }
.wf-breaks ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.wf-gate { display: grid; gap: 12px; padding: 20px; border-radius: var(--r-lg); background: var(--sheet); box-shadow: 0 0 0 1px var(--line); }
.wf-gate h2 { display: flex; align-items: center; gap: 10px; margin: 0; font: 600 22px/1.12 var(--sans); }
.wf-gate h2 .ico { width: 20px; height: 20px; flex-shrink: 0; }
.wf-gate p { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.wf-gate .gate-btns { grid-template-columns: 1fr; }

/* member stories: their own words, exactly as written */
.wf-stories { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.wf-story { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--sheet); box-shadow: 0 0 0 1px var(--line); }
.wf-story p { margin: 0; font-size: 15px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.wf-story footer { font-size: 13px; font-weight: 500; color: var(--faint); }
.wf-story footer b { font-weight: 600; color: var(--ink); }
.wf-story img { display: block; width: 100%; max-height: 360px; object-fit: contain; border-radius: 12px; background: var(--sand-2); }
.wf-nostory { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 16px; border: 1px dashed var(--line-strong); font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.wf-nostory .ico { width: 22px; height: 22px; flex-shrink: 0; }
.wf-mine { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 14px; color: var(--muted); }
.wf-mine .ico { width: 16px; height: 16px; margin-top: 2px; color: var(--ok); }
.wf-share-btn { justify-self: start; }

/* sheets: a file, the share form */
.wf-sheet { width: min(720px, 100vw); max-width: 100vw; max-height: min(92vh, 900px); margin: auto auto 0; padding: 0; border: 0; border-radius: 24px 24px 0 0; background: var(--sheet); color: var(--ink); overflow: hidden; }
.wf-sheet[open] { display: flex; flex-direction: column; }
.wf-sheet::backdrop { background: rgba(28, 22, 19, .45); }
.wf-sheet .hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.wf-sheet .hd > span { display: grid; min-width: 0; }
.wf-sheet .hd b { font: 500 14px/1.35 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-sheet .hd small { font-size: 12.5px; color: var(--faint); }
.wf-sheet .acts { display: flex; gap: 6px; flex-shrink: 0; }
.wf-sheet .what { margin: 0; padding: 14px 20px 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.wf-sheet pre { flex: 1; margin: 0; padding: 12px 20px 20px; overflow: auto; font: 400 12px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
.wf-x { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--sand-2); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.wf-form { display: grid; gap: 16px; padding: 20px 24px 28px; overflow: auto; }
.wf-form .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wf-form h2 { margin: 0; font: 600 24px/1.12 var(--sans); }
.wf-form label.fld { display: grid; gap: 6px; }
.wf-form label.fld > span { font-size: 13.5px; font-weight: 600; }
.wf-form textarea { min-height: 120px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--sheet); font-size: 15px; line-height: 1.5; resize: vertical; }
.wf-form textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.wf-form .count { justify-self: end; font-size: 12.5px; color: var(--faint); }
.wf-pick { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 88px; padding: 12px; border-radius: 14px; border: 1px dashed var(--line-strong); background: var(--sand-2); color: var(--ink); font-size: 14.5px; font-weight: 500; }
.wf-pick .ico { width: 18px; height: 18px; }
.wf-picked { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.wf-picked img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; background: var(--sand-2); }
.wf-picked span { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-check { display: flex; align-items: flex-start; gap: 12px; font-size: 14.5px; line-height: 1.45; }
.wf-check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.wf-form .note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--faint); }
.wf-form .err { margin: 0; font-size: 14px; color: var(--err); }
.wf-form .err:empty { display: none; }

/* our run, full size */
.wf-viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #16110E; color: #F3EAE2; }
.wf-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px; padding: 18px 16px 28px; }
.wf-viewer::backdrop { background: #16110E; }
.wf-viewer .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: #C4B3A8; }
.wf-viewer .top .nav { display: flex; gap: 6px; }
.wf-viewer .top button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(243, 234, 226, .12); color: #F3EAE2; display: inline-flex; align-items: center; justify-content: center; }
.wf-viewer .top button:disabled { opacity: .35; cursor: default; }
.wf-viewer .pic { display: flex; align-items: center; justify-content: center; min-height: 0; }
.wf-viewer .pic img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.wf-viewer .pic .wf-shot { max-width: 900px; border-radius: 14px; }
.wf-viewer p { margin: 0 auto; max-width: 900px; font-size: 15px; line-height: 1.5; }
/* on a phone a full run log is too small to read at the screen's width: show it at a readable size and let people pan */
@media (max-width: 760px) {
  .wf-viewer .pic { overflow: auto; align-items: flex-start; justify-content: flex-start; border-radius: 10px; -webkit-overflow-scrolling: touch; }
  .wf-viewer .pic img { max-width: none; max-height: none; width: 960px; height: auto; border-radius: 0; }
}

/* only the host sees this, before Workflows is released */
.wf-host-note { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--ink); font-size: 14px; line-height: 1.45; }
.wf-host-note .ico { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; color: var(--muted); }
.wf-host-note a { display: inline-flex; align-items: center; min-height: 32px; margin: -6px 0; font-weight: 600; color: var(--accent-ink); }

.wf-app ~ .toast { width: max-content; max-width: calc(100vw - 32px); }
.wf-col > section > .back { margin-left: -10px; }
.wf-saved-h { margin: 8px 0 0; font: 600 34px/1.1 var(--sans); }

@media (min-width: 761px) {
  .wf-hd h1 { font-size: 40px; }
  .wf-sheet { margin: auto; border-radius: 24px; max-height: min(86vh, 860px); }
}
/* a computer: both tracks at once, as rows; the page gets a files column */
@media (min-width: 1180px) {
  .wf-app .wf-col { max-width: 1080px; }
  .wf-tabs, #list-phone { display: none; }
  .wf-sec { display: block; margin-top: 34px; }
  .wf-sec + .wf-sec { margin-top: 44px; }
  .wf-item-col { max-width: 1080px; }
  .wf-page { grid-template-columns: minmax(0, 1fr) 360px; column-gap: 56px; align-items: start; }
  .wf-page > .main-c { display: grid; gap: 32px; min-width: 0; }
  .wf-aside { display: grid; gap: 16px; position: sticky; top: 76px; }
  .wf-page .inline-files { display: none; }
  .wf-hd h1 { font-size: 44px; }
}
@media (max-width: 1179px) {
  .wf-page > .main-c { display: contents; }
}
@media (max-width: 760px) {
  .wf-app .main { padding-bottom: 110px; }
  .nx-head.wf-head h1 { font-size: 34px; }
  .wf-hd .promise { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .wf-track { scroll-behavior: auto; }
}
