/* First-run setup (onboarding-view.js). While the guide page is shown it
 * covers the whole window; the app's sidebar and page header step aside. */
html.onboarding-active .nav,
html.onboarding-active #guide-page > .header,
html.onboarding-active #steps { display: none; }

#guide-content.ob-root {
  --hard: cubic-bezier(.2, .9, .25, 1);
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: 64px auto;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
  background-color: var(--bg);
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px), linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
}
.ob-root h1 { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 700; letter-spacing: 0; text-align: center; overflow-wrap: anywhere; }
.ob-root h3 { margin: 0; }
.ob-root p { margin: 0; }
.ob-root button, .ob-root input { font: inherit; color: inherit; letter-spacing: 0; }
.ob-root button::after { content: none !important; }
.ob-root svg { flex: none; }
.ob-lead { margin-top: 8px !important; color: var(--sub); text-align: center; }

/* ---- chrome ---- */
.ob-top { position: relative; display: flex; align-items: center; justify-content: center; }
.ob-pg { display: flex; gap: 6px; }
.ob-pg i { width: 32px; height: 10px; border: var(--border); border-radius: 3px; background: var(--surface); transition: background .15s steps(1); }
.ob-pg i.on { background: var(--ink); }
.ob-tools { position: absolute; top: 16px; right: 20px; display: flex; align-items: center; gap: 10px; }
.ob-lang { display: flex; overflow: hidden; border: var(--border); border-radius: var(--radius); background: var(--surface); }
.ob-root .ob-lang button,
.ob-root .ob-lang button:hover:not(:disabled),
.ob-root .ob-lang button:active:not(:disabled) { height: 28px; min-height: 28px; padding: 0 10px; border: 0; border-radius: 0; background: none; box-shadow: none; transform: none; font-size: 12px; font-weight: 700; cursor: pointer; }
.ob-root .ob-lang button.on { background: var(--main); }
.ob-root .ob-close,
.ob-root .ob-close:hover:not(:disabled),
.ob-root .ob-close:active:not(:disabled) { display: grid; place-items: center; width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; background: none; box-shadow: none; transform: none; color: var(--sub); cursor: pointer; }
.ob-root .ob-close:hover:not(:disabled) { color: var(--ink); }
.ob-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }

.ob-view { display: grid; grid-template-rows: 1fr auto; justify-items: center; min-height: calc(100vh - 64px); padding: 0 32px 32px; }
.ob-mid { align-self: center; display: flex; flex-direction: column; align-items: center; width: 100%; padding-bottom: 16px; }
.ob-foot { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 44px; }
.ob-issues { width: min(560px, 100%); margin-bottom: 16px; }
.ob-issues:empty { display: none; }
.ob-issues .pair-error { margin: 0; padding: 12px 14px; border: var(--border); border-left-width: 8px; border-left-color: var(--danger); border-radius: var(--radius); background: var(--surface); color: var(--ink); }

