.tutorial-help{display:inline-flex;align-items:center;gap:.45rem;min-height:44px;padding:.5rem .7rem;border-color:var(--line);border-radius:.65rem;background:var(--panel-2);box-shadow:none}
.tutorial-help>span{display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:var(--accent);color:var(--accent-text,#080a0d);font-weight:950}
.tutorial-help strong{font-size:.78rem}
.home-mode .topbar nav #tutorial-help{display:inline-flex!important}
.tutorial-center{width:min(820px,calc(100vw - 2rem));max-height:min(88vh,880px);padding:0;border:1px solid var(--line);border-radius:1rem;background:var(--panel);color:var(--text)}
.tutorial-center::backdrop{background:rgba(0,0,0,.72);backdrop-filter:blur(3px)}
.tutorial-center-shell{display:grid;grid-template-rows:auto 1fr;max-height:inherit}
.tutorial-center header{display:flex;align-items:center;justify-content:space-between;padding:1rem 1.1rem;border-bottom:1px solid var(--line)}
.tutorial-center header h2{margin:.2rem 0 0}
.tutorial-center header button,.tutorial-step header button{display:grid;place-items:center;width:44px;height:44px;padding:0;font-size:1.35rem}
.tutorial-center-content{display:grid;gap:1.25rem;padding:1rem;overflow:auto}
.tutorial-progress{display:grid;gap:.5rem;padding:1rem;border-radius:var(--radius);background:var(--panel-2)}
.tutorial-progress>div:first-child{display:flex;justify-content:space-between}
.tutorial-progress [role=progressbar]{height:8px;overflow:hidden;border-radius:999px;background:color-mix(in srgb,var(--line) 70%,transparent)}
.tutorial-progress [role=progressbar] span{display:block;height:100%;border-radius:inherit;background:var(--accent)}
.tutorial-category,.tutorial-recommended{display:grid;gap:.65rem}
.tutorial-category+.tutorial-category{padding-top:.35rem;border-top:1px solid color-mix(in srgb,var(--line) 65%,transparent)}
.tutorial-category-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.tutorial-category-heading h3{margin:0;font-size:1rem}
.tutorial-category-heading>span{display:grid;place-items:center;min-width:28px;height:24px;padding:0 .45rem;border-radius:999px;background:var(--panel-2);color:var(--muted);font-size:.7rem;font-weight:850}
.tutorial-guide-list{display:grid;gap:.55rem}
.tutorial-guide-card{position:relative;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.8rem;padding:.85rem;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel-2)}
.tutorial-guide-card.is-contextual{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 8%,var(--panel-2));box-shadow:inset 3px 0 0 var(--accent)}
.tutorial-guide-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:.7rem;background:color-mix(in srgb,var(--accent) 14%,transparent);font-size:1.25rem}
.tutorial-guide-card h4,.tutorial-guide-card p{margin:0}
.tutorial-guide-card h4{font-size:.95rem}
.tutorial-guide-card p{margin-top:.2rem;color:var(--muted);font-size:.8rem;line-height:1.35}
.tutorial-context-badge{position:absolute;top:.25rem;right:.45rem;color:var(--accent);font-size:.62rem;font-weight:900;text-transform:uppercase}
.tutorial-complete{position:absolute;bottom:.25rem;right:.45rem;color:var(--success,#4ade80);font-size:.62rem;font-weight:850}
.tutorial-reset{justify-self:start;color:var(--danger)}
.tutorial-backdrop{position:fixed;inset:0;z-index:40;background:rgba(0,0,0,.48);pointer-events:none}
.tutorial-backdrop[hidden],.tutorial-step[hidden]{display:none!important}
.tutorial-step{position:fixed;z-index:42;left:clamp(1rem,calc(var(--tutorial-anchor-x,50vw) - 180px),calc(100vw - 376px));top:min(var(--tutorial-anchor-y,20vh),calc(100vh - 300px));width:min(360px,calc(100vw - 2rem));max-height:calc(100vh - 2rem);overflow:auto;padding:1rem;border:1px solid var(--accent);border-radius:1rem;background:var(--panel);color:var(--text);box-shadow:0 18px 60px rgba(0,0,0,.55)}
.tutorial-step header{display:flex;align-items:center;justify-content:space-between}
#tutorial-step-count{color:var(--accent);font-size:.75rem;font-weight:900;text-transform:uppercase}
.tutorial-step h2{margin:.65rem 0 .45rem;font-size:1.2rem}
.tutorial-step p{color:var(--muted);line-height:1.5}
.tutorial-step-missing{padding:.65rem;border-radius:.6rem;background:color-mix(in srgb,var(--accent) 10%,transparent)}
.tutorial-step footer{display:flex;justify-content:space-between;gap:.65rem;margin-top:1rem}
.tutorial-step footer button{min-width:44px}
.tutorial-target{position:relative;z-index:41!important;pointer-events:none!important;outline:4px solid var(--accent)!important;outline-offset:5px;border-radius:var(--radius);box-shadow:0 0 0 9999px rgba(0,0,0,.12),0 0 30px var(--glow)}
.tutorial-running .tutorial-help{visibility:hidden}
.builder-toolbar .tutorial-help{margin-left:.15rem}

@media(max-width:700px){
  .topbar nav .tutorial-help,.builder-toolbar .tutorial-help{position:fixed;right:max(.65rem,env(safe-area-inset-right));bottom:calc(4.25rem + env(safe-area-inset-bottom));z-index:35;width:50px;height:50px;padding:0;justify-content:center;border-color:var(--accent);border-radius:50%;background:var(--panel);box-shadow:0 12px 36px rgba(0,0,0,.4)}
  .topbar nav .tutorial-help strong,.builder-toolbar .tutorial-help strong{display:none}
  .tutorial-center{width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;border:0;border-radius:0}
  .tutorial-center-content{padding:.75rem}
  .tutorial-guide-card{grid-template-columns:auto 1fr}
  .tutorial-guide-card>button{grid-column:1/-1;width:100%;min-height:44px}
  .tutorial-context-badge{position:static;grid-column:1/-1;justify-self:start}
  .tutorial-complete{top:.25rem;bottom:auto}
  .tutorial-step{left:.65rem;right:.65rem;top:auto;bottom:max(.65rem,env(safe-area-inset-bottom));width:auto;max-height:min(54dvh,420px)}
}

@media(prefers-reduced-motion:reduce){.tutorial-target{scroll-behavior:auto}}
