/* Adapter between the SparkFabrik design system kit and this tool, taken from the claude.ai
   prototype (design-handoff/prototype/index.html). Layout only: every colour comes from the kit
   tokens. It also carries the deviations of requirements §6: coloured dots instead of LED glyphs,
   linear icons, Barlow for status and table text. */
/* Adattatore del tool: solo layout, ogni colore viene dai token del kit */
:root{ --ut-gutter:40px; box-sizing:border-box; }
*,*::before,*::after{ box-sizing:inherit; }
html,body{ margin:0; min-height:100%; }
body.app-root{ min-height:100vh; padding-top:env(safe-area-inset-top,0px); padding-bottom:env(safe-area-inset-bottom,0px); }
.app-root h1,.app-root h2,.app-root h3{ margin:0; }
.ut-wrap{ width:100%; max-width:1280px; margin:0 auto; }
.ut-narrow{ width:100%; max-width:760px; margin:0 auto; }
.ut-h{ font:600 24px/1.25 var(--body); color:var(--app-ink); }
.ut-h3{ font:600 20px/1.3 var(--body); color:var(--app-ink); }
.ut-section{ display:flex; flex-direction:column; gap:14px; }
.ut-head{ display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:16px 24px; }
.ut-head > div:first-child{ display:flex; flex-direction:column; gap:8px; min-width:0; flex:1 1 420px; }
.ut-head > .app-row{ flex-wrap:wrap; gap:10px; }
.ut-prose{ white-space:pre-wrap; max-width:62ch; margin:0; color:var(--app-ink2); font-size:19px; line-height:1.6; }
.app-root .app-signin{ min-height:100vh; }
.ut-signin-note{ display:flex; align-items:center; gap:12px; }

/* Lista partecipanti */
.ut-split-tools{ display:flex; flex-direction:column; gap:10px; }
.app-split__list .ut-plist a{ display:flex; flex-direction:column; gap:4px; }
.ut-plist .ut-who{ display:flex; align-items:baseline; gap:10px; min-width:0; }
.ut-plist .ut-who b{ font:700 italic 24px/1 var(--display); text-transform:uppercase; }
.ut-plist .ut-who span{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--app-muted); font-size:15px; }
.ut-plist small{ color:var(--app-ink2); font-size:15px; }
.ut-plist a[aria-current=true]{ background:var(--app-active-bg); }
.ut-chips{ display:flex; flex-wrap:wrap; gap:6px; }
.ut-pairs-wrap{ max-width:640px; }

