/* CasaTorch Docs */
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/fonts/inter-var.woff2) format("woff2"); }
:root {
  --bg: #070a13; --panel: #0d1220; --panel2: #121a2c; --text: #e8eef9; --muted: #9aa8c0; --faint: #7d8aa2; --line: rgba(160, 190, 240, .13);
  --sky: #38bdf8; --violet: #8b7bff; --amber: #fbbf24; --good: #34d399; --bad: #f87171;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16.5px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--sky); text-underline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* top bar */
.dtop { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; height: 64px; padding: 0 20px; background: rgba(7, 10, 19, .86); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.dlogo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -.02em; white-space: nowrap; }
.dlogo em { font-style: normal; font-weight: 600; color: var(--sky); }
.dmenu { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 10px; width: 40px; height: 40px; font-size: 18px; cursor: pointer; }
.dsearch { position: relative; flex: 1; max-width: 480px; margin-left: 24px; }
.dsearch input { width: 100%; padding: 10px 40px 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 15px var(--font); outline: none; }
.dsearch input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(56, 189, 248, .18); }
.dsearch kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
kbd { font: 12px var(--mono); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); }
.dresults { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); width: min(640px, calc(100% - 32px)); max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); padding: 8px; }
.dresults a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.dresults a:hover, .dresults a.on { background: var(--panel2); }
.dresults small { display: block; color: var(--muted); font-size: 13px; }
.dresults p { margin: 10px 12px; color: var(--muted); }
.dsite { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; }

/* layout */
.dwrap { display: grid; grid-template-columns: 270px minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.dnav { position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px); overflow: auto; padding: 24px 14px 40px 20px; border-right: 1px solid var(--line); }
.dn-group { margin-bottom: 20px; }
.dn-group b { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 0 0 6px 10px; }
.dn-group a { display: block; padding: 6px 10px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 15px; }
.dn-group a:hover { color: var(--text); background: var(--panel); }
.dn-group a.on { color: var(--text); background: linear-gradient(90deg, rgba(56, 189, 248, .16), rgba(139, 123, 255, .08)); box-shadow: inset 2px 0 0 var(--sky); }
.dlock { font-size: 12.5px; color: var(--amber); margin: 24px 10px 0; }
.dmain { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 40px; padding: 36px clamp(18px, 4vw, 56px) 80px; }
.dart { max-width: 820px; min-width: 0; }
.dtoc { position: sticky; top: 96px; align-self: start; font-size: 14px; border-left: 1px solid var(--line); padding-left: 16px; }
.dtoc b { display: block; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.dtoc a { display: block; color: var(--muted); text-decoration: none; padding: 4px 0; }
.dtoc a:hover, .dtoc a.on { color: var(--text); }

/* type */
.dart h1 { font-size: clamp(32px, 4vw, 44px); letter-spacing: -.035em; line-height: 1.1; margin: 0 0 10px; }
.dsum { font-size: 19px; color: var(--muted); margin: 0 0 28px; }
.dart h2 { font-size: 26px; letter-spacing: -.02em; margin: 48px 0 12px; padding-top: 6px; }
.dart h3 { font-size: 19px; margin: 30px 0 8px; }
.dart p, .dart li { color: #cdd6e6; }
.dart strong, .dart b { color: var(--text); }
.dart code { font: 14px var(--mono); background: var(--panel2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; color: var(--text); }
.dart ul { padding-left: 22px; } .dart li { margin: 4px 0; }
.ui { font-weight: 600; color: var(--text); background: rgba(56, 189, 248, .1); border: 1px solid rgba(56, 189, 248, .3); padding: 1px 7px; border-radius: 7px; white-space: nowrap; font-size: .95em; }

/* callouts */
.callout { margin: 20px 0; padding: 14px 18px 14px 50px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); position: relative; }
.callout::before { position: absolute; left: 16px; top: 13px; font-size: 18px; }
.callout p { margin: 4px 0; }
.callout.tip { border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .06); } .callout.tip::before { content: '💡'; }
.callout.note { border-color: rgba(56, 189, 248, .35); background: rgba(56, 189, 248, .06); } .callout.note::before { content: 'ℹ️'; }
.callout.warn { border-color: rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .07); } .callout.warn::before { content: '⚠️'; }
.callout.pro { border-color: rgba(139, 123, 255, .45); background: rgba(139, 123, 255, .08); } .callout.pro::before { content: '✦'; color: var(--violet); }