/* ---- controls ---- */
.ob-root .ob-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  min-height: 40px;
  min-width: 120px;
  padding: 0 16px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--main);
  box-shadow: var(--shadow);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s cubic-bezier(.4, 0, .2, 1), box-shadow .15s cubic-bezier(.4, 0, .2, 1);
}
.ob-root .ob-btn:hover:not(:disabled),
.ob-root .ob-btn:active:not(:disabled) { background: var(--main); box-shadow: none; transform: translate(4px, 4px); }
.ob-root .ob-btn.alt,
.ob-root .ob-btn.alt:hover:not(:disabled),
.ob-root .ob-btn.alt:active:not(:disabled) { background: var(--surface); }
.ob-root .ob-btn:disabled { opacity: .45; cursor: default; }
.ob-root .ob-btn.sm { height: 32px; min-height: 32px; min-width: 0; padding: 0 12px; font-size: 13px; }
.ob-arrow { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ob-root .ob-ghost,
.ob-root .ob-ghost:hover:not(:disabled),
.ob-root .ob-ghost:active:not(:disabled) { position: absolute; top: 6px; height: 32px; min-height: 32px; padding: 0 8px; border: 0; background: none; box-shadow: none; transform: none; color: var(--sub); font-weight: 700; cursor: pointer; }
.ob-root .ob-ghost:hover:not(:disabled) { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.ob-ghost.l { left: 0; }
.ob-ghost.r { right: 0; }
.ob-card { border: var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.ob-box { display: inline-grid; flex: none; place-items: center; width: 20px; height: 20px; border: var(--border); border-radius: 4px; background: var(--surface); }
.ob-box svg { width: 14px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.ob-box.on svg { visibility: visible; }
.ob-scan { display: flex; gap: 3px; }
.ob-scan i { width: 8px; height: 8px; background: var(--ink); animation: ob-blink .9s steps(1) infinite; }
.ob-scan i:nth-child(2) { animation-delay: .15s; }
.ob-scan i:nth-child(3) { animation-delay: .3s; }
.ob-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border: var(--border); border-radius: var(--radius); background: var(--main); font-size: 12px; font-weight: 700; white-space: nowrap; }
.ob-tag.bad { background: var(--danger); color: #000; }
.ob-note { margin-top: 14px !important; color: var(--sub); text-align: center; }

/* ---- motion ---- */
.ob-stamp { animation: ob-stamp .24s var(--hard) both; animation-delay: var(--d, 0s); }
.ob-rise { animation: ob-rise .22s var(--hard) both; animation-delay: var(--d, 0s); }
@keyframes ob-stamp { from { opacity: 0; transform: translate(4px, 4px); box-shadow: 0 0 0 0 var(--ink); } 35% { opacity: 1; } }
@keyframes ob-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes ob-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .18; } }
/* Dashes only while drawing: a resting pathLength dash leaves a hairline seam where the outline starts. */
@keyframes ob-draw { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
@keyframes ob-slam { from { opacity: 0; } }
@keyframes ob-fill { from { fill-opacity: 0; } }
@keyframes ob-pop { from { opacity: 0; transform: scale(1.6); } }
@keyframes ob-thud { from { transform: translate(4px, 4px); } }
@keyframes ob-up { from { transform: translateY(105%); } }
@keyframes ob-shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes ob-run { to { background-position: -20px 0; } }
@keyframes ob-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
/* A re-render of the page already on screen does not replay its entrance. */
.ob-quiet .ob-stamp, .ob-quiet .ob-rise, .ob-quiet .ob-word span, .ob-quiet .ob-markwrap, .ob-quiet .ob-mark * { animation: none; }
.ob-skip, .ob-skip * { animation-duration: .01s !important; animation-delay: 0s !important; }
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: ob-wipe .3s cubic-bezier(.2, .9, .25, 1); }

/* ---- welcome and done ---- */
.ob-markwrap { animation: ob-thud .16s var(--hard) both 1.22s; }
.ob-mark { display: block; overflow: visible; }
.ob-mark .m-shadow { fill: var(--ink); animation: ob-slam .1s steps(1) both 1.22s; }
.ob-mark .m-plate { fill: var(--surface); stroke: var(--ink); stroke-width: 5; animation: ob-draw .42s var(--hard) backwards .08s, ob-fill .08s steps(1) both .46s; }
.ob-mark .m-a, .ob-mark .m-b { transform-box: fill-box; transform-origin: center; animation: ob-pop .2s var(--hard) both; }
.ob-mark .m-a { fill: var(--ink); animation-delay: .52s; }
.ob-mark .m-b { fill: var(--main); stroke: var(--ink); stroke-width: 5; animation-delay: .68s; }
.ob-mark .m-c { fill: none; stroke-linecap: round; animation: ob-draw .22s linear backwards; }
.ob-mark .m-c1 { animation-delay: .86s; }
.ob-mark .m-c2 { animation-delay: 1.02s; }
.ob-mark .m-co { stroke: var(--ink); stroke-width: 14; }
.ob-mark .m-ci { stroke: var(--surface); stroke-width: 7; }
.ob-mark .m-j { fill: var(--ink); animation: ob-slam .05s steps(1) both 1.02s; }
.ob-root .ob-word { display: flex; justify-content: center; margin-top: 22px; overflow: hidden; font-size: 34px; line-height: 1.15; }
.ob-word span { display: block; animation: ob-up .18s var(--hard) both; animation-delay: var(--d, 0s); }
.ob-ver { margin-top: 6px; color: var(--sub); font-size: 12px; }
.ob-root .ob-done-title { margin-top: 28px; }

/* ---- theme ---- */
.ob-themes { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-top: 32px; }
.ob-root .ob-tc,
.ob-root .ob-tc:active:not(:disabled) { display: block; width: 216px; min-height: 0; padding: 0; overflow: hidden; border: var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: none; transform: none; text-align: left; cursor: pointer; transition: transform .12s var(--hard), box-shadow .12s var(--hard); }
.ob-root .ob-tc:hover:not(:disabled) { background: var(--surface); box-shadow: var(--shadow-sm); transform: translate(-2px, -2px); }
.ob-root .ob-tc.on,
.ob-root .ob-tc.on:hover:not(:disabled) { box-shadow: var(--shadow); transform: translate(-4px, -4px); }
.ob-pv { position: relative; display: block; border-bottom: var(--border); line-height: 0; }
.ob-pv svg { display: block; width: 100%; height: auto; }
.ob-pv svg + svg { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.ob-lb { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 12px; font-weight: 700; }
.ob-tc.on .ob-lb { background: var(--main); }

/* ---- this computer ---- */
.ob-list { display: flex; flex-direction: column; gap: 12px; width: min(560px, 100%); margin-top: 28px; }
.ob-mid > .ob-list .ob-list { margin-top: 0; }
.ob-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 14px; }
.ob-row b { display: block; font-weight: 700; overflow-wrap: anywhere; }
.ob-row small { display: block; color: var(--sub); font-size: 12px; }
.ob-ic { width: 28px; height: 28px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.ob-grow { flex: 1; min-width: 0; }
.ob-wait { color: var(--sub); font-weight: 700; }
.ob-row.ob-gone { opacity: 0; transform: translateX(-20px); transition: opacity .13s ease-in, transform .13s ease-in; }
.ob-namel { display: flex; align-items: center; gap: 6px; }
.ob-root .ob-help,
.ob-root .ob-help:hover:not(:disabled),
.ob-root .ob-help:active:not(:disabled) { position: relative; display: grid; place-items: center; width: 18px; height: 18px; min-height: 18px; padding: 0; border: var(--border); border-radius: 4px; background: var(--surface); box-shadow: none; transform: none; font-size: 11px; font-weight: 700; line-height: 1; cursor: help; }
.ob-root .ob-help:hover:not(:disabled), .ob-root .ob-help:focus-visible { background: var(--main); outline: 0; }
.ob-tip { position: absolute; bottom: calc(100% + 4px); left: 50%; z-index: 5; width: 292px; padding: 6px 12px; border: var(--border); border-radius: var(--radius); background: var(--surface); font-size: 14px; font-weight: 500; line-height: 1.45; text-align: left; white-space: normal; cursor: default; visibility: hidden; transform: translateX(-50%); }
.ob-help:hover .ob-tip, .ob-help:focus-visible .ob-tip, .ob-help:focus .ob-tip { visibility: visible; }

/* ---- connect ---- */
.ob-cols { display: grid; grid-template-columns: minmax(0, 1fr) 292px; align-items: start; gap: 20px; width: min(800px, 100%); margin-top: 28px; }
.ob-ch { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: var(--border); font-weight: 700; }
.ob-devs { min-height: 118px; }
.ob-devs .ob-row + .ob-row { border-top: var(--border); }
.ob-empty { display: grid; place-items: center; height: 118px; color: var(--sub); }
.ob-ipwrap { border-top: var(--border); }
.ob-root .ob-iptog,
.ob-root .ob-iptog:hover:not(:disabled),
.ob-root .ob-iptog:active:not(:disabled) { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 44px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 0; background: none; box-shadow: none; transform: none; font-weight: 700; cursor: pointer; }
.ob-iptog svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 3; transition: transform .16s var(--hard); }
.ob-ipwrap.open .ob-iptog svg { transform: rotate(180deg); }
.ob-ipbody { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s var(--hard); }
.ob-ipwrap.open .ob-ipbody { grid-template-rows: 1fr; }
.ob-ipbody > div { min-height: 0; overflow: hidden; }
.ob-ipform { display: flex; gap: 8px; padding: 2px 14px 6px; }
.ob-root .ob-ipform input { flex: 1; min-width: 0; height: 40px; min-height: 40px; padding: 0 12px; border: var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: none; outline: 0; font-weight: 500; }
.ob-root .ob-ipform input:focus { box-shadow: var(--shadow-sm); }
.ob-root .ob-ipform .ob-btn { min-width: 72px; }
.ob-root .ob-ipform input.ob-shake { animation: ob-shake .28s steps(5); }
.ob-iperr { min-height: 20px; padding: 0 14px 8px; color: var(--danger); font-size: 12px; font-weight: 700; }
.ob-side { padding: 14px; border: var(--border); border-radius: var(--radius); background: var(--surface); }
.ob-side h3 { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.ob-side ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ob-side li { display: flex; align-items: flex-start; gap: 10px; line-height: 1.4; }
.ob-side li i { display: grid; flex: none; place-items: center; width: 22px; height: 22px; border: var(--border); border-radius: 4px; background: var(--main); font-size: 12px; font-style: normal; font-weight: 700; }
.ob-ip { margin-top: 14px; padding-top: 12px; border-top: var(--border); }
.ob-ip small { display: block; color: var(--sub); font-size: 12px; }
.ob-ip code { font: 700 16px ui-monospace, Menlo, monospace; }
.ob-chk { position: absolute; top: 12px; left: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ob-root .ob-chk input { width: 20px; height: 20px; min-height: 20px; margin: 0; }

/* ---- pair and test ---- */
.ob-link { display: flex; align-items: center; margin-top: 32px; }
.ob-pc { width: 176px; padding: 16px; border: var(--border); border-radius: var(--radius); background: var(--surface); text-align: center; transition: background .1s steps(1), box-shadow .12s var(--hard), transform .12s var(--hard); }
.ob-pc svg { width: 36px; height: 36px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.ob-pc b { display: block; font-weight: 700; overflow-wrap: anywhere; }
.ob-pc small { color: var(--sub); font-size: 12px; }
.ob-pc.on { background: var(--main); box-shadow: var(--shadow); transform: translate(-4px, -4px); }
.ob-cable { width: 96px; height: 14px; border-block: var(--border); background: repeating-linear-gradient(90deg, var(--ink) 0 10px, var(--surface) 10px 20px); background-size: 200% 100%; animation: ob-run .7s linear infinite; }
.ob-cable.ok, .ob-cable.stop { animation: none; }
.ob-cable.ok { background: var(--surface); }
.ob-status { display: flex; align-items: center; gap: 10px; min-height: 28px; margin-top: 28px; font-weight: 700; }
.ob-sas { display: flex; gap: 8px; margin-top: 28px; }
.ob-sas span { display: grid; place-items: center; width: 48px; height: 60px; border: var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); font: 700 28px ui-monospace, Menlo, monospace; }
.ob-sas span:nth-child(3) { margin-right: 12px; }
.ob-sas + .ob-lead { margin-top: 20px !important; }
.ob-alert { width: min(440px, 100%); margin-top: 24px; padding: 12px 14px; border: var(--border); border-left-width: 8px; border-left-color: var(--danger); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.ob-alert b { display: block; font-weight: 700; }
.ob-alert span { color: var(--sub); font-size: 13px; }

@media (max-width: 860px) {
  .ob-cols { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (prefers-reduced-motion: reduce) {
  .ob-root *, .ob-root *::before, .ob-root *::after { animation-duration: .01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
  ::view-transition-new(root) { animation: none; }
}
