/* Account pages: sign-in and connect are one centred column; the cabinet is a full-width page (below). */
#app { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 64px 16px 48px; }
#app.flow-wide { display: block; max-width: none; margin: 0; }
.lang-toggle { position: absolute; top: 18px; right: 20px; z-index: 5; min-width: 52px; }
.lang-toggle.in-bar { position: static; min-width: 0; }
.panel h1 { overflow-wrap: anywhere; }
.panel .card, .panel .hero-card { margin-bottom: 14px; }
.hero-card > * { max-width: none; }
.msg.ok { background: var(--acc-soft); color: var(--ink); border-color: var(--line-acc); }
.msg:empty { display: none; }
.hint { color: var(--ink-3); font-size: 12.5px; margin: 4px 0 0; }

/* ===== The cabinet: a journey page (top bar with tabs, hero with the path, five sections) ===== */
#app.cabinet { display: block; max-width: none; margin: 0; padding: 0; min-height: 100vh; --spring: cubic-bezier(.34, 1.4, .5, 1); }
.cb-serif { font-family: var(--serif); }
.cb-eyebrow { font: var(--eyebrow); letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--faint); }
.cb-eyebrow.is-acc { color: var(--k-acc2); }
.cb-hint { color: var(--faint); font-size: 12px; }
.cb-meta { color: var(--ink-3); font-size: 13px; overflow-wrap: anywhere; }
.cb-empty { margin: 0; padding: 22px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line-strong); border-radius: var(--r-card); }
.cb-grow { flex: 1; min-width: 0; }
.cb-nm { font-weight: 600; overflow-wrap: anywhere; }
.cb-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.cb-dot.is-ok { background: var(--k-ok); box-shadow: 0 0 8px var(--k-ok); }
.cb-dot.is-warn { background: var(--k-warn); }
.cb-dot.is-live { animation: cb-pulse 2s infinite; }
.cb-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 500; white-space: nowrap; background: var(--k-card2); color: var(--ink-3); }
.cb-chip.is-ok { background: color-mix(in srgb, var(--k-ok) 12%, transparent); color: var(--k-ok); }
.cb-chip.is-acc { background: color-mix(in srgb, var(--k-acc) 18%, transparent); color: var(--k-acc2); }
.btn-danger { color: #fff; background: linear-gradient(180deg, #f43f5e, #be123c); border-color: var(--k-bad); }
.btn kbd, .cb-pal-in kbd { margin-left: 4px; font: 10px ui-monospace, Menlo, monospace; color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }

/* the flow editor page keeps the bar; the editor fills the rest */
#app.edit-full { display: block; max-width: none; margin: 0; padding: 0; min-height: 100vh; }
.cb-flowbar { display: flex; justify-content: flex-end; margin: 0 0 10px; }

/* top bar */
.cb-top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 16px; height: 56px; padding: 0 24px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--k-bg) 78%, transparent); backdrop-filter: blur(16px); }
.cb-brand { display: flex; align-items: center; gap: 9px; }
.cb-brand img { border-radius: var(--r-chip); }
.cb-brand b { font: 600 15px var(--serif); }
.cb-tabs { position: relative; display: flex; gap: 2px; margin: 0 auto; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-pill); }
.cb-tabs a { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 14px; border-radius: var(--r-pill); color: var(--ink-3); font-weight: 500; font-size: 13.5px; text-decoration: none; transition: color .2s; }
.cb-tabs a:hover, .cb-tabs a.is-on { color: var(--ink); }
.cb-tabs small { font: 10px ui-monospace, Menlo, monospace; color: var(--faint); }
.cb-tabs small:empty { display: none; }
.cb-pill { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: var(--r-pill); background: color-mix(in srgb, var(--k-acc) 22%, transparent); box-shadow: 0 0 18px -4px var(--glow); transition: left .35s var(--spring), width .35s var(--spring); }
.cb-right { display: flex; align-items: center; gap: 8px; }
.cb-menu { position: relative; }
.cb-avatar { width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; font: 600 11px var(--sans); background: linear-gradient(135deg, var(--k-acc), #4c2f9e); }
.cb-pop { position: absolute; right: 0; top: 42px; width: 260px; display: none; gap: 10px; padding: 14px; border: 1px solid var(--line-acc); border-radius: var(--r-screen); background: color-mix(in srgb, var(--k-deep) 96%, transparent); box-shadow: 0 20px 60px rgba(0, 0, 0, .55); }
.cb-menu.is-on .cb-pop { display: grid; animation: cb-up .2s var(--ease); }
.cb-em { overflow-wrap: anywhere; font-size: 13.5px; }
.cb-provs { display: flex; flex-wrap: wrap; gap: 6px; }

/* page */
.cb-wrap { max-width: 980px; margin: 0 auto; padding: 0 24px 96px; }
.cb-rv { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.cb-rv.is-in { opacity: 1; transform: none; }
.cb-hero { position: relative; padding: 60px 0 8px; text-align: center; }
.cb-grid-bg { position: absolute; inset: 0 -40px; pointer-events: none; opacity: .5; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 70%); }
.cb-hero > * { position: relative; }
.cb-hero > .cb-grid-bg { position: absolute; }
.cb-hero h1 { font: 600 clamp(30px, 5vw, 50px)/1.08 var(--serif); max-width: 760px; margin: 10px auto; text-wrap: balance; }
.cb-hero h1 span { color: var(--k-acc2); }
.cb-hero p { color: var(--ink-3); max-width: 600px; margin: 0 auto 12px; }
.cb-hero .cb-hint { font-size: 12px; margin-bottom: 0; }
.cb-journey { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 34px; text-align: left; }
.cb-journey::before, .cb-journey::after { content: ""; position: absolute; left: 12.5%; top: 30px; height: 2px; }
.cb-journey::before { right: 12.5%; background: var(--line); }
.cb-journey::after { width: calc(var(--p, 0) * 75%); background: linear-gradient(90deg, var(--k-acc-deep), var(--k-acc2)); box-shadow: 0 0 12px var(--glow); transition: width 1.2s var(--ease); }
.cb-jstep { position: relative; z-index: 1; display: grid; gap: 8px; justify-items: center; text-align: center; padding: 0 6px; }
.cb-node { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--k-bg); border: 1px solid var(--line-strong); color: var(--ink-3); transition: .4s var(--spring); }
.cb-jstep.is-done .cb-node { border-color: var(--k-acc); color: #fff; background: linear-gradient(135deg, var(--k-acc), #4c2f9e); box-shadow: 0 0 22px -2px var(--glow); }
.cb-jstep.is-now .cb-node { border-color: var(--k-acc2); color: var(--k-acc2); animation: cb-ring 2s infinite; }
.cb-jstep b { font: 600 14px var(--serif); }
.cb-jstep span:last-child { color: var(--ink-3); font-size: 12px; max-width: 200px; }
.cb-s { padding-top: 56px; scroll-margin-top: 56px; }
.cb-sh { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cb-sh h2 { margin: 0; }
.cb-sh p, .cb-sh-note { margin: 0 0 0 auto; max-width: 420px; text-align: right; color: var(--ink-3); font-size: 13.5px; }
.cb-sub { margin: 26px 0 12px; }
.cb-two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.cb-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cb-grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.cb-list { display: grid; gap: 8px; }
.cb-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-screen); background: linear-gradient(180deg, color-mix(in srgb, var(--k-card2) 72%, transparent), color-mix(in srgb, var(--k-card) 72%, transparent)); transition: border-color .25s, box-shadow .25s, transform .25s var(--ease); }
.cb-card:hover { border-color: var(--line-acc); box-shadow: 0 14px 40px -14px var(--glow); transform: translateY(-2px); }
.cb-card h3 { margin: 0 0 12px; font: var(--eyebrow); letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--faint); }

