/* Teaching flow — one question per screen: add material, check examples, train & compare. */
html:has(.studio-page),body:has(.studio-page){background:#f5f5f7}
.studio-page{
  --ink:#1d1d1f;--ink-2:#3a3a3c;--muted:#6e6e73;--faint:#8e8e93;
  --line:rgba(0,0,0,.09);--line-strong:#d2d2d7;--fill:#f2f2f5;--fill-2:#e8e8ed;
  --surface:#fff;--accent:#0071e3;--accent-hover:#0077ed;--accent-soft:#e8f1fd;--accent-ink:#0a4b92;
  --warn:#b4640c;--danger:#b4321c;--danger-soft:#fdf1ee;
  --radius-card:22px;--radius-ctl:12px;
  --shadow:0 1px 2px rgba(0,0,0,.04),0 6px 24px rgba(0,0,0,.05);
  width:100%;margin:0 auto;padding:0 20px 72px;color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;font-size:15px;line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
.studio-page *,.studio-page *::before,.studio-page *::after{box-sizing:border-box}
.studio-page [hidden]{display:none!important}
:where(.studio-page) :where(h1,h2,h3,p,dl,dd,ol,ul,blockquote){margin:0}
.studio-page :is(h1,h2,h3){color:var(--ink);font-family:inherit}
.studio-page a{color:var(--accent);text-decoration:none}
.studio-page a:hover{text-decoration:underline;text-underline-offset:3px}
.studio-page svg{width:18px;height:18px;flex-shrink:0}
:where(.studio-page) :where(button,input,select,textarea){font:inherit;color:inherit}
:where(.studio-page) :where(button){cursor:pointer;background:none;border:0;padding:0}
.studio-page :is(button,a,input,select,textarea,summary,label):focus-visible{outline:3px solid rgba(0,113,227,.45);outline-offset:2px}
.studio-page :is(button,input,select,textarea):disabled{cursor:not-allowed}
.studio-page .visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* One header on every page: fixed height, centred nav, current item marked by colour/pill only (no width change). */
html{scrollbar-gutter:stable}
.site-header.studio-site-header{position:sticky;top:0;z-index:30;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:24px;height:56px;min-height:56px;max-width:none;margin:0;padding:0 max(24px,calc((100% - 1164px)/2));background:rgba(245,245,247,.82);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);border-bottom:1px solid rgba(0,0,0,.07)}
.site-header.studio-site-header .brand{justify-self:start;display:inline-flex;align-items:center;gap:8px;font-size:19px;letter-spacing:-.4px;color:#1d1d1f}
.site-header.studio-site-header .brand img{width:24px;height:24px}
.site-header.studio-site-header nav{justify-self:center;display:flex;gap:4px;order:0;width:auto;padding:0;border:0}
.site-header.studio-site-header nav a{padding:6px 14px;border-radius:999px;font-size:14px;font-weight:500;line-height:1.4;white-space:nowrap;color:#6e6e73;background:transparent}
.site-header.studio-site-header nav a:hover{color:#1d1d1f}
.site-header.studio-site-header nav a[aria-current=page]{color:#1d1d1f;font-weight:500;background:rgba(0,0,0,.06)}
.site-header.studio-site-header .account-menu{justify-self:end;margin-left:0}
/* Panels that pin to the top sit below the sticky header on wide screens. */
@media(min-width:721px){
  #summary,.mine-selection,.teach-examples-aside,.lesson-sidebar{top:81px}
  .recommendation-summary{top:68px}
}
@media(max-width:720px){
  .site-header.studio-site-header{position:static;grid-template-columns:1fr auto;row-gap:6px;height:auto;min-height:0;padding:10px 16px 8px}
  .site-header.studio-site-header nav{grid-column:1/-1;grid-row:2;justify-self:stretch;justify-content:center;overflow-x:auto}
  .site-header.studio-site-header nav a{padding:6px 12px;font-size:13px}
}

/* Page frame */
.flow-shell{max-width:720px;margin:0 auto;padding-top:36px}
.studio-page[data-step="3"] .flow-shell{max-width:880px}
.flow-loading{padding:96px 0;text-align:center;color:var(--muted)}

/* Progress: three slim segments with names. */
.flow-progress{margin-bottom:34px}
.flow-progress-count{font-size:13px;font-weight:600;color:var(--accent);margin-bottom:10px;letter-spacing:.01em}
.flow-progress ol{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:8px;list-style:none;padding:0}
.flow-progress li{display:flex;flex-direction:column;gap:8px;min-width:0}
.flow-progress-bar{display:block;height:4px;border-radius:4px;background:#dcdce1;transition:background .3s}
.flow-progress-name{font-size:13px;color:var(--faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.flow-progress .is-done .flow-progress-bar,.flow-progress .is-current .flow-progress-bar{background:var(--accent)}
.flow-progress .is-done .flow-progress-name{color:var(--muted)}
.flow-progress .is-current .flow-progress-name{color:var(--ink);font-weight:600}

.flow-head{margin-bottom:28px}
.flow-head h1{font-size:40px;line-height:1.1;font-weight:700;letter-spacing:-.028em;margin-bottom:12px}
.flow-head p{font-size:17px;line-height:1.47;color:var(--muted);max-width:600px}

/* Messages */
.flow-messages:empty{display:none}
.flow-banner{display:flex;align-items:flex-start;gap:10px;padding:12px 16px;margin-bottom:16px;border-radius:14px;background:var(--accent-soft);color:var(--accent-ink);font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.flow-banner svg{margin-top:1px}
.flow-banner.is-error{background:var(--danger-soft);color:var(--danger)}

/* Cards & buttons */
.flow-card{background:var(--surface);border-radius:var(--radius-card);box-shadow:var(--shadow);border:1px solid rgba(0,0,0,.04);padding:24px;min-width:0}
.flow-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 22px;border-radius:999px;font-size:15px!important;font-weight:600;line-height:1;white-space:nowrap;transition:background .15s,color .15s,box-shadow .15s,transform .1s;text-decoration:none!important}
.flow-button:active:not(:disabled){transform:scale(.98)}
.flow-button.primary{background:var(--accent);color:#fff}
.flow-button.primary:hover:not(:disabled){background:var(--accent-hover)}
.flow-button.primary:disabled{background:#e3e3e8;color:#a1a1a6;opacity:1}
.flow-button.secondary{background:var(--surface);color:var(--ink);box-shadow:inset 0 0 0 1px var(--line-strong)}
.flow-button.secondary:hover:not(:disabled){background:var(--fill)}
.flow-button.ghost{color:var(--accent);padding:0 16px}
.flow-button.ghost:hover:not(:disabled){background:var(--accent-soft)}
.flow-button:disabled:not(.primary){opacity:.45}
.flow-link{color:var(--accent);font-weight:500;font-size:inherit}
.flow-link:hover{text-decoration:underline;text-underline-offset:3px}
.flow-chip{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 13px;border-radius:999px;background:var(--fill);color:var(--ink);font-size:13px;font-weight:500}
.flow-chip:hover:not(:disabled){background:var(--fill-2)}
.flow-chip svg{width:15px;height:15px}

/* Step 1 — composer */
.flow-composer{padding:16px}
.flow-segmented{display:inline-flex;gap:2px;padding:3px;border-radius:11px;background:rgba(118,118,128,.12);margin-bottom:14px}
.flow-segmented button{display:inline-flex;align-items:center;gap:7px;height:32px;padding:0 14px;border-radius:8px;font-size:14px;font-weight:500;color:var(--ink-2);transition:background .15s,box-shadow .15s}
.flow-segmented button svg{width:16px;height:16px;color:var(--muted)}
.flow-segmented button[aria-selected=true]{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.12),0 0 0 .5px rgba(0,0,0,.04)}
.flow-segmented button[aria-selected=true] svg{color:var(--accent)}
.flow-drop{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:236px;padding:28px 20px;text-align:center;border-radius:16px;border:1.5px dashed var(--line-strong);background:#fafafb;cursor:pointer;transition:background .2s,border-color .2s}
.flow-drop:hover,.flow-drop.dragging{border-color:var(--accent);background:#f2f7fe}
.flow-drop:focus-within{outline:3px solid rgba(0,113,227,.45);outline-offset:2px}
.flow-drop-icon{display:grid;place-items:center;width:56px;height:56px;margin-bottom:12px;border-radius:50%;background:var(--accent-soft);color:var(--accent);transition:transform .2s}
.flow-drop.dragging .flow-drop-icon{transform:translateY(-3px) scale(1.05)}
.flow-drop-icon svg{width:26px;height:26px}
.flow-drop strong{font-size:17px;font-weight:600;color:var(--ink)}
.flow-drop>span{font-size:15px;color:var(--muted)}
.flow-drop u{text-decoration:none;color:var(--accent);font-weight:500}
.flow-drop small{margin-top:10px;font-size:13px;color:var(--faint)}
.flow-drop input[type=file]{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;pointer-events:none}
.flow-paste{position:relative}
.flow-paste textarea{display:block;width:100%;min-height:236px;padding:16px 16px 34px;border-radius:16px;border:1px solid var(--line-strong);background:#fff;font-size:16px;line-height:1.55;resize:vertical;transition:border-color .15s,box-shadow .15s}
.flow-paste textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 4px rgba(0,113,227,.14)}
.flow-paste textarea::placeholder{color:var(--faint)}
.flow-paste small{position:absolute;right:14px;bottom:10px;font-size:12px;color:var(--faint);font-variant-numeric:tabular-nums;pointer-events:none}
.material-list{list-style:none;padding:0;margin-top:12px;display:grid;gap:2px}
.material-list li{display:flex;align-items:center;gap:12px;padding:8px 6px 8px 8px;border-radius:12px;min-width:0}
.material-list li:hover{background:#fafafb}
.material-list li>svg{width:36px;height:36px;padding:8px;border-radius:10px;background:var(--fill);color:var(--accent)}
.material-info{flex:1;min-width:0}
.material-info strong{display:block;font-size:15px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.material-info small{display:block;font-size:13px;color:var(--muted)}
.material-info .is-warning{color:var(--warn)}
.material-remove{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;color:var(--faint)}
.material-remove:hover:not(:disabled){background:var(--fill-2);color:var(--ink)}
.material-remove svg{width:16px;height:16px}
.flow-composer-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-top:14px;padding:14px 4px 2px 8px;border-top:1px solid var(--line)}
.flow-status{display:flex;align-items:center;gap:10px;flex:1;min-width:220px;font-size:14px;color:var(--muted)}
.flow-status strong{color:var(--ink);font-weight:600}
.flow-status .flow-link{white-space:nowrap}
.flow-free{margin-left:auto;white-space:nowrap;font-size:13px}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--line-strong);flex-shrink:0}
.dot.is-ready{background:#34c759}
.dot.is-offline{background:#e09a2b}
.dot.is-pending{background:var(--faint);animation:flow-pulse 1.4s ease-in-out infinite}
.flow-sample{display:flex;align-items:center;justify-content:center;gap:8px;margin:18px auto 0;padding:8px 14px;border-radius:999px;font-size:14px;color:var(--muted)}
.flow-sample:hover:not(:disabled){background:rgba(0,0,0,.04)}
.flow-sample svg{width:16px;height:16px;color:var(--accent)}
.flow-sample strong{color:var(--accent);font-weight:600}


.flow-options{margin-top:18px}
.flow-options summary{display:inline-flex;align-items:center;gap:6px;cursor:pointer;list-style:none;font-size:13px;color:var(--faint);padding:4px 0}
.flow-options summary::-webkit-details-marker{display:none}
.flow-options summary::after{content:"";width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg) translateY(-2px);transition:transform .2s}
.flow-options[open] summary::after{transform:rotate(225deg) translateY(-1px)}
.flow-options summary:hover{color:var(--ink)}
.flow-options-body{margin-top:12px;padding:20px;border-radius:18px;background:#fff;box-shadow:var(--shadow)}
.flow-options-body>p{font-size:14px;color:var(--muted);margin-top:12px}
.flow-options-actions{display:flex;gap:18px;flex-wrap:wrap;margin-top:14px;font-size:14px}
.flow-field{display:block;min-width:0;margin-top:16px}
.flow-field:first-child{margin-top:0}
.flow-field>span{display:block;font-size:13px;font-weight:600;color:var(--ink-2);margin-bottom:6px}
.flow-field>span small{font-weight:400;color:var(--faint);margin-left:4px}
.flow-field :is(input,select,textarea){display:block;width:100%;height:auto;min-height:44px;padding:10px 13px;border-radius:var(--radius-ctl);border:1px solid var(--line-strong);background:#fff;font-size:16px;line-height:1.5;transition:border-color .15s,box-shadow .15s}
.flow-field textarea{resize:vertical}
.flow-field :is(input,select,textarea):focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 4px rgba(0,113,227,.14)}

.flow-recent{margin-top:44px}
.flow-section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin:0 0 14px}
.flow-section-heading h2{font-size:20px;font-weight:650;letter-spacing:-.015em}
.flow-section-heading :is(p,a){font-size:14px;color:var(--muted)}
.flow-section-heading a{color:var(--accent)}

/* Step 2 — review */
.review-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;border-radius:18px;overflow:hidden;background:var(--line);box-shadow:var(--shadow)}
.review-stats>div{display:flex;flex-direction:column-reverse;gap:2px;padding:16px 20px;background:#fff;min-width:0}
.review-stats dt{font-size:13px;color:var(--muted)}
.review-stats dd{font-size:28px;font-weight:650;letter-spacing:-.02em;line-height:1.15;font-variant-numeric:tabular-nums}
.review-list{display:grid;gap:14px;margin-top:16px}
.review-card{background:#fff;border-radius:20px;padding:18px 20px 16px;box-shadow:var(--shadow);border:1px solid rgba(0,0,0,.04);min-width:0;transition:box-shadow .2s}
.review-card.is-editing{box-shadow:0 0 0 2px var(--accent),var(--shadow)}
.review-card>header{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.review-index{font-size:13px;font-weight:600;color:var(--ink)}
.review-index span{font-weight:400;color:var(--faint)}
.review-badge{font-size:12px;font-weight:600;padding:3px 9px;border-radius:999px;background:var(--accent-soft);color:var(--accent)}
.review-card>header .flow-chip{margin-left:auto}
.chat{display:grid;gap:10px}
.chat-row{display:flex;flex-direction:column;min-width:0}
.chat-row.is-ask{align-items:flex-end}
.chat-row.is-answer{align-items:flex-start}
.chat-label{font-size:12px;color:var(--faint);margin:0 10px 4px}
.chat-bubble{max-width:86%;padding:11px 16px;border-radius:20px;font-size:15px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}
.is-ask .chat-bubble{background:var(--fill);color:var(--ink);border-bottom-right-radius:6px}
.is-answer .chat-bubble{background:var(--accent);color:#fff;border-bottom-left-radius:6px}
.review-card .flow-field textarea{min-height:64px}
.review-card .flow-field textarea.studio-answer{min-height:96px}
.review-source{margin-top:12px}
.review-source summary{display:inline-flex;align-items:center;gap:6px;cursor:pointer;list-style:none;font-size:13px;color:var(--muted);padding:2px 0}
.review-source summary::-webkit-details-marker{display:none}
.review-source summary::before{content:"";width:5px;height:5px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);transition:transform .2s}
.review-source[open] summary::before{transform:rotate(45deg)}
.review-source summary:hover{color:var(--ink)}
.review-source blockquote{margin-top:10px;padding:12px 14px;border-left:3px solid var(--line-strong);border-radius:0 12px 12px 0;background:#fafafb;font-size:14px;line-height:1.6;color:var(--ink-2);white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;overflow:auto}
.flow-actionbar{position:sticky;bottom:0;z-index:20;margin:24px -8px 0;padding:12px 8px max(12px,env(safe-area-inset-bottom))}
.flow-actionbar-inner{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 10px 10px 20px;border-radius:999px;background:rgba(255,255,255,.86);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);box-shadow:0 0 0 1px rgba(0,0,0,.06),0 10px 30px rgba(0,0,0,.1)}
.flow-actionbar-inner>p{font-size:14px;color:var(--muted);min-width:0}
.flow-actionbar-inner>p strong{color:var(--ink)}
.flow-actionbar-buttons{display:flex;gap:6px;flex-shrink:0}

/* Running — real stage timeline */
.flow-running{padding:28px 28px 20px}
.flow-timeline{list-style:none;padding:0}
.flow-timeline li{position:relative;display:grid;grid-template-columns:28px minmax(0,1fr);gap:16px;padding-bottom:24px}
.flow-timeline li:not(:last-child)::before{content:"";position:absolute;left:13px;top:30px;bottom:2px;width:2px;border-radius:2px;background:#e3e3e8}
.flow-timeline li.is-done::before{background:var(--accent)}
.flow-timeline-mark{position:relative;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#fff;box-shadow:inset 0 0 0 2px var(--line-strong)}
.is-done .flow-timeline-mark{background:var(--accent);box-shadow:none;color:#fff}
.is-done .flow-timeline-mark svg{width:16px;height:16px;stroke-width:2.4}
.is-current .flow-timeline-mark{box-shadow:inset 0 0 0 2px var(--accent)}
.is-current .flow-timeline-mark::after{content:"";width:10px;height:10px;border-radius:50%;background:var(--accent);animation:flow-pulse 1.6s ease-in-out infinite}
.flow-timeline strong{display:block;font-size:16px;line-height:28px;font-weight:500;color:var(--faint)}
.flow-timeline .is-done strong{color:var(--ink-2)}
.flow-timeline .is-current strong{color:var(--ink);font-weight:600}
.flow-timeline li p{font-size:14px;color:var(--muted);margin-top:6px;overflow-wrap:anywhere}
.flow-meter{display:flex;align-items:center;gap:12px;margin-top:8px}
.flow-meter span{font-size:13px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.flow-meter progress{flex:1;max-width:360px;height:6px;border:0;border-radius:6px;background:#e8e8ed;overflow:hidden;appearance:none;accent-color:var(--accent)}
.flow-meter progress::-webkit-progress-bar{background:#e8e8ed;border-radius:6px}
.flow-meter progress::-webkit-progress-value{background:var(--accent);border-radius:6px;transition:width .4s}
.flow-meter progress::-moz-progress-bar{background:var(--accent);border-radius:6px}
.flow-meter progress:not([value]){background:linear-gradient(90deg,#e8e8ed 0%,#b5d3fa 50%,#e8e8ed 100%);background-size:200% 100%;animation:flow-sweep 1.8s ease-in-out infinite}
.flow-meter progress:not([value])::-webkit-progress-bar{background:transparent}
.flow-running-footer{display:flex;align-items:center;justify-content:space-between;gap:12px 20px;flex-wrap:wrap;padding-top:18px;border-top:1px solid var(--line)}
.flow-running-footer p{flex:1;min-width:240px;font-size:14px;color:var(--muted)}
.flow-running-footer>div{display:flex;gap:6px}
@keyframes flow-pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.45;transform:scale(.8)}}
@keyframes flow-sweep{0%{background-position:100% 0}100%{background-position:-100% 0}}

/* Step 3 — result */
.result-summary{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:18px;padding:22px 24px}
.result-mark{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:var(--accent);color:#fff}
.result-mark svg{width:24px;height:24px;stroke-width:2.2}
.result-summary h2{font-size:20px;font-weight:650;letter-spacing:-.015em;margin-bottom:2px}
.result-summary p{font-size:14px;color:var(--muted)}
.result-actions{display:flex;flex-direction:column;align-items:stretch;gap:4px}
.result-summary+.flow-section-heading{margin-top:36px}
.compare-list{display:grid;gap:14px}
.compare-card{background:#fff;border-radius:20px;padding:20px 22px 18px;box-shadow:var(--shadow);border:1px solid rgba(0,0,0,.04);min-width:0}
.compare-card h3{display:flex;gap:12px;align-items:flex-start;font-size:17px;font-weight:600;line-height:1.4;letter-spacing:-.01em;margin-bottom:14px;white-space:pre-wrap;overflow-wrap:anywhere}
.compare-card h3>span{display:grid;place-items:center;width:24px;height:24px;margin-top:1px;flex-shrink:0;border-radius:50%;background:var(--fill);font-size:12px;font-weight:600;color:var(--muted)}
.compare-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.compare-pair section{min-width:0;padding:14px 16px;border-radius:14px}
.compare-pair .is-before{background:#f5f5f7}
.compare-pair .is-after{background:var(--accent-soft);box-shadow:inset 0 0 0 1px rgba(0,113,227,.16)}
.compare-pair span{display:block;font-size:12px;font-weight:600;color:var(--faint);margin-bottom:6px;letter-spacing:.01em}
.compare-pair .is-after span{color:var(--accent)}
.compare-pair p{font-size:15px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}
.compare-expected{margin-top:12px;padding-top:12px;border-top:1px solid var(--line);font-size:14px;line-height:1.55;color:var(--ink-2);white-space:pre-wrap;overflow-wrap:anywhere}
.compare-expected span{display:block;font-size:12px;font-weight:600;color:var(--faint);margin-bottom:3px}
.flow-more{margin-top:4px}
.flow-more>summary{display:inline-flex;align-items:center;gap:6px;cursor:pointer;list-style:none;padding:8px 0;font-size:14px;font-weight:500;color:var(--accent)}
.flow-more>summary::-webkit-details-marker{display:none}
.flow-more>summary::after{content:"";width:6px;height:6px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg) translateY(-2px);transition:transform .2s}
.flow-more[open]>summary::after{transform:rotate(225deg) translateY(-1px)}
.flow-more>.compare-list{margin-top:8px}
.flow-facts{margin-top:14px}
.flow-facts dl{margin:8px 0 12px;padding:0 18px;border-radius:16px;background:#fff;box-shadow:var(--shadow)}
.flow-facts dl>div{display:flex;justify-content:space-between;gap:20px;padding:13px 0;font-size:14px}
.flow-facts dl>div+div{border-top:1px solid var(--line)}
.flow-facts dt{color:var(--muted)}
.flow-facts dd{font-weight:500;text-align:right;overflow-wrap:anywhere;min-width:0}
.flow-facts .flow-link{font-size:14px}
.flow-facts-note{font-size:14px;color:var(--muted);margin:8px 0 0}

/* Empty / stopped / sign-in */
.flow-empty{text-align:center;padding:44px 28px}
.flow-empty-icon{display:grid;place-items:center;width:56px;height:56px;margin:0 auto 16px;border-radius:50%;background:var(--accent-soft);color:var(--accent)}
.flow-empty-icon svg{width:26px;height:26px}
.flow-empty-icon.is-stopped{background:#f5f5f7;color:var(--muted)}
.flow-empty h2{font-size:22px;font-weight:650;letter-spacing:-.015em;margin-bottom:8px}
.flow-empty p{font-size:15px;color:var(--muted);max-width:480px;margin:0 auto;overflow-wrap:anywhere}
.flow-empty .flow-button{margin-top:20px}
.flow-empty-actions{display:flex;justify-content:center;gap:8px;flex-wrap:wrap}

.flow-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:48px;padding-top:18px;border-top:1px solid var(--line);font-size:13px;color:var(--faint)}
.flow-footer>span{display:inline-flex;align-items:center;gap:6px}
.flow-footer svg{width:14px;height:14px}

/* Shared job and setup cards (also used by My models). */
.studio-help{color:#6e6e73;font-size:14px!important;line-height:1.6;margin:10px 0 0}
.studio-job-grid,.upload-job-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:4px}
.studio-job-card,.upload-job-card{display:flex;align-items:center;gap:14px;min-width:0;padding:14px 16px;border-radius:18px;background:#fff;color:#1d1d1f;box-shadow:0 1px 2px rgba(0,0,0,.04),0 6px 24px rgba(0,0,0,.05);border:1px solid rgba(0,0,0,.04);transition:transform .15s,box-shadow .15s;text-decoration:none!important}
.studio-job-card:hover,.upload-job-card:hover{transform:translateY(-1px);box-shadow:0 2px 4px rgba(0,0,0,.05),0 12px 30px rgba(0,0,0,.08)}
.studio-job-card>span:nth-child(2),.upload-job-card>span:nth-child(2){min-width:0;flex:1}
.studio-job-card strong,.upload-job-card strong{display:block;font-size:15px;font-weight:600;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#1d1d1f}
.studio-job-card small,.upload-job-card small{display:block;color:#6e6e73;font-size:13px;line-height:1.45;margin-top:2px}
.studio-job-card svg,.upload-job-card svg{width:18px;height:18px;flex-shrink:0}
.studio-job-icon,.upload-job-icon{display:grid;place-items:center;width:38px;height:38px;flex-shrink:0;border-radius:11px;background:#f2f2f5;color:#6e6e73}
.studio-job-icon.tone-done{background:#e8f1fd;color:#0071e3}
.studio-job-icon.tone-action{background:#fff4e2;color:#a3580a}
.studio-job-icon.tone-active{background:#f2f2f5;color:#6e6e73}
.studio-card-arrow,.upload-card-arrow{color:#c7c7cc;margin-left:auto;display:grid}
.studio-library-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;flex-wrap:wrap;margin:10px 0 22px}
.studio-library-heading h2{font-size:27px;line-height:1.3;letter-spacing:-.6px;margin-bottom:8px;color:#1d1d1f}
.studio-library-heading p{font-size:15px;line-height:1.6;color:#6e6e73}
.studio-library-heading .button{min-height:44px;font-size:15px;padding:11px 18px;font-weight:600;border-radius:999px}
.studio-library-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px}
.studio-library-card{display:flex;flex-direction:column;min-width:0;border-radius:18px;padding:20px;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.04),0 6px 24px rgba(0,0,0,.05)}
.studio-library-card h3{font-size:18px;line-height:1.35;letter-spacing:-.3px;color:#1d1d1f;overflow-wrap:anywhere}
.studio-library-card p{font-size:14px;line-height:1.6;color:#6e6e73;margin:6px 0 12px}
.studio-library-card a{margin-top:auto;font-size:14px;font-weight:500}
.studio-facts{margin:20px 0;color:#6e6e73;font-size:14px}
.studio-facts summary{cursor:pointer;font-weight:500;color:#1d1d1f;padding:5px 0;font-size:14px}

/* Small screens */
@media(max-width:720px){
  .studio-page{padding:0 16px 40px}
  .flow-shell{padding-top:22px}
  .flow-progress{margin-bottom:24px}
  .flow-progress-name{font-size:12px}
  .flow-head{margin-bottom:22px}
  .flow-head h1{font-size:30px;margin-bottom:8px}
  .flow-head p{font-size:16px}
  .flow-card{padding:18px;border-radius:20px}
  .flow-composer{padding:12px}
  .flow-segmented{display:flex}
  .flow-segmented button{flex:1;justify-content:center}
  .flow-drop{min-height:200px;padding:24px 14px}
  .flow-paste textarea{min-height:200px}
  .flow-composer-footer{padding-left:4px;padding-right:4px}
  .flow-composer-footer .flow-button{width:100%}
  .flow-status{min-width:0}
  .flow-sample{text-align:center}
  .flow-sample svg{display:none}
  .review-stats>div{padding:12px 14px}
  .review-stats dd{font-size:22px}
  .review-stats dt{font-size:12px;line-height:1.3}
  .review-card{padding:16px}
  .chat-bubble{max-width:94%}
  .flow-actionbar{margin:20px -8px 0}
  .flow-actionbar-inner{flex-direction:column;align-items:stretch;gap:10px;padding:12px;border-radius:22px}
  .flow-actionbar-inner>p{padding:0 6px;font-size:13px}
  .flow-actionbar-buttons{display:grid;grid-template-columns:auto 1fr}
  .flow-running{padding:22px 18px 16px}
  .flow-running-footer>div{width:100%}
  .flow-running-footer .flow-button{flex:1}
  .result-summary{grid-template-columns:auto minmax(0,1fr);gap:14px;padding:18px}
  .result-actions{grid-column:1/-1}
  .result-actions .flow-button{width:100%}
  .compare-card{padding:16px}
  .compare-pair{grid-template-columns:1fr}
  .flow-empty{padding:34px 18px}
  .flow-empty-actions .flow-button{width:100%}
  .studio-job-grid,.upload-job-grid,.studio-library-grid{grid-template-columns:1fr}
  .studio-library-heading h2{font-size:24px}
}
@media(prefers-reduced-motion:reduce){
  .studio-page *,.studio-job-card,.upload-job-card{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}

/* Step 1 — goal cards */
.goal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.goal-card{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:0;padding:20px;text-align:left;border-radius:20px;background:#fff;box-shadow:var(--shadow);border:1px solid rgba(0,0,0,.04);transition:box-shadow .2s,transform .15s}
.goal-card:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 2px 4px rgba(0,0,0,.05),0 12px 30px rgba(0,0,0,.08)}
.goal-card.is-selected{box-shadow:0 0 0 2px var(--accent),var(--shadow)}
.goal-icon{display:grid;place-items:center;width:44px;height:44px;margin-bottom:10px;border-radius:12px;background:var(--accent-soft);color:var(--accent)}
.goal-icon svg{width:22px;height:22px}
.goal-card strong{font-size:17px;font-weight:600;letter-spacing:-.01em}
.goal-card>span:not(.goal-icon){font-size:14px;color:var(--muted)}
.goal-card small{display:inline-flex;align-items:center;gap:6px;margin-top:12px;font-size:12px;color:var(--faint)}
.goal-card small svg{width:14px;height:14px}

/* Step 2 — spreadsheet table */
.flow-table-card{padding:16px}
.sheet-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.sheet-toolbar label.flow-chip{position:relative;cursor:pointer}
.sheet-toolbar label.flow-chip:focus-within{outline:3px solid rgba(0,113,227,.45);outline-offset:2px}
.sheet-toolbar input[type=file]{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;pointer-events:none}
.sheet-wrap{max-height:min(60vh,560px);overflow:auto;border-radius:14px;border:1px solid var(--line-strong);background:#fff}
.sheet-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:15px}
.sheet-table thead th{position:sticky;top:0;z-index:1;padding:9px 12px;text-align:left;font-size:12px;font-weight:600;color:var(--muted);background:#f7f7f9;border-bottom:1px solid var(--line-strong)}
.sheet-table th:first-child,.sheet-table td.row-num{width:40px}
.sheet-table th:last-child,.sheet-table td.row-action{width:40px}
.sheet-table td{padding:0;border-bottom:1px solid var(--line);vertical-align:top}
.sheet-table tr:last-child td{border-bottom:0}
.sheet-table td+td:not(.row-action){border-left:1px solid var(--line)}
.sheet-table td.row-num{padding:11px 0 0;text-align:center;font-size:12px;color:var(--faint);font-variant-numeric:tabular-nums;background:#fafafb}
.sheet-table textarea{display:block;width:100%;min-height:42px;padding:10px 12px;border:0;background:transparent;font-size:15px;line-height:1.45;resize:none;field-sizing:content;max-height:180px}
.sheet-table textarea:focus{outline:none;background:#f2f7fe;box-shadow:inset 0 0 0 2px var(--accent)}
.sheet-table textarea::placeholder{color:#b0b0b6}
.sheet-table td.row-action button{display:grid;place-items:center;width:28px;height:28px;margin:7px auto 0;border-radius:50%;color:#c7c7cc}
.sheet-table tr:hover td.row-action button,.sheet-table td.row-action button:focus-visible{color:var(--muted)}
.sheet-table td.row-action button:hover{background:var(--fill-2);color:var(--ink)}
.sheet-table td.row-action svg{width:14px;height:14px}
.add-row{display:inline-flex;align-items:center;gap:6px;margin-top:10px;padding:4px 2px;font-size:14px}
.add-row svg{width:16px;height:16px}
.label-chips{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:12px}
.label-chips:empty{display:none}
.label-chips-title{font-size:12px;font-weight:600;color:var(--faint);margin-right:2px}
.label-chip{padding:3px 10px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:13px;font-weight:500}
.table-instruction{margin-top:14px}
.flow-composer-footer>.flow-button.ghost{padding:0 12px 0 8px}

/* Step 3 — model choice */
.flow-model-card{padding:16px}
.pick-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.pick-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:0;padding:16px 16px 14px;text-align:left;border-radius:16px;background:#fafafb;box-shadow:inset 0 0 0 1px var(--line-strong);transition:box-shadow .15s,background .15s}
.pick-card:hover:not(:disabled){background:#fff}
.pick-card.is-selected{background:#fff;box-shadow:inset 0 0 0 2px var(--accent)}
.pick-card.is-soon{opacity:1;cursor:default}
.pick-card.is-soon>*:not(.pick-meta):not(.pick-check){opacity:.55}
.pick-tier{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:600;color:var(--muted);letter-spacing:.01em}
.pick-tier em{font-style:normal;padding:1px 7px;border-radius:999px;background:var(--accent);color:#fff;font-size:11px}
.pick-card strong{font-size:17px;font-weight:600;letter-spacing:-.01em}
.pick-blurb{font-size:13px;color:var(--muted);line-height:1.4}
.pick-meta{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.pick-meta span{padding:2px 8px;border-radius:999px;background:var(--fill);font-size:12px;color:var(--muted)}
.pick-meta span.is-available{background:#e3f6ea;color:#1c7a43}
.pick-check{position:absolute;top:14px;right:14px;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--accent);color:#fff;opacity:0;transform:scale(.6);transition:opacity .15s,transform .15s}
.pick-check svg{width:14px;height:14px;stroke-width:2.4}
.pick-card.is-selected .pick-check{opacity:1;transform:none}
.flow-model-card .flow-options{margin-top:14px}

@media(max-width:720px){
  .goal-grid{grid-template-columns:1fr;gap:10px}
  .goal-card{padding:16px;flex-direction:row;flex-wrap:wrap;align-items:center;column-gap:14px}
  .goal-icon{margin-bottom:0;width:40px;height:40px}
  .goal-card strong{flex:1;min-width:0}
  .goal-card>span:not(.goal-icon),.goal-card small{flex-basis:100%;margin-top:0}
  .flow-table-card,.flow-model-card{padding:12px}
  .sheet-table{font-size:14px}
  .sheet-table th:first-child,.sheet-table td.row-num{width:30px}
  .sheet-table textarea{font-size:16px;padding:9px 10px}
  .pick-list{grid-template-columns:1fr}
  .flow-composer-footer{display:grid;grid-template-columns:auto 1fr;align-items:center}
  .flow-composer-footer .flow-status{grid-column:1/-1;grid-row:1}
  .flow-composer-footer .flow-button.primary{width:100%}
}

/* Step 2 gate — sign in before entering data */
.flow-gate .flow-gate-back{display:block;margin:14px auto 0;font-size:14px}

/* Result — how to use the trained model */
.use-guide{margin-top:20px;padding:22px 24px}
.use-guide>h2{font-size:20px;font-weight:650;letter-spacing:-.015em;margin-bottom:4px}
.use-lede{font-size:14px;color:var(--muted);margin-bottom:16px}
.use-steps{list-style:none;padding:0;display:grid;gap:0}
.use-steps>li{display:grid;grid-template-columns:28px minmax(0,1fr);gap:14px;padding:14px 0;border-top:1px solid var(--line)}
.use-num{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--accent-soft);color:var(--accent);font-size:13px;font-weight:650}
.use-steps>li>div>strong{display:block;font-size:15px;font-weight:600;line-height:28px}
.use-steps p strong{font-weight:600;color:var(--ink)}
.use-steps p{font-size:14px;color:var(--muted);margin-top:2px}
.use-steps .flow-button{margin-top:10px;min-height:38px;padding:0 16px;font-size:14px!important}
.use-note{font-size:13px!important;margin-top:8px!important}
@media(max-width:720px){.use-guide{padding:18px}}
.flow-footer .flow-delete{color:var(--danger);font-size:13px;font-weight:500}
.use-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap}
.use-os{margin:0;flex-shrink:0}
.use-code{display:flex;align-items:flex-start;gap:8px;margin-top:10px;padding:10px 10px 10px 14px;border-radius:12px;background:#1d1d1f;color:#f5f5f7;min-width:0}
.use-code pre{flex:1;min-width:0;margin:0;overflow-x:auto}
.use-code code{font:13px/1.65 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:pre;color:#f5f5f7;background:none;padding:0}
.use-code .flow-chip{flex-shrink:0;background:rgba(255,255,255,.14);color:#fff;height:28px}
.use-code .flow-chip:hover:not(:disabled){background:rgba(255,255,255,.24)}
.use-steps p code,.use-note code{font:12.5px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;padding:1px 5px;border-radius:5px;background:var(--fill);color:var(--ink);overflow-wrap:anywhere}
@media(max-width:720px){.use-head{flex-direction:column}.use-os{width:100%}}