/* Test */
.ut-test{ position:fixed; inset:0; top:env(safe-area-inset-top,0px); bottom:env(safe-area-inset-bottom,0px); display:flex; flex-direction:column; }
.ut-drawer{ position:relative; z-index:5; background:var(--app-bg); color:var(--app-ink); box-shadow:inset 0 -1px 0 var(--app-line); }
.ut-bar{ display:flex; flex-wrap:wrap; align-items:center; gap:10px 20px; padding:10px 24px; min-height:64px; }
.ut-bar .ut-count{ font:700 italic 26px/1 var(--display); text-transform:uppercase; white-space:nowrap; }
.ut-bar .ut-ttl{ flex:1; min-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:600 19px var(--body); }
.ut-bar .app-led-status{ font-variant-numeric:tabular-nums; }
.ut-bar .app-row{ gap:8px; flex-wrap:nowrap; }
.ut-progress{ width:calc(var(--n) * 18px); max-width:100%; }
.ut-body{ display:flex; flex-direction:column; gap:18px; padding:4px 24px 22px; max-width:980px; }
.ut-task{ margin:0; font:500 23px/1.45 var(--body); white-space:pre-wrap; }
.ut-drawer.is-closed .ut-body{ display:none; }
.ut-frame{ flex:1; position:relative; background:#ffffff; }
.ut-companion{ flex:1; overflow:auto; }
.ut-timer{ display:flex; flex-direction:column; gap:4px; }
.ut-timer b{ font:500 52px/1 var(--mono); font-variant-numeric:tabular-nums; letter-spacing:-.02em; color:var(--app-ink); }
.ut-scale .app-seg{ display:flex; width:100%; }
.ut-scale .app-seg button{ flex:1; font-family:var(--mono); }
.ut-scale-ends{ display:flex; justify-content:space-between; gap:12px; margin-top:6px; color:var(--app-muted); font-size:15px; }
.ut-sus{ display:flex; flex-direction:column; gap:22px; }
.ut-sus fieldset{ border:0; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.ut-sus legend{ padding:0; font-size:19px; line-height:1.5; color:var(--app-ink); }
.ut-sus legend .app-mono{ color:var(--app-muted); margin-right:10px; font-size:15px; }
.ut-answer{ margin:0; padding:10px 14px; border-radius:var(--app-radius-small); background:var(--app-sunk); color:var(--app-ink); font-size:18px; overflow-wrap:anywhere; }
.ut-verify{ display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.app-root [hidden]{ display:none !important; }
.ut-tname{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.ut-tname a{ font:600 18px/1.35 var(--body); }
.ut-tname small{ font-size:15px; color:var(--app-muted); }
.ut-tname small{ line-height:1.35; }
/* Icone lineari e indicatori di stato */
.ut-ico{ width:18px; height:18px; flex:none; display:inline-block; vertical-align:-3px; }
.app-btn .ut-ico{ margin-right:2px; }
.app-btn--icon .ut-ico{ margin:0; }
.app-root .app-btn--icon{ width:36px; height:36px; min-height:36px; padding:0; }
.app-root .app-close{ width:36px; height:36px; display:inline-grid; place-items:center; }
.app-link .ut-ico{ width:16px; height:16px; margin-right:4px; vertical-align:-2px; }
.ut-dot{ display:inline-block; flex:none; width:8px; height:8px; border-radius:50%; background:var(--app-muted); }
.ut-dot--big{ width:12px; height:12px; }
.ut-dot--ok{ background:var(--app-ok); }
.ut-dot--run{ background:var(--app-run); }
.ut-dot--warn{ background:var(--app-warn); }
.ut-dot--error{ background:var(--app-error); }
.ut-dot--pending, .ut-dot--idle{ background:var(--app-field-border); }
.app-root .app-led-status{ font-family:var(--body); gap:8px; }
.app-rail .ut-dot, .app-topbar__nav .ut-dot{ background:var(--app-bar-dim); }
.app-rail__link[aria-current=page] .ut-dot{ background:var(--app-primary); }
.app-empty .ut-dot--big{ width:14px; height:14px; }
.ut-open{ color:var(--app-ink); text-decoration:none; font-weight:600; }
.ut-open:hover{ text-decoration:underline; text-underline-offset:3px; }
.ut-head-actions{ display:flex; gap:6px; margin-left:auto; }
.app-group__head .ut-head-actions{ margin-left:0; }
.ut-row-actions{ display:flex; gap:6px; flex-wrap:nowrap; }
.ut-crumb{ margin:0; }
.ut-filter{ max-width:420px; }
.ut-task-extra{ grid-column:1/-1; display:flex; flex-direction:column; gap:8px; padding-top:4px; }
.ut-companion .app-card{ display:flex; flex-direction:column; gap:16px; }
.ut-companion .app-card p{ margin:0; font-size:19px; line-height:1.55; color:var(--app-ink2); }
.ut-frame iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; background:#ffffff; }

/* Studio, prototipo, accessi */
.ut-task-card{ display:flex; flex-direction:column; gap:14px; }
.ut-task-card .ut-task-head{ display:flex; align-items:center; gap:8px; }
.ut-task-card .ut-task-head .ut-h3{ flex:1; }
.ut-files li{ gap:14px; }
.ut-files .app-radio{ margin:0; }
.ut-cred-form{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; gap:14px; align-items:end; }
.ut-hidden-file{ position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }

/* Toast e dialoghi */
.ut-toast{ position:fixed; top:calc(20px + env(safe-area-inset-top,0px)); right:20px; z-index:60; }
.ut-preview{ width:min(1200px,100vw - 32px); height:calc(100vh - 48px); }
.ut-preview .app-modal__body{ flex:1; padding:0; }
.ut-preview iframe{ width:100%; height:100%; border:0; background:#ffffff; }

@media (max-width:900px){
  :root{ --ut-gutter:16px; }
  .ut-cred-form{ grid-template-columns:1fr; }
  .ut-bar{ padding:10px 16px; }
  .ut-bar .app-btn__text{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  .ut-bar .ut-ttl{ order:5; flex-basis:100%; }
  .ut-body{ padding:4px 16px 18px; }
  .ut-task{ font-size:20px; }
}
@media (prefers-reduced-motion:no-preference){
  .ut-body{ animation:ut-in .15s ease-out; }
  @keyframes ut-in{ from{ opacity:0; transform:translateY(-4px); } to{ opacity:1; transform:none; } }
}