/* steps and activity */
.cb-steps { display: grid; gap: 16px; }
.cb-step { display: flex; gap: 12px; align-items: flex-start; }
.cb-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 600 11px ui-monospace, Menlo, monospace; border: 1px solid var(--line-strong); color: var(--ink-3); }
.cb-step div { padding-top: 2px; }
.cb-tl { position: relative; display: grid; padding-left: 22px; }
.cb-tl::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(var(--line-acc), var(--line)); }
.cb-ev { position: relative; padding: 0 0 16px; animation: cb-up .5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 60ms); }
.cb-ev:last-child { padding-bottom: 0; }
.cb-ev::before { content: ""; position: absolute; left: -21px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--k-bg); border: 2px solid var(--k-acc2); box-shadow: 0 0 10px var(--glow); }
.cb-ev.ok::before { border-color: var(--k-ok); box-shadow: 0 0 10px color-mix(in srgb, var(--k-ok) 50%, transparent); }
.cb-ev b { font-weight: 600; overflow-wrap: anywhere; }
.cb-ev time { display: block; font: 10.5px ui-monospace, Menlo, monospace; color: var(--faint); margin-top: 1px; }

/* download */
.cb-rel { position: relative; overflow: hidden; isolation: isolate; }
.cb-rel::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse 45% 80% at 88% 40%, color-mix(in srgb, var(--k-acc) 35%, transparent), transparent 70%); }
.cb-relv { font-size: 30px; margin: 4px 0 2px; }
.cb-dl-row { margin-top: 16px; }
.cb-sha { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding: 9px 11px; border-radius: var(--r-chip); border: 1px solid var(--line); background: var(--k-deep); font: 11.5px/1.5 ui-monospace, Menlo, monospace; color: var(--ink-3); overflow-wrap: anywhere; cursor: pointer; transition: color .15s, border-color .15s; }
.cb-sha:hover, .cb-sha:focus-visible { color: var(--k-acc2); border-color: var(--line-acc); }
.cb-sha svg { margin-top: 2px; flex: none; }