/* steps */
ol.steps { list-style: none; counter-reset: s; padding: 0; margin: 22px 0; }
ol.steps > li { counter-increment: s; position: relative; padding: 2px 0 18px 54px; margin: 0; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #04111c; background: linear-gradient(135deg, #7dd3fc, #8b7bff); }
ol.steps > li:not(:last-child)::after { content: ''; position: absolute; left: 17px; top: 42px; bottom: 4px; width: 2px; background: var(--line); }
ol.steps > li > b:first-child { display: block; font-size: 17.5px; margin-bottom: 2px; }

/* media */
figure.vid, figure.dia { margin: 26px 0; }
figure.vid video { width: 100%; border-radius: 16px; border: 1px solid var(--line); background: #000; box-shadow: 0 30px 80px -30px rgba(56, 189, 248, .35); display: block; }
figure.dia .dbox { border-radius: 16px; border: 1px solid var(--line); background: radial-gradient(120% 120% at 0 0, rgba(56, 189, 248, .08), transparent 60%), var(--panel); padding: 18px; overflow: auto; }
figure.dia svg { display: block; width: 100%; height: auto; min-width: 560px; }
figure figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; text-align: center; }
.dart img { max-width: 100%; height: auto; }
.shot { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); display: block; margin: 18px 0; }