/* Macs and flows */
.cb-dev, .cb-flow { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: color-mix(in srgb, var(--k-card) 40%, transparent); color: var(--ink); text-decoration: none; transition: border-color .2s, background .2s, transform .2s var(--ease); animation: cb-up .5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.cb-dev:hover { border-color: var(--line-acc); background: var(--acc-soft); box-shadow: inset 2px 0 0 var(--k-acc2); }
.cb-flow:hover { border-color: var(--line-acc); background: var(--acc-soft); transform: translateX(3px); }
.cb-mac { position: relative; width: 38px; height: 38px; border-radius: var(--r-chip); display: grid; place-items: center; flex: none; background: var(--k-card2); color: var(--k-acc2); }
.cb-mac .cb-dot { position: absolute; right: -2px; top: -2px; width: 11px; height: 11px; border: 2px solid var(--k-bg); }
.cb-del:hover { color: var(--k-bad); }
.is-gone { animation: cb-gone .35s var(--ease) forwards; overflow: hidden; }
.cb-pips { display: inline-flex; gap: 3px; align-items: center; flex: none; }
.cb-pips i { width: 14px; height: 4px; border-radius: 3px; background: var(--k-acc2); opacity: .85; }
.cb-pips i.is-off { background: var(--line-strong); opacity: 1; }
.cb-tpl { display: flex; flex-direction: column; gap: 8px; animation: cb-up .5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.cb-tpl .cb-nm { font-size: 15px; }
.cb-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.cb-about b { display: block; font: 600 15px var(--serif); margin: 8px 0 4px; }
.cb-about p { margin: 0; color: var(--ink-3); font-size: 13px; }
.cb-ic { width: 30px; height: 30px; border-radius: var(--r-chip); display: grid; place-items: center; background: color-mix(in srgb, var(--k-acc) 16%, transparent); color: var(--k-acc2); }

/* dialog, toast, palette */
.cb-modal-wrap { position: fixed; inset: 0; z-index: 105; display: flex; align-items: center; justify-content: center; background: rgba(5, 3, 9, .62); backdrop-filter: blur(6px); animation: cb-fade .15s; }
.cb-modal { width: min(420px, 92vw); padding: 22px; border: 1px solid var(--line-acc); border-radius: var(--r-screen); background: color-mix(in srgb, var(--k-deep) 97%, transparent); box-shadow: 0 30px 90px rgba(0, 0, 0, .65), 0 0 60px -20px var(--glow); animation: cb-up .22s var(--ease); }
.cb-modal h3 { margin: 0 0 6px; font: 600 18px/1.3 var(--serif); overflow-wrap: anywhere; }
.cb-modal p { margin: 0 0 18px; color: var(--ink-3); }
.cb-modal-row { display: flex; gap: 8px; justify-content: flex-end; }
.cb-toast { position: fixed; z-index: 110; right: 20px; top: 20px; display: flex; gap: 9px; align-items: center; padding: 10px 14px; border: 1px solid var(--line-acc); border-radius: var(--r-card); background: color-mix(in srgb, var(--k-card) 96%, transparent); box-shadow: 0 14px 40px rgba(0, 0, 0, .5); animation: cb-slide .3s var(--ease); transition: opacity .3s; }
.cb-toast.is-out { opacity: 0; }
.cb-pal-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh; background: rgba(5, 3, 9, .62); backdrop-filter: blur(6px); animation: cb-fade .15s; }
.cb-pal { width: min(600px, 92vw); border: 1px solid var(--line-acc); border-radius: var(--r-screen); background: color-mix(in srgb, var(--k-deep) 96%, transparent); box-shadow: 0 30px 90px rgba(0, 0, 0, .65), 0 0 60px -20px var(--glow); overflow: hidden; animation: cb-up .22s var(--ease); }
.cb-pal-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 52px; border-bottom: 1px solid var(--line); color: var(--acc); }
.cb-pal-in input { flex: 1; height: 100%; border: 0; background: none; box-shadow: none; padding: 0; font-size: 15px; }
.cb-pal-list { max-height: 340px; overflow-y: auto; padding: 6px; }
.cb-pal-group { padding: 10px 10px 4px; font: var(--eyebrow); letter-spacing: var(--track-eyebrow); text-transform: uppercase; color: var(--faint); }
.cb-pal-item { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: var(--r-chip); color: var(--ink-3); cursor: pointer; }
.cb-pal-item.is-cur, .cb-pal-item:hover { background: var(--acc-hover); color: var(--ink); }
.cb-pal-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11px; }

@keyframes cb-up { from { opacity: 0; transform: translateY(10px); } }
@keyframes cb-fade { from { opacity: 0; } }
@keyframes cb-slide { from { opacity: 0; transform: translateX(24px); } }
@keyframes cb-pulse { 50% { opacity: .35; } }
@keyframes cb-ring { 50% { box-shadow: 0 0 0 6px transparent; } 0%, 100% { box-shadow: 0 0 0 0 var(--glow); } }
@keyframes cb-gone { to { opacity: 0; transform: translateX(24px); max-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; border-width: 0; } }
@media (max-width: 860px) {
  .cb-two, .cb-grid3, .cb-grid2, .cb-journey { grid-template-columns: 1fr; }
  .cb-journey::before, .cb-journey::after { display: none; }
  .cb-tabs small { display: none; }
  .cb-sh p, .cb-sh-note { margin: 0; text-align: left; }
}
@media (max-width: 640px) { .cb-top { height: auto; flex-wrap: wrap; gap: 8px 12px; padding: 8px 14px; } .cb-tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; } .cb-tabs a { flex: none; } .cb-brand .cb-chip { display: none; } .cb-right { margin-left: auto; } .cb-s { scroll-margin-top: 110px; } }
@media (prefers-reduced-motion: reduce) { #app.cabinet *, .cb-modal-wrap, .cb-pal-wrap, .cb-toast { animation: none !important; transition: none !important; } .cb-rv { opacity: 1; transform: none; } }

/* The templates a new flow can start from. */
.cb-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 0 0 16px; }
.cb-tpls[hidden] { display: none; }
.cb-tpl { display: grid; gap: 4px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-chip); background: color-mix(in srgb, var(--k-card) 70%, transparent); color: var(--ink); cursor: pointer; font: inherit; }
.cb-tpl:hover { border-color: var(--line-acc); background: var(--acc-soft); }
.cb-tpl b { font-size: 14px; }
.cb-tpl span { font-size: 12.5px; color: var(--ink-3); }
.cb-tpl small { font: 11px var(--mono); color: var(--faint); }