/* tables */
.tblwrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 14px; }
table.dt { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 640px; }
.dt th, .dt td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.dt th { background: var(--panel); color: var(--text); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; position: sticky; top: 0; }
.dt tr:last-child td { border-bottom: 0; }
.dt td:first-child { font-weight: 600; color: var(--text); }
#compat th:nth-child(1), #compat td:nth-child(1) { width: 20%; } #compat th:nth-child(2), #compat td:nth-child(2) { width: 15%; } #compat th:nth-child(3), #compat td:nth-child(3) { width: 35%; }
#compat td:nth-child(2) .b { margin-bottom: 4px; }
.dt tr.cat td { background: rgba(56, 189, 248, .06); color: var(--sky); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.b { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; margin: 1px 4px 1px 0; }
.b-built { color: #6ee7b7; background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .35); }
.b-ha { color: #7dd3fc; background: rgba(56, 189, 248, .1); border: 1px solid rgba(56, 189, 248, .35); }
.b-pro { color: #c4b5fd; background: rgba(139, 123, 255, .12); border: 1px solid rgba(139, 123, 255, .4); }
.b-soon { color: #fcd34d; background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .35); }
.b-no { color: #fca5a5; background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .35); }
.b-labs { color: #fdba74; background: rgba(251, 146, 60, .1); border: 1px solid rgba(251, 146, 60, .35); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; align-items: center; }
.filters button { font: 600 14px var(--font); padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.filters button.on { color: var(--text); border-color: var(--sky); background: rgba(56, 189, 248, .12); }
.filters input { flex: 1 1 200px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 14px var(--font); }

/* tabs */
.tabs { margin: 22px 0; }
.tabs [role=tablist] { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs [role=tab] { font: 600 14.5px var(--font); padding: 9px 14px; border: 0; background: none; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs [role=tab][aria-selected=true] { color: var(--text); border-bottom-color: var(--sky); }

/* cards */
.dcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 22px 0; }
.dcards a { display: block; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s; }
.dcards a:hover { border-color: var(--sky); transform: translateY(-2px); }
.dcards b { display: block; font-size: 16.5px; margin-bottom: 4px; } .dcards span { color: var(--muted); font-size: 14.5px; }
.dcards i { font-style: normal; font-size: 22px; display: block; margin-bottom: 8px; }

/* prev/next + footer */
.dpn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 56px 0 20px; }
.dpn a { padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--text); font-weight: 600; }
.dpn a:hover { border-color: var(--sky); } .dpn small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.dpn .next { grid-column: 2; text-align: right; }
.dfeed { color: var(--faint); font-size: 14px; border-top: 1px solid var(--line); padding-top: 18px; }

/* animated diagrams: elements with data-step appear one after another; the .play class runs it */
.anim [data-step] { opacity: 1; transition: opacity .5s, transform .5s; }
.anim.play [data-step] { animation: dstep 9s infinite; }
@keyframes dstep { 0% { opacity: .15; } 6%, 92% { opacity: 1; } 100% { opacity: .15; } }
.anim .pulse { animation: dpulse 1.6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes dpulse { 50% { opacity: .35; } }
.anim .flow { stroke-dasharray: 6 8; animation: dflow 1.2s linear infinite; }
@keyframes dflow { to { stroke-dashoffset: -28; } }
.replay { font: 600 13px var(--font); margin-top: 10px; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .anim [data-step], .anim .pulse, .anim .flow { animation: none !important; opacity: 1 !important; } }

@media (max-width: 1180px) { .dmain { grid-template-columns: minmax(0, 1fr); } .dtoc { display: none; } }
@media (max-width: 880px) {
  .dwrap { grid-template-columns: 1fr; }
  .dmenu { display: block; }
  .dnav { position: fixed; z-index: 40; top: 64px; left: 0; width: 290px; background: var(--bg); transform: translateX(-100%); transition: transform .25s; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  body.navopen .dnav { transform: none; }
  .dsearch { margin-left: 0; } .dsearch kbd, .dsite { display: none; }
  .dlogo span { display: none; }
  .dpn { grid-template-columns: 1fr; } .dpn .next { grid-column: 1; }
}

/* our video controls (the how-to videos are silent) */
.vwrap { position: relative; }
.vwrap video { cursor: pointer; }
.vbar { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(5, 8, 16, .72); backdrop-filter: blur(8px); color: #e8eef7; opacity: .0; transition: opacity .2s; }
.vwrap:hover .vbar, .vwrap:focus-within .vbar, .vwrap video[paused] + .vbar { opacity: 1; }
@media (hover: none) { .vbar { opacity: 1; } }
.vbar button { all: unset; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font-size: 14px; }
.vbar button:hover, .vbar button:focus-visible { background: rgba(255, 255, 255, .12); }
.vprog { flex: 1; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .18); cursor: pointer; position: relative; }
.vprog i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: linear-gradient(90deg, #5eb8ff, #8b7bff); }
.vnote { font-size: 11px; color: #9fb0c5; white-space: nowrap; }
:fullscreen.vwrap video { height: 100%; object-fit: contain; border-radius: 0; }

/* One-off looks that were style="" attributes (the CSP allows no inline styles). */
.du-1 { font-weight:400 !important; white-space:normal !important; color:var(--muted) !important; }
.du-2 { font-size:14px !important; color:var(--faint) !important; }
.du-3 { height:auto !important; }
.du-4 { max-width:300px !important; }

/* From docs-src/help/remote-access.html (the CSP allows no inline <style>). */
.ra-wrap { container-type: inline-size; margin: 26px 0; }
.ra-box { border-radius: 16px; border: 1px solid var(--line); background: radial-gradient(120% 120% at 0 0, rgba(56, 189, 248, .08), transparent 60%), var(--panel); padding: 18px; }
.ra-flow { display: flex; align-items: stretch; }
.ra-node { flex: 1 1 0; min-width: 0; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel2); }
.ra-node b { display: block; font-size: 15px; line-height: 1.3; margin-bottom: 4px; }
.ra-node span { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.ra-node i { font-style: normal; display: block; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 5px; color: var(--sky); }
.ra-node.cf { border-color: rgba(251, 191, 36, .45); } .ra-node.cf i { color: var(--amber); }
.ra-node.ct { border: 2px solid var(--sky); } .ra-node.cfd i, .ra-node.ct i { color: var(--good); }
.ra-link { flex: 0 0 92px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 0 6px; gap: 6px; }
.ra-link .ra-txt { display: flex; flex-direction: column; gap: 2px; }
.ra-link b { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--good); line-height: 1.25; }
.ra-link small { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.ra-line { position: relative; width: 100%; height: 2px; background: var(--good); }
.ra-line::after { content: ''; position: absolute; right: -2px; top: -5px; border-left: 9px solid var(--good); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.ra-line.out::after { right: auto; left: -2px; border-left: 0; border-right: 9px solid var(--good); }
.ra-line.in { background: var(--faint); } .ra-line.in::after { border-left-color: var(--faint); }
.ra-home { flex: 2.15 1 0; min-width: 0; display: flex; position: relative; border: 1.5px dashed var(--sky); border-radius: 18px; padding: 30px 10px 10px; background: rgba(56, 189, 248, .04); }
.ra-home > em { position: absolute; left: 14px; top: 8px; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--sky); }
.ra-home .ra-link { flex-basis: 34px; padding: 0 4px; }
.ra-home .ra-link .ra-txt { display: none; }
.ra-link { flex-basis: 96px; }
.ra-side { margin-top: 14px; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1.5px dashed var(--line); color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.ra-side b { color: var(--text); }
.ra-cap { color: var(--muted); font-size: 14px; margin-top: 10px; }
@container (max-width: 680px) {
  .ra-flow, .ra-home { flex-direction: column; }
  .ra-home { padding: 30px 10px 10px; }
  .ra-link, .ra-home .ra-link { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; padding: 8px 0 8px 22px; gap: 12px; min-height: 56px; text-align: left; }
  .ra-home .ra-link .ra-txt { display: flex; }
  .ra-line { width: 2px; height: 42px; flex: none; }
  .ra-line::after { right: auto; top: auto; bottom: -2px; left: -5px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid var(--good); border-bottom: 0; }
  .ra-line.out::after { bottom: auto; top: -2px; left: -5px; border-top: 0; border-bottom: 9px solid var(--good); border-left: 6px solid transparent; border-right: 6px solid transparent; }
  .ra-line.in::after { border-left-color: transparent; border-top-color: var(--faint); }
}
.ra-who { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.ra-who div { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.ra-who > div > b { display: block; font-size: 15.5px; margin-bottom: 6px; }
.ra-who ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.ra-who li { margin: 3px 0; }
.ra-who .yes { color: var(--text); }
@media (max-width: 640px) { .ra-who { grid-template-columns: 1fr; } }
.ra-faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin: 10px 0; padding: 0 16px; }
.ra-faq summary { cursor: pointer; font-weight: 700; padding: 13px 0; list-style-position: inside; }
.ra-faq details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.ra-faq details p, .ra-faq details ul { margin: 8px 0 14px; }

/* From docs-src/help/security.html (the CSP allows no inline <style>). */
.sx-dia text { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.sx-dia .t { fill: var(--text); font-weight: 700; font-size: 14px; }
.sx-dia .s { fill: var(--muted); font-size: 12px; }
.sx-dia .k { font-size: 11.5px; font-weight: 700; }
.sx-dia .card { fill: var(--panel2); stroke: var(--line); stroke-width: 1.5; }
.sx-dia .box { fill: var(--panel2); stroke: var(--sky); stroke-width: 2; }
.sx-dia .vault { fill: var(--bg); stroke: var(--good); stroke-width: 1.5; }
.sx-dia .home { fill: rgba(56, 189, 248, .04); stroke: var(--sky); stroke-width: 1.5; stroke-dasharray: 7 6; }
.sx-dia .soon { fill: var(--panel2); stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 5 5; }
.sx-dia .ln { stroke: var(--sky); stroke-width: 2; fill: none; }
.sx-dia .ln.g { stroke: var(--good); } .sx-dia .ln.a { stroke: var(--amber); stroke-dasharray: 5 5; } .sx-dia .ln.m { stroke: var(--faint); }
.sx-dia .good { fill: var(--good); } .sx-dia .sky { fill: var(--sky); } .sx-dia .amb { fill: var(--amber); } .sx-dia .vio { fill: var(--violet); }
.sx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.sx-grid div { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.sx-grid b { display: block; font-size: 15.5px; margin-bottom: 4px; }
.sx-grid span { color: var(--muted); font-size: 14px; line-height: 1.5; display: block; }
.sx-grid i { font-style: normal; display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--good); margin-bottom: 6px; }
@media (max-width: 640px) { .sx-grid { grid-template-columns: 1fr; } }
/* social links (page footer) */
.dfoot { margin-top: 10px; }
.social { display: flex; flex-wrap: wrap; gap: 6px; margin-left: -7px; }
.social a { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: var(--faint); transition: color .2s, background-color .2s; }
.social a:hover, .social a:focus-visible { color: var(--text); background: var(--panel2); }
.social svg { display: block; width: 18px; height: 18px; }
/* phones: long menu paths (Settings › Health › ...) may wrap */
@media (max-width: 600px) { .ui { white-space: normal; } }
