/* NightTools v0.2.1 — UI stabilization shell */
:root{
  --nt2-header-h:68px;
  --nt2-rail-w:74px;
  --nt2-panel-w:264px;
  --nt2-left-offset:var(--nt2-rail-w);
  --nt2-bg:#0f1013;
  --nt2-surface:#15161a;
  --nt2-surface-2:#1a1b20;
  --nt2-surface-3:#202126;
  --nt2-text:#fcfcfd;
  --nt2-muted:#b7b8c2;
  --nt2-muted-2:#8d909b;
  --nt2-line:#292a31;
  --nt2-line-strong:#3a3b44;
  --nt2-shadow:0 20px 70px rgba(0,0,0,.34);
  --nt2-brand:#ef4658;
  --nt2-service-color:#ef4658;
  --nt2-radius:12px;
  /* v0.1 compatibility aliases while service CSS is being retired */
  --nt-bg:var(--nt2-bg);--nt-surface:var(--nt2-surface);--nt-surface-2:var(--nt2-surface-2);--nt-surface-3:var(--nt2-surface-3);--nt-text:var(--nt2-text);--nt-muted:var(--nt2-muted);--nt-muted-2:var(--nt2-muted-2);--nt-line:var(--nt2-line);--nt-line-strong:var(--nt2-line-strong);--nt-header-h:var(--nt2-header-h);--nt-rail-w:var(--nt2-rail-w);--nt-panel-w:var(--nt2-panel-w);
  color-scheme:dark;
}

html[data-theme="light"]{
  color-scheme:light;
  --nt2-bg:#f5f6f8;--nt2-surface:#fff;--nt2-surface-2:#f0f1f4;--nt2-surface-3:#e8eaf0;
  --nt2-text:#15171c;--nt2-muted:#5f6470;--nt2-muted-2:#7b808d;--nt2-line:#d9dce3;--nt2-line-strong:#c3c7d1;
  --nt2-shadow:0 18px 56px rgba(20,24,34,.13);
}
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="light"],html[data-theme="light"] body{background:#f5f6f8;color:#15171c}
html[data-theme="dark"],html[data-theme="dark"] body{background:#0f1013;color:#fcfcfd}



/* ===== NightTools v0.3.5 — first-paint geometry / FOUC guard ===== */
html[data-nt-sidebar="collapsed"]{--nt2-left-offset:var(--nt2-rail-w)}

/* Hide each service's legacy chrome before shell.js mounts the NightTools chrome. */
html.nt3-preboot[data-nt-service="text"] body .site-header,
html.nt3-preboot[data-nt-service="text"] body .sidebar,
html.nt3-preboot[data-nt-service="text"] body .site-footer,
html.nt3-preboot[data-nt-service="image"] body .nt-header,
html.nt3-preboot[data-nt-service="image"] body .nt-sidebar,
html.nt3-preboot[data-nt-service="image"] body .nt-sidebar-backdrop,
html.nt3-preboot[data-nt-service="image"] body .nt-footer,
html.nt3-preboot[data-nt-service="code"] body .topbar,
html.nt3-preboot[data-nt-service="code"] body .sidebar,
html.nt3-preboot[data-nt-service="code"] body .nt-global-rail,
html.nt3-preboot[data-nt-service="calc"] body .site-header,
html.nt3-preboot[data-nt-service="calc"] body .sidebar,
html.nt3-preboot[data-nt-service="calc"] body .mobile-menu-btn{display:none!important}

/* Match the final NightTools geometry before DOMContentLoaded to prevent category -> tool jumps. */
html[data-nt-service="text"] body .site-body{padding-left:var(--nt2-left-offset)!important;padding-top:var(--nt2-header-h)!important;display:block!important}
html[data-nt-service="text"] body .main-area{min-width:0!important}
html[data-nt-service="text"] body .content-wrap{width:min(1120px,calc(100% - 48px))!important;margin-inline:auto!important}
html[data-nt-service="image"] body .nt-shell{padding-left:var(--nt2-left-offset)!important;padding-top:var(--nt2-header-h)!important;display:block!important;min-height:100vh}
html[data-nt-service="image"] body .nt-page{min-width:0!important}
html[data-nt-service="image"] body main{width:min(1120px,calc(100% - 48px))!important;margin-inline:auto!important}
html[data-nt-service="calc"] body .site-shell{padding-left:var(--nt2-left-offset)!important;padding-top:var(--nt2-header-h)!important;max-width:none!important;margin:0!important}
html[data-nt-service="calc"] body .layout{display:block!important}
html[data-nt-service="calc"] body .content{width:min(1120px,calc(100% - 48px))!important;max-width:none!important;margin-inline:auto!important;padding-top:42px!important}
html[data-nt-service="calc"] body .breadcrumbs{width:min(1120px,calc(100% - 48px))!important;max-width:none!important;margin-inline:auto!important;padding-left:0!important}
html[data-nt-service="code"] body .content{margin-left:var(--nt2-left-offset)!important}
html[data-nt-service="code"][data-nt-tool-page="1"] body .content{padding-top:calc(var(--nt2-header-h) + 46px)!important}

@media(max-width:860px){
  html[data-nt-service="text"] body .site-body,html[data-nt-service="image"] body .nt-shell,html[data-nt-service="calc"] body .site-shell{padding-left:0!important;padding-top:116px!important}
  html[data-nt-service="code"] body .content{margin-left:0!important}
  html[data-nt-service="code"][data-nt-tool-page="1"] body .content{padding-top:160px!important}
  html[data-nt-service="text"] body .content-wrap,html[data-nt-service="image"] body main,html[data-nt-service="calc"] body .content,html[data-nt-service="calc"] body .breadcrumbs{width:min(100% - 28px,1120px)!important}
}

*{box-sizing:border-box}
body.nt2-shell-ready{background:var(--nt2-bg)!important;color:var(--nt2-text);font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;--nt-panel-w:var(--nt2-panel-w);--nt-rail-w:var(--nt2-rail-w);--nt-header-h:var(--nt2-header-h)}
body.nt2-sidebar-collapsed,body.nt2-no-tool-panel{--nt2-left-offset:var(--nt2-rail-w)}
body.nt2-light{color-scheme:light;--nt2-bg:#f5f6f8;--nt2-surface:#fff;--nt2-surface-2:#f0f1f4;--nt2-surface-3:#e8eaf0;--nt2-text:#15171c;--nt2-muted:#5f6470;--nt2-muted-2:#7b808d;--nt2-line:#d9dce3;--nt2-line-strong:#c3c7d1;--nt2-shadow:0 18px 56px rgba(20,24,34,.13)}
a{color:inherit}
.nt2-header svg,.nt2-rail svg,.nt2-tool-panel svg,.nt2-footer svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Header */
.nt2-header{position:fixed;z-index:2000;left:0;right:0;top:0;height:var(--nt2-header-h);display:flex;align-items:center;justify-content:space-between;gap:18px;padding:0 18px;border-bottom:1px solid var(--nt2-line);background:color-mix(in srgb,var(--nt2-surface) 94%,transparent);backdrop-filter:blur(18px)}
.nt2-header-left,.nt2-header-actions,.nt2-brand,.nt2-section-chip,.nt2-runtime-chip{display:flex;align-items:center}.nt2-header-left{gap:10px;min-width:0}.nt2-header-actions{justify-content:flex-end;gap:9px}
.nt2-menu-button,.nt2-icon-button{width:40px;height:40px;flex:0 0 40px;display:grid;place-items:center;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--nt2-muted);cursor:pointer}.nt2-menu-button:hover,.nt2-icon-button:hover{border-color:var(--nt2-line);background:var(--nt2-surface-2);color:var(--nt2-text)}
.nt2-brand{gap:10px;text-decoration:none;color:var(--nt2-text);white-space:nowrap}.nt2-brand strong{font-size:16px;font-weight:900;letter-spacing:-.035em}
.nt2-logo-mark{width:34px;height:34px;position:relative;display:grid;place-items:center;border:1px solid var(--nt2-line);border-radius:11px;background:var(--nt2-surface-2);overflow:hidden}.nt2-logo-crescent{position:relative;width:22px;height:22px;border-radius:50%;background:linear-gradient(135deg,#ff6475,var(--nt2-brand));box-shadow:0 7px 20px rgba(239,70,88,.22)}.nt2-logo-crescent:after{content:"";position:absolute;width:21px;height:21px;border-radius:50%;left:8px;top:-5px;background:var(--nt2-surface-2)}
.nt2-section-chip{height:38px;gap:8px;max-width:220px;padding:0 11px;border:1px solid color-mix(in srgb,var(--nt2-service) 28%,var(--nt2-line));border-radius:10px;background:color-mix(in srgb,var(--nt2-service) 8%,var(--nt2-surface-2));color:var(--nt2-text);--nt2-service:var(--nt2-service-color)}.nt2-section-chip-icon{display:grid;place-items:center;color:var(--nt2-service)}.nt2-section-chip-icon svg{width:18px;height:18px}.nt2-section-chip-copy{min-width:0;display:flex;flex-direction:column;line-height:1.05}.nt2-section-chip-copy strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nt2-section-chip-copy small{margin-top:3px;color:var(--nt2-muted-2);font-size:8px;font-weight:800;letter-spacing:.035em}
.nt2-runtime-chip{height:36px;gap:7px;padding:0 11px;border:1px solid var(--nt2-line);border-radius:10px;background:var(--nt2-surface-2);color:var(--nt2-muted);font-size:10px;font-weight:800;white-space:nowrap}.nt2-runtime-chip svg{width:16px;height:16px;color:var(--nt2-service-color)}

/* Global centered search */
.nt2-search-wrap{position:absolute;left:50%;top:13px;transform:translateX(-50%);width:min(600px,38vw)}.nt2-search{height:42px;display:flex;align-items:center;gap:10px;padding:0 12px;border:1px solid var(--nt2-line);border-radius:11px;background:var(--nt2-surface-2);color:var(--nt2-muted-2);transition:.15s}.nt2-search:focus-within{border-color:color-mix(in srgb,var(--nt2-service-color) 45%,var(--nt2-line));box-shadow:0 0 0 3px color-mix(in srgb,var(--nt2-service-color) 10%,transparent)}.nt2-search svg{width:18px;height:18px;flex:0 0 auto}.nt2-search input{min-width:0;width:100%;border:0;outline:0;background:transparent;color:var(--nt2-text);font:inherit;font-size:13px}.nt2-search input::placeholder{color:var(--nt2-muted-2)}.nt2-search kbd{border:1px solid var(--nt2-line);border-bottom-color:var(--nt2-line-strong);border-radius:6px;padding:3px 6px;background:var(--nt2-surface);color:var(--nt2-muted-2);font:700 9px/1.2 inherit;white-space:nowrap}
.nt2-search-results{position:absolute;z-index:2050;left:0;right:0;top:49px;max-height:min(520px,72vh);overflow:auto;padding:6px;border:1px solid var(--nt2-line-strong);border-radius:13px;background:var(--nt2-surface);box-shadow:var(--nt2-shadow)}.nt2-search-item{--nt2-item-color:#fff;position:relative;min-height:54px;display:grid;grid-template-columns:3px 34px minmax(0,1fr) auto;align-items:center;gap:10px;padding:7px 10px 7px 6px;border-radius:9px;text-decoration:none;color:var(--nt2-text)}.nt2-search-item:hover,.nt2-search-item.selected{background:var(--nt2-surface-2)}.nt2-search-accent{align-self:stretch;border-radius:999px;background:var(--nt2-item-color);box-shadow:0 0 15px color-mix(in srgb,var(--nt2-item-color) 28%,transparent)}.nt2-search-icon{width:32px;height:32px;display:grid;place-items:center;border:1px solid color-mix(in srgb,var(--nt2-item-color) 34%,var(--nt2-line));border-radius:9px;background:color-mix(in srgb,var(--nt2-item-color) 9%,var(--nt2-surface-2));color:var(--nt2-item-color)}.nt2-search-icon svg{width:17px;height:17px}.nt2-search-copy{display:flex;flex-direction:column;min-width:0}.nt2-search-copy strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nt2-search-copy small{margin-top:3px;color:var(--nt2-muted-2);font-size:9px}.nt2-search-service{padding:4px 6px;border:1px solid color-mix(in srgb,var(--nt2-item-color) 32%,var(--nt2-line));border-radius:999px;background:color-mix(in srgb,var(--nt2-item-color) 8%,var(--nt2-surface));color:var(--nt2-item-color);font-size:8px;font-weight:900;letter-spacing:.04em}.nt2-search-empty{padding:22px;color:var(--nt2-muted-2);text-align:center;font-size:12px}

/* Two-level Telepot style navigation */
.nt2-rail{position:fixed;z-index:1900;left:0;top:var(--nt2-header-h);bottom:0;width:var(--nt2-rail-w);padding:10px 8px;display:flex;flex-direction:column;gap:5px;border-right:1px solid var(--nt2-line);background:#111216}.nt2-light .nt2-rail{background:#f0f1f4}.nt2-rail a{text-decoration:none}
.nt2-rail-home,.nt2-rail-item{min-height:50px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:1px solid transparent;border-radius:12px;color:var(--nt2-muted-2);transition:.14s}.nt2-rail-home:hover,.nt2-rail-item:hover{background:var(--nt2-surface-2);border-color:var(--nt2-line);color:var(--nt2-text)}.nt2-rail-home.active,.nt2-rail-item.active{background:color-mix(in srgb,var(--nt2-service-color) 12%,var(--nt2-surface-2));border-color:color-mix(in srgb,var(--nt2-service-color) 42%,var(--nt2-line));color:var(--nt2-text)}.nt2-rail-home span{font-size:8px;font-weight:800}.nt2-rail-icon{height:24px;display:grid;place-items:center}.nt2-rail-icon svg{width:19px;height:19px}.nt2-rail-short{font-size:9px;font-weight:900;letter-spacing:.02em}.nt2-rail-sep{height:1px;margin:3px 5px;background:var(--nt2-line)}.nt2-rail-item.disabled{opacity:.35;pointer-events:none}
.nt2-tool-panel{position:fixed;z-index:1850;left:var(--nt2-rail-w);top:var(--nt2-header-h);bottom:0;width:var(--nt2-panel-w);display:flex;flex-direction:column;border-right:1px solid var(--nt2-line);background:var(--nt2-surface);transition:transform .18s ease,opacity .18s ease}.nt2-sidebar-collapsed .nt2-tool-panel{transform:translateX(calc(-1 * var(--nt2-panel-w)));opacity:0;pointer-events:none}.nt2-tool-panel-head{height:58px;flex:0 0 58px;padding:13px 16px;border-bottom:1px solid var(--nt2-line);display:flex;flex-direction:column;justify-content:center}.nt2-tool-panel-head strong{font-size:12px;letter-spacing:-.01em}.nt2-tool-panel-head span{margin-top:3px;color:var(--nt2-muted-2);font-size:8px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}.nt2-tool-panel-scroll{overflow:auto;padding:8px 10px 18px;scrollbar-width:thin;scrollbar-color:var(--nt2-line-strong) transparent}.nt2-tool-group{padding:9px 0;border-top:1px solid var(--nt2-line)}.nt2-tool-group:first-child{border-top:0}.nt2-tool-group-title{padding:3px 8px 7px;color:var(--nt2-muted-2);font-size:8px;font-weight:900;letter-spacing:.12em;text-transform:uppercase}.nt2-tool-link{min-height:39px;display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:8px;padding:4px 8px;border:1px solid transparent;border-radius:9px;color:var(--nt2-muted);text-decoration:none;font-size:11px;font-weight:650;transition:.13s}.nt2-tool-link:hover{background:var(--nt2-surface-2);border-color:var(--nt2-line);color:var(--nt2-text)}.nt2-tool-link.active{background:color-mix(in srgb,var(--nt2-service-color) 12%,var(--nt2-surface-2));border-color:color-mix(in srgb,var(--nt2-service-color) 38%,var(--nt2-line));color:var(--nt2-text)}.nt2-tool-icon{width:28px;height:28px;display:grid;place-items:center;border-radius:8px;background:var(--nt2-surface-2);color:var(--nt2-muted)}.nt2-tool-link.active .nt2-tool-icon{background:color-mix(in srgb,var(--nt2-service-color) 15%,var(--nt2-surface-2));color:var(--nt2-service-color)}.nt2-tool-icon svg{width:15px;height:15px}.nt2-coming{margin:15px;padding:13px;border:1px dashed var(--nt2-line-strong);border-radius:10px;color:var(--nt2-muted);font-size:11px;line-height:1.5}
.nt2-mobile-backdrop{display:none;position:fixed;z-index:1800;inset:var(--nt2-header-h) 0 0;background:rgba(0,0,0,.52);backdrop-filter:blur(2px)}

/* Moon v3 — thin crescent, icon in the concave negative space */
.nt2-moon-host{display:grid;place-items:center}.nt2-moon-v3{--nt2-moon-color:var(--nt2-service-color);position:relative;width:190px;height:175px;display:block}.nt2-moon-shape{position:absolute;left:0;top:0;width:170px;height:170px;overflow:visible;filter:drop-shadow(0 19px 30px color-mix(in srgb,var(--nt2-moon-color) 18%,transparent))}.nt2-moon-base{fill:var(--nt2-moon-color)}.nt2-moon-icon{position:absolute;left:118px;top:76px;width:34px;height:34px;display:grid;place-items:center;color:color-mix(in srgb,var(--nt2-moon-color) 86%,#fff);filter:drop-shadow(0 5px 10px color-mix(in srgb,var(--nt2-moon-color) 28%,transparent))}.nt2-moon-icon svg{width:29px;height:29px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.nt2-moon-v3.compact{transform:scale(.78);transform-origin:center}.nt2-pdf-home-moon{position:absolute;right:10px;top:10px}.home-layout{position:relative}

/* Breadcrumbs */
.nt2-breadcrumbs{display:flex!important;align-items:center!important;gap:7px!important;margin:0 0 18px!important;color:var(--nt2-muted-2)!important;font-size:12px!important;line-height:1.5!important}.nt2-breadcrumbs a{color:var(--nt2-muted-2)!important;text-decoration:none!important}.nt2-breadcrumbs a:hover{color:var(--nt2-text)!important}.nt2-breadcrumbs strong,.nt2-breadcrumbs span:last-child{color:var(--nt2-muted)!important}

/* Shared footer */
.nt2-footer{position:relative;z-index:1950;margin-left:0;padding-left:var(--nt2-left-offset);border-top:1px solid var(--nt2-line);background:var(--nt2-surface);transition:padding-left .18s ease}.nt2-footer-inner{min-height:84px;width:min(1240px,calc(100% - 40px));margin:0 auto;display:flex;align-items:center;gap:22px;color:var(--nt2-muted-2);font-size:12px}.nt2-footer-brand{display:flex;align-items:center;gap:8px;text-decoration:none;color:var(--nt2-text)}.nt2-footer-brand .nt2-logo-mark{width:26px;height:26px;border-radius:8px}.nt2-footer-brand .nt2-logo-crescent{transform:scale(.72)}.nt2-footer-brand strong{font-size:14px}.nt2-footer-brand>span:last-child{color:var(--nt2-muted-2);font-size:10px}.nt2-footer nav{display:flex;gap:14px}.nt2-footer nav a{text-decoration:none;color:var(--nt2-muted)}.nt2-footer nav a:hover{color:var(--nt2-text)}.nt2-footer-note{margin-left:auto}

/* Legacy chrome is retained in DOM for old scripts, but never displayed. */
.nt2-shell-ready>.nt-global-rail,.nt2-shell-ready .nt-global-rail{display:none!important}
body.nt2-shell-ready.nt-service-image .nt-header,body.nt2-shell-ready.nt-service-image .nt-sidebar,body.nt2-shell-ready.nt-service-image .nt-sidebar-backdrop,body.nt2-shell-ready.nt-service-image .nt-footer{display:none!important}
body.nt2-shell-ready.nt-service-text .site-header,body.nt2-shell-ready.nt-service-text .sidebar,body.nt2-shell-ready.nt-service-text .site-footer{display:none!important}
body.nt2-shell-ready.nt-service-code .topbar,body.nt2-shell-ready.nt-service-code .sidebar{display:none!important}
body.nt2-shell-ready.nt-service-pdf .app-header,body.nt2-shell-ready.nt-service-pdf .sidebar,body.nt2-shell-ready.nt-service-pdf .footer,body.nt2-shell-ready.nt-service-pdf .mobile-backdrop,body.nt2-shell-ready.nt-service-pdf .flyout{display:none!important}

/* One geometric shell around service content */
body.nt2-shell-ready.nt-service-image .nt-shell{padding-left:var(--nt2-left-offset)!important;padding-top:var(--nt2-header-h)!important;display:block!important;min-height:100vh;transition:padding-left .18s ease}.nt2-shell-ready.nt-service-image .nt-page{min-width:0!important}.nt2-shell-ready.nt-service-image main{width:min(1120px,calc(100% - 48px))!important;margin-inline:auto!important}.nt2-shell-ready.nt-service-image .nt-breadcrumbs{margin-top:0!important;padding-top:18px!important;width:min(1120px,calc(100% - 48px));margin-inline:auto!important}.nt2-shell-ready.nt-service-image .nt-hero{grid-template-columns:minmax(0,1fr) 215px!important;min-height:210px!important}.nt2-shell-ready.nt-service-image .nt-hero-visual{height:190px!important}.nt2-shell-ready.nt-service-image .nt-hero-moon-cut,.nt2-shell-ready.nt-service-image .nt-hero-tool-icon{display:none!important}
body.nt2-shell-ready.nt-service-text .site-body{padding-left:var(--nt2-left-offset)!important;padding-top:var(--nt2-header-h)!important;display:block!important;transition:padding-left .18s ease}.nt2-shell-ready.nt-service-text .main-area{min-width:0!important}.nt2-shell-ready.nt-service-text .content-wrap{width:min(1120px,calc(100% - 48px))!important;margin-inline:auto!important}.nt2-shell-ready.nt-service-text .title-stage{grid-template-columns:minmax(0,1fr) 215px!important}.nt2-shell-ready.nt-service-text .title-stage-mark{min-width:190px!important}
body.nt2-shell-ready.nt-service-code .content{margin-left:var(--nt2-left-offset)!important;padding-top:var(--nt2-header-h)!important;transition:margin-left .18s ease!important}.nt2-shell-ready.nt-service-code .editor,.nt2-shell-ready.nt-service-code .preview{min-height:calc(100vh - var(--nt2-header-h))!important}.nt2-shell-ready.nt-service-code .code-home-inner{width:min(1080px,calc(100% - 40px))!important}.nt2-shell-ready.nt-service-code .code-home-hero{grid-template-columns:minmax(0,1fr) 215px!important}.nt2-shell-ready.nt-service-code .code-home-hero .nt2-moon-host,.nt2-shell-ready.nt-service-image .nt-hero-visual .nt2-moon-host,.nt2-shell-ready.nt-service-text .title-stage-mark .nt2-moon-host{justify-self:end}
body.nt2-shell-ready.nt-service-pdf{--sidebar-current:0px!important}.nt2-shell-ready.nt-service-pdf .main{margin-left:var(--nt2-left-offset)!important;padding-top:var(--nt2-header-h)!important;transition:margin-left .18s ease!important}.nt2-shell-ready.nt-service-pdf .page-container,.nt2-shell-ready.nt-service-pdf .page-container.tool-wide,.nt2-shell-ready.nt-service-pdf .page-container.pdf-word-wide{width:min(1280px,calc(100% - 48px))!important;max-width:none!important}.nt2-shell-ready.nt-service-pdf .home-layout{min-height:230px}.nt2-shell-ready.nt-service-pdf .home-layout>h1,.nt2-shell-ready.nt-service-pdf .home-layout>.lead{max-width:calc(100% - 220px)}.nt2-shell-ready.nt-service-pdf .home-layout h1{font-size:clamp(34px,4vw,48px);letter-spacing:-.04em}.nt2-shell-ready.nt-service-pdf .home-layout .lead{max-width:760px}
body.nt2-shell-ready:not(.nt-service-image):not(.nt-service-text):not(.nt-service-code):not(.nt-service-pdf) .home-shell{padding-left:var(--nt2-left-offset)!important;padding-top:var(--nt2-header-h)!important}.nt2-shell-ready .home-header{display:none!important}

/* Primitive normalization without flattening service-specific UX */
.nt2-shell-ready button,.nt2-shell-ready input,.nt2-shell-ready select,.nt2-shell-ready textarea{font-family:inherit}
.nt2-shell-ready .panel,.nt2-shell-ready .tool-card,.nt2-shell-ready .workspace,.nt2-shell-ready .dropzone,.nt2-shell-ready .file-card,.nt2-shell-ready .page-card,.nt2-shell-ready .tool-panel,.nt2-shell-ready .category-card{border-color:var(--nt2-line)!important;box-shadow:none!important}
.nt2-shell-ready .panel,.nt2-shell-ready .workspace,.nt2-shell-ready .dropzone,.nt2-shell-ready .file-card,.nt2-shell-ready .page-card{background:var(--nt2-surface)!important}

/* Shared service colors */
body[data-nt-service="pdf"]{--nt2-service-color:#4d8dff;--accent:#4d8dff;--accent-soft:rgba(77,141,255,.12)}
body[data-nt-service="image"]{--nt2-service-color:#ef4658;--accent:#ef4658;--accentSoft:rgba(239,70,88,.12)}
body[data-nt-service="text"]{--nt2-service-color:#db4f7c;--accent:#db4f7c;--accent-soft:rgba(219,79,124,.12)}
body[data-nt-service="code"]{--nt2-service-color:#ff7a24;--accent:#ff7a24;--accent-soft:rgba(255,122,36,.12)}

@media(max-width:1120px){.nt2-search-wrap{width:min(500px,40vw)}.nt2-section-chip-copy small,.nt2-search kbd{display:none}.nt2-runtime-chip span{display:none}.nt2-runtime-chip{width:36px;padding:0;justify-content:center}}
@media(max-width:860px){:root{--nt2-left-offset:0px}.nt2-header{height:auto;min-height:112px;display:grid;grid-template-columns:1fr auto;padding:10px 12px}.nt2-header-left{min-width:0}.nt2-section-chip{max-width:150px}.nt2-search-wrap{position:relative;left:auto;top:auto;transform:none;grid-column:1/-1;grid-row:2;width:100%;padding-bottom:2px}.nt2-header-actions{grid-column:2;grid-row:1}.nt2-runtime-chip{display:none}.nt2-rail{top:0;z-index:2200;transform:translateX(-100%);transition:transform .18s ease}.nt2-tool-panel{top:0;z-index:2150;left:var(--nt2-rail-w);height:100vh;transform:translateX(calc(-100% - var(--nt2-rail-w)));transition:transform .18s ease}.nt2-mobile-menu-open .nt2-rail{transform:none}.nt2-mobile-menu-open .nt2-tool-panel{transform:none;opacity:1;pointer-events:auto}.nt2-mobile-menu-open .nt2-mobile-backdrop{display:block}.nt2-sidebar-collapsed .nt2-tool-panel{opacity:1}.nt2-footer{padding-left:0!important}.nt2-shell-ready.nt-service-image .nt-shell,.nt2-shell-ready.nt-service-text .site-body{padding-left:0!important;padding-top:116px!important}.nt2-shell-ready.nt-service-code .content,.nt2-shell-ready.nt-service-pdf .main{margin-left:0!important;padding-top:116px!important}.nt2-shell-ready:not(.nt-service-image):not(.nt-service-text):not(.nt-service-code):not(.nt-service-pdf) .home-shell{padding-left:0!important;padding-top:0!important}}
@media(max-width:620px){.nt2-brand strong{font-size:14px}.nt2-section-chip{padding:0 8px;max-width:115px}.nt2-section-chip-copy small{display:none}.nt2-section-chip-copy strong{font-size:10px}.nt2-header-actions{display:none}.nt2-header{grid-template-columns:1fr}.nt2-search-wrap{grid-row:2;grid-column:1}.nt2-tool-panel{width:min(280px,calc(100vw - var(--nt2-rail-w)))}.nt2-footer-inner{padding:14px 0;align-items:flex-start;flex-direction:column;gap:10px}.nt2-footer-note{margin-left:0}.nt2-footer nav{flex-wrap:wrap}.nt2-moon-v3{transform:scale(.78);transform-origin:center}.nt2-shell-ready.nt-service-image .nt-hero,.nt2-shell-ready.nt-service-text .title-stage,.nt2-shell-ready.nt-service-code .code-home-hero{grid-template-columns:1fr!important}.nt2-shell-ready.nt-service-image .nt-hero-visual,.nt2-shell-ready.nt-service-text .title-stage-mark,.nt2-shell-ready.nt-service-code .code-home-hero .nt2-moon-host,.nt2-pdf-home-moon{display:none!important}.nt2-shell-ready.nt-service-pdf .home-layout>h1,.nt2-shell-ready.nt-service-pdf .home-layout>.lead{max-width:none}}


/* ===== v0.2.1 UI stabilization ===== */
html[data-theme="light"]{color-scheme:light}
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="light"] body.nt2-shell-ready{--nt2-bg:#f5f6f8;--nt2-surface:#fff;--nt2-surface-2:#f0f1f4;--nt2-surface-3:#e8eaf0;--nt2-text:#15171c;--nt2-muted:#5f6470;--nt2-muted-2:#7b808d;--nt2-line:#d9dce3;--nt2-line-strong:#c3c7d1;--nt2-shadow:0 18px 56px rgba(20,24,34,.13)}
html[data-theme="dark"] body.nt2-shell-ready{--nt2-bg:#0f1013;--nt2-surface:#15161a;--nt2-surface-2:#1a1b20;--nt2-surface-3:#202126;--nt2-text:#fcfcfd;--nt2-muted:#b7b8c2;--nt2-muted-2:#8d909b;--nt2-line:#292a31;--nt2-line-strong:#3a3b44;--nt2-shadow:0 20px 70px rgba(0,0,0,.34)}

/* One source of truth for legacy service tokens. */
html[data-theme="dark"] body.nt-service-pdf{--bg:var(--nt2-bg)!important;--surface:var(--nt2-surface)!important;--surface-2:var(--nt2-surface-2)!important;--surface-3:var(--nt2-surface-3)!important;--text:var(--nt2-text)!important;--text-2:var(--nt2-muted)!important;--text-3:var(--nt2-muted-2)!important;--border:var(--nt2-line)!important;--border-strong:var(--nt2-line-strong)!important;--accent:#4d8dff!important;--accent-soft:rgba(77,141,255,.12)!important;--accent-hover:#71a5ff!important;--header-bg:rgba(21,22,26,.94)!important;--canvas:#111216!important}
html[data-theme="light"] body.nt-service-pdf{--bg:var(--nt2-bg)!important;--surface:var(--nt2-surface)!important;--surface-2:var(--nt2-surface-2)!important;--surface-3:var(--nt2-surface-3)!important;--text:var(--nt2-text)!important;--text-2:var(--nt2-muted)!important;--text-3:var(--nt2-muted-2)!important;--border:var(--nt2-line)!important;--border-strong:var(--nt2-line-strong)!important;--accent:#2563eb!important;--accent-soft:#eaf2ff!important;--accent-hover:#1d4ed8!important;--header-bg:rgba(255,255,255,.94)!important;--canvas:#f3f4f7!important}
html[data-theme="dark"] body.nt-service-text{--bg:var(--nt2-bg)!important;--bg-elevated:var(--nt2-surface)!important;--chrome:var(--nt2-surface)!important;--surface:var(--nt2-surface)!important;--surface-2:var(--nt2-surface-2)!important;--surface-3:var(--nt2-surface-3)!important;--text:var(--nt2-text)!important;--text-secondary:var(--nt2-muted)!important;--text-muted:var(--nt2-muted-2)!important;--border:var(--nt2-line)!important;--border-strong:var(--nt2-line-strong)!important}
html[data-theme="light"] body.nt-service-text{--bg:var(--nt2-bg)!important;--bg-elevated:#fff!important;--chrome:#fff!important;--surface:#fff!important;--surface-2:#f0f1f4!important;--surface-3:#e8eaf0!important;--text:#15171c!important;--text-secondary:#5f6470!important;--text-muted:#7b808d!important;--border:#d9dce3!important;--border-strong:#c3c7d1!important}
html[data-theme="dark"] body.nt-service-image{--bg:var(--nt2-bg)!important;--top:#111216!important;--panel:var(--nt2-surface)!important;--panel2:var(--nt2-surface-2)!important;--panel3:var(--nt2-surface-3)!important;--text:var(--nt2-text)!important;--muted:var(--nt2-muted)!important;--muted2:var(--nt2-muted-2)!important;--line:var(--nt2-line)!important;--line2:var(--nt2-line-strong)!important}
html[data-theme="light"] body.nt-service-image{--bg:var(--nt2-bg)!important;--top:#fff!important;--panel:#fff!important;--panel2:#f8f9fb!important;--panel3:#eef1f5!important;--text:#15171c!important;--muted:#5f6470!important;--muted2:#7b808d!important;--line:#d9dce3!important;--line2:#c3c7d1!important}
html[data-theme="dark"] body.nt-service-code{--bg:var(--nt2-bg)!important;--surface:var(--nt2-surface)!important;--surface-2:var(--nt2-surface-2)!important;--surface-3:var(--nt2-surface-3)!important;--text:var(--nt2-text)!important;--muted:var(--nt2-muted)!important;--muted-2:var(--nt2-muted-2)!important;--line:var(--nt2-line)!important;--line-strong:var(--nt2-line-strong)!important}
html[data-theme="light"] body.nt-service-code{--bg:var(--nt2-bg)!important;--surface:#fff!important;--surface-2:#f0f1f4!important;--surface-3:#e8eaf0!important;--text:#15171c!important;--muted:#5f6470!important;--muted-2:#7b808d!important;--line:#d9dce3!important;--line-strong:#c3c7d1!important}

/* Rail begins with service categories; logo is the Home control. */
.nt2-rail{padding-top:14px!important}
.nt2-rail-home,.nt2-rail-sep{display:none!important}

/* Moon is intentionally lower than the H1 baseline. */
.nt2-moon-host{transform:translateY(28px)}
.nt2-pdf-home-moon{top:38px!important}
.hero-visual{padding-top:28px}
.nt2-landing-moon{transform:translateY(28px)}

/* Generated category pages for services whose legacy roots were tool/editor layouts. */
.nt2-section-landing{margin-left:var(--nt2-left-offset);padding:calc(var(--nt2-header-h) + 20px) 0 70px;min-height:calc(100vh - 70px);background:var(--nt2-bg);color:var(--nt2-text);transition:margin-left .18s ease}
.nt2-section-landing>.nt2-breadcrumbs,.nt2-landing-hero,.nt2-landing-groups{width:min(1120px,calc(100% - 48px));margin-inline:auto}
.nt2-landing-hero{display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:42px;align-items:center;min-height:240px;border-bottom:1px solid var(--nt2-line);padding-bottom:18px}
.nt2-landing-eyebrow{font-size:10px;letter-spacing:.14em;text-transform:uppercase;font-weight:900;color:var(--nt2-service-color);margin-bottom:12px}.nt2-landing-hero h1{margin:0;font-size:clamp(38px,4.5vw,58px);line-height:1;letter-spacing:-.055em}.nt2-landing-hero p{max-width:720px;margin:16px 0 0;color:var(--nt2-muted);font-size:15px;line-height:1.65}.nt2-landing-moon{justify-self:end}
.nt2-landing-groups{padding-top:28px;display:grid;gap:24px}.nt2-landing-group{border-top:1px solid var(--nt2-line);padding-top:16px}.nt2-landing-group:first-child{border-top:0;padding-top:0}.nt2-landing-group-title{margin-bottom:11px;color:var(--nt2-muted-2);font-size:10px;letter-spacing:.12em;text-transform:uppercase;font-weight:900}.nt2-landing-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}.nt2-landing-card{min-height:100px;padding:15px 16px;border:1px solid var(--nt2-line);border-radius:14px;background:var(--nt2-surface);display:grid;grid-template-columns:36px minmax(0,1fr);gap:12px;align-items:start;text-decoration:none;color:var(--nt2-text);transition:.16s}.nt2-landing-card:hover{background:var(--nt2-surface-2);border-color:color-mix(in srgb,var(--nt2-service-color) 40%,var(--nt2-line));transform:translateY(-1px)}.nt2-landing-card-icon{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;color:var(--nt2-service-color);background:color-mix(in srgb,var(--nt2-service-color) 10%,var(--nt2-surface-2));border:1px solid color-mix(in srgb,var(--nt2-service-color) 28%,var(--nt2-line))}.nt2-landing-card-icon svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8}.nt2-landing-card strong{display:block;font-size:14px;margin:2px 0 5px}.nt2-landing-card small{display:block;color:var(--nt2-muted);font-size:11px;line-height:1.45}
body.nt2-generated-landing-active.nt-service-image .nt-shell,body.nt2-generated-landing-active.nt-service-code .content{display:none!important}

/* Text category cards need a clear surface hierarchy, not disabled-looking grey blocks. */
body.nt-service-text .category-row{background:var(--nt2-surface-2)!important;border-color:var(--nt2-line)!important;box-shadow:none!important}
body.nt-service-text .category-row:hover{background:var(--nt2-surface-3)!important;border-color:color-mix(in srgb,#db4f7c 42%,var(--nt2-line))!important}
html[data-theme="light"] body.nt-service-text .category-row{background:#fff!important;border-color:#d9dce3!important}
html[data-theme="light"] body.nt-service-text .category-row:hover{background:#f8f9fb!important;border-color:rgba(219,79,124,.34)!important}

/* PDFFlow accent is blue everywhere in the NightTools shell. */
body.nt-service-pdf .tool-card.available .tool-icon{background:rgba(77,141,255,.12)!important;color:#4d8dff!important}
body.nt-service-pdf .tool-card.available:hover{border-color:rgba(77,141,255,.42)!important}

/* Hide developer controls from production-facing shell. */
body.nt2-shell-ready .dev-panel,body.nt2-shell-ready .dev-diagnostics,body.nt2-shell-ready [data-dev-panel],body.nt2-shell-ready #devPanel{display:none!important}

/* Search scrollbar belongs to NightTools rather than the OS default. */
.nt2-search-results{scrollbar-width:thin;scrollbar-color:var(--nt2-line-strong) transparent}.nt2-search-results::-webkit-scrollbar{width:8px}.nt2-search-results::-webkit-scrollbar-track{background:transparent}.nt2-search-results::-webkit-scrollbar-thumb{background:var(--nt2-line-strong);border-radius:999px;border:2px solid var(--nt2-surface)}

@media(max-width:860px){.nt2-section-landing{margin-left:0;padding-top:132px}.nt2-landing-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.nt2-landing-hero{grid-template-columns:minmax(0,1fr) 170px}}
@media(max-width:620px){.nt2-landing-hero{grid-template-columns:1fr;min-height:auto;padding-bottom:24px}.nt2-landing-moon{display:none}.nt2-landing-grid{grid-template-columns:1fr}.nt2-section-landing>.nt2-breadcrumbs,.nt2-landing-hero,.nt2-landing-groups{width:min(100% - 28px,1120px)}}

/* ===== NightTools v0.3 — frontend finalization ===== */
html.nt3-preboot body{min-height:100vh}
html.nt3-preboot body>.site-header,html.nt3-preboot body>.sidebar,html.nt3-preboot body>.nt-header,html.nt3-preboot body>.nt-global-rail,html.nt3-preboot body>.code-header{visibility:hidden!important}
.nt2-admin-version{font-size:9px;color:var(--nt2-muted-2);font-weight:800;margin-left:2px}.nt-admin-mode .nt2-admin-version{display:inline-flex!important}

/* Footer becomes a useful system surface rather than a decorative strip. */
.nt2-footer-grid{min-height:104px;display:grid!important;grid-template-columns:1.5fr 1fr 1fr;gap:34px!important;align-items:start!important;padding:22px 0}.nt2-footer-grid>div>strong{display:block;color:var(--nt2-text);font-size:12px;margin-bottom:9px}.nt2-footer-about p{margin:8px 0 0;max-width:420px;color:var(--nt2-muted-2);line-height:1.55}.nt2-footer-grid nav{display:flex;flex-wrap:wrap;gap:8px 13px}.nt2-status-line,.nt2-admin-stats{display:block;margin-top:5px;color:var(--nt2-muted-2);font-size:11px;line-height:1.5}.nt2-status-line.is-ok{color:#53c98b}.nt2-admin-stats{color:var(--nt2-service-color)}
body.nt-service-home{min-height:100vh;display:flex;flex-direction:column}body.nt-service-home>.home-shell{flex:1;width:100%}body.nt-service-home>.nt2-footer{margin-top:auto}

/* Planned/experimental items are local/admin only. */
/* Scope unavailable tool hiding to PDFFlow. Shared .tool-card is used by PhotoFlow/TextFlow. */
body.nt-service-pdf:not(.nt-admin-mode) [data-nt-planned],
body.nt-service-pdf:not(.nt-admin-mode) .tool-card:not(.available),
body.nt-service-pdf:not(.nt-admin-mode) .planned,
body.nt-service-pdf:not(.nt-admin-mode) [data-planned]{display:none!important}

/* TextFlow theme adapter for the cards/list selector. */
body.nt-service-text .category-view-switch .view-switch-btn{background:var(--nt2-surface)!important;border-color:var(--nt2-line)!important;color:var(--nt2-muted)!important;box-shadow:none!important}
body.nt-service-text .category-view-switch .view-switch-btn.active{background:color-mix(in srgb,#db4f7c 12%,var(--nt2-surface-2))!important;border-color:rgba(219,79,124,.42)!important;color:#db4f7c!important}
html[data-theme="light"] body.nt-service-text .category-view-switch .view-switch-btn{background:#fff!important;color:#5f6470!important;border-color:#d9dce3!important}
html[data-theme="light"] body.nt-service-text .category-view-switch .view-switch-btn.active{background:#fff1f5!important;color:#c83f6d!important;border-color:#e9a7bc!important}

/* Calculator inherits the NightTools shell while preserving its calculator cards/forms. */
body.nt-service-calc{--accent:#9b6cff!important;--accent-2:#7b4be1!important;--accent-soft:rgba(155,108,255,.12)!important;--bg:var(--nt2-bg)!important;--surface:var(--nt2-surface)!important;--surface-2:var(--nt2-surface-2)!important;--text:var(--nt2-text)!important;--muted:var(--nt2-muted)!important;--border:var(--nt2-line)!important}
body.nt2-shell-ready.nt-service-calc .site-header,body.nt2-shell-ready.nt-service-calc .sidebar,body.nt2-shell-ready.nt-service-calc .mobile-menu-btn{display:none!important}
body.nt2-shell-ready.nt-service-calc .site-shell{padding-left:var(--nt2-left-offset)!important;padding-top:var(--nt2-header-h)!important;max-width:none!important;margin:0!important;transition:padding-left .18s ease}
body.nt2-shell-ready.nt-service-calc .layout{display:block!important}.nt2-shell-ready.nt-service-calc .main-content{width:min(1120px,calc(100% - 48px));margin:0 auto!important;min-width:0!important}
body.nt2-shell-ready.nt-service-calc .breadcrumbs{margin-top:0!important;padding-top:18px!important}
html[data-theme="dark"] body.nt-service-calc{background:var(--nt2-bg)!important;color:var(--nt2-text)!important}html[data-theme="dark"] body.nt-service-calc .calculator-card,html[data-theme="dark"] body.nt-service-calc .category-card,html[data-theme="dark"] body.nt-service-calc .content-card{background:var(--nt2-surface)!important;border-color:var(--nt2-line)!important;color:var(--nt2-text)!important}
html[data-theme="light"] body.nt-service-calc{background:#f5f6f8!important;color:#15171c!important}

/* Static category pages are true HTML-first pages. */
.nt3-category-page{margin-left:var(--nt2-left-offset);padding:calc(var(--nt2-header-h) + 18px) 0 56px;min-height:calc(100vh - 104px);transition:margin-left .18s ease;background:var(--nt2-bg);color:var(--nt2-text)}
.nt3-category-inner{width:min(1120px,calc(100% - 48px));margin:0 auto}.nt3-category-hero{display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:44px;align-items:center;min-height:248px;border-bottom:1px solid var(--nt2-line);padding:8px 0 22px}.nt3-category-eyebrow{font-size:10px;font-weight:900;letter-spacing:.13em;text-transform:uppercase;color:var(--nt2-service-color);margin-bottom:12px}.nt3-category-hero h1{font-size:clamp(38px,4.6vw,58px);line-height:1;letter-spacing:-.055em;margin:0}.nt3-category-hero p{max-width:720px;margin:16px 0 0;color:var(--nt2-muted);line-height:1.65;font-size:15px}.nt3-category-moon{width:210px;height:190px;justify-self:end;display:grid;place-items:center;padding-top:26px}
.nt3-groups{display:grid;gap:24px;padding-top:26px}.nt3-group{padding-top:15px;border-top:1px solid var(--nt2-line)}.nt3-group:first-child{border-top:0;padding-top:0}.nt3-group h2{margin:0 0 11px;font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--nt2-muted-2)}.nt3-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}.nt3-card{min-height:118px;border:1px solid var(--nt2-line);border-radius:15px;background:var(--nt2-surface);padding:17px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;text-decoration:none;color:var(--nt2-text);transition:.15s}.nt3-card:hover{transform:translateY(-1px);background:var(--nt2-surface-2);border-color:color-mix(in srgb,var(--nt2-service-color) 42%,var(--nt2-line))}.nt3-card-icon{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;margin-bottom:10px;background:color-mix(in srgb,var(--nt2-service-color) 11%,var(--nt2-surface-2));border:1px solid color-mix(in srgb,var(--nt2-service-color) 30%,var(--nt2-line));color:var(--nt2-service-color);font-size:12px;font-weight:900}.nt3-card strong{font-size:15px}.nt3-card small{display:block;margin-top:6px;color:var(--nt2-muted);font-size:11px;line-height:1.45;max-width:260px}.nt3-grid-list{grid-template-columns:1fr!important}.nt3-grid-list .nt3-card{min-height:72px;display:grid;grid-template-columns:42px minmax(0,1fr);gap:13px;text-align:left;align-items:center;justify-content:stretch}.nt3-grid-list .nt3-card-icon{margin:0}.nt3-grid-list .nt3-card-copy{align-self:center}
.nt3-view-switch{display:flex;justify-content:flex-end;gap:7px;margin:18px 0 0}.nt3-view-switch button{border:1px solid var(--nt2-line);background:var(--nt2-surface);color:var(--nt2-muted);border-radius:10px;padding:8px 12px;cursor:pointer}.nt3-view-switch button.active{color:var(--nt2-service-color);border-color:color-mix(in srgb,var(--nt2-service-color) 38%,var(--nt2-line));background:color-mix(in srgb,var(--nt2-service-color) 10%,var(--nt2-surface-2))}

/* Home v0.3 cards/list and light theme. */
.home-main{min-height:calc(100vh - var(--nt2-header-h) - 104px)}.home-view-switch{display:flex;gap:7px}.home-view-switch button{border:1px solid var(--nt2-line);background:var(--nt2-surface);color:var(--nt2-muted);border-radius:10px;padding:8px 12px;cursor:pointer}.home-view-switch button.active{color:#ef4658;border-color:rgba(239,70,88,.4);background:rgba(239,70,88,.1)}
html[data-theme="light"] .category-card{background:#fff!important;color:#15171c!important;border-color:#d9dce3!important}.category-grid[data-view="grid"] .category-card{grid-template-columns:1fr;text-align:center;justify-items:center;align-content:center}.category-grid[data-view="grid"] .category-meta{grid-column:1;justify-content:center}.category-grid[data-view="grid"] .category-card p{max-width:400px}.category-grid[data-view="list"]{grid-template-columns:1fr}.category-grid[data-view="list"] .category-card{min-height:92px;grid-template-columns:48px minmax(0,1fr);align-items:center}.category-grid[data-view="list"] .category-meta{grid-column:2;margin-top:5px}

@media(max-width:860px){.nt2-footer-grid{grid-template-columns:1fr}.nt3-category-page{margin-left:0;padding-top:128px}.nt3-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.nt3-category-hero{grid-template-columns:minmax(0,1fr) 160px}.nt2-shell-ready.nt-service-calc .site-shell{padding-left:0!important;padding-top:116px!important}}
@media(max-width:620px){.nt3-category-inner{width:min(100% - 28px,1120px)}.nt3-category-hero{grid-template-columns:1fr;min-height:auto}.nt3-category-moon{display:none}.nt3-grid{grid-template-columns:1fr}}
body:not(.nt-admin-mode) .coming-soon{display:none!important}
body.nt2-shell-ready.nt-service-calc .site-footer{display:none!important}

/* v0.3 production/dev visibility: diagnostics stay available locally/admin only. */
body:not(.nt-admin-mode) .dev-profiler,
body:not(.nt-admin-mode) .dev-diagnostics,
body:not(.nt-admin-mode) [data-dev-profiler],
body:not(.nt-admin-mode) [data-dev-only]{display:none!important}


/* ===== NightTools v0.3.1 — UI stabilization hotfix ===== */
/* CodeFlow: breadcrumbs are a full-width row, not a grid cell that displaces Editor/Preview. */
body.nt-service-code .content > .nt2-generated-breadcrumbs{
  grid-column:1 / -1!important;
  width:min(1180px,calc(100% - 40px));
  margin:18px auto 0!important;
}
@media (min-width:1121px){
  body.nt2-shell-ready.nt-service-code .content:not(.scan-full):not(.code-home-full){
    width:calc(100vw - var(--nt2-left-offset))!important;
    display:grid!important;
    grid-template-columns:minmax(420px,.95fr) minmax(480px,1.05fr)!important;
    align-items:start;
  }
  body.nt2-shell-ready.nt-service-code .content:not(.scan-full):not(.code-home-full) .editor,
  body.nt2-shell-ready.nt-service-code .content:not(.scan-full):not(.code-home-full) .preview{
    min-width:0!important;
    width:auto!important;
  }
}
/* Main page expanded sidebar now contains useful quick/recent tools. */
.nt2-home-panel .nt2-tool-icon{border-color:var(--nt2-line)}
/* Keep the fixed navigation visually above content but below the footer when the footer reaches the viewport. */
.nt2-footer a{font-size:12px}
.nt2-footer-about p{font-size:12px}
/* Slightly more readable breadcrumbs across all modules. */
.nt2-breadcrumbs strong{font-weight:750!important}

/* ===== NightTools v0.3.2 — visual consistency & responsive ===== */
:root{
  --nt2-nav-bottom:0px;
  --nt2-mobile-nav-h:68px;
  --nt2-font-sidebar:12.5px;
  --nt2-font-sidebar-group:9.5px;
  --nt2-font-breadcrumb:13.5px;
  --nt2-font-footer:12.5px;
}

/* Stable page/footer contract across all legacy service roots. */
body.nt2-shell-ready{min-height:100dvh!important;display:flex!important;flex-direction:column!important}
body.nt2-shell-ready>.home-shell,
body.nt2-shell-ready>.nt3-category-page,
body.nt2-shell-ready>.nt-shell,
body.nt2-shell-ready>.site-shell,
body.nt2-shell-ready>.app,
body.nt2-shell-ready>#app{width:100%;flex:1 0 auto}
body.nt2-shell-ready>.nt2-footer{margin-top:auto!important;flex:0 0 auto}
.nt2-rail,.nt2-tool-panel{bottom:var(--nt2-nav-bottom)!important}

/* Typography: readable on 27-inch/high-resolution desktops without bloating normal Full HD. */
.nt2-tool-panel-head strong{font-size:13.5px!important}
.nt2-tool-panel-head span{font-size:9.5px!important}
.nt2-tool-group-title{font-size:var(--nt2-font-sidebar-group)!important;line-height:1.4!important}
.nt2-tool-link{font-size:var(--nt2-font-sidebar)!important;line-height:1.35!important;min-height:42px!important}
.nt2-coming{font-size:12px!important}
.nt2-rail-short{font-size:10px!important}
.nt2-breadcrumbs{font-size:var(--nt2-font-breadcrumb)!important;gap:8px!important;line-height:1.55!important}
.nt2-footer-inner,.nt2-footer-grid{font-size:var(--nt2-font-footer)!important}
.nt2-footer-grid>div>strong{font-size:13.5px!important}
.nt2-footer a,.nt2-footer-about p{font-size:var(--nt2-font-footer)!important;line-height:1.6!important}
.nt2-status-line,.nt2-admin-stats{font-size:12px!important}

@media (min-width:1800px){
  :root{--nt2-font-sidebar:13.25px;--nt2-font-sidebar-group:10px;--nt2-font-breadcrumb:14px;--nt2-font-footer:13px}
  .nt2-tool-link{min-height:44px!important}
  .nt2-tool-panel-head strong{font-size:14px!important}
  .nt2-rail-short{font-size:10.5px!important}
}

/* One card language. TextFlow/PDFFlow remain the visual reference. */
.nt3-card,.nt2-landing-card,.category-card,.nt2-home-tool-card,
body.nt-service-text .category-row,body.nt-service-pdf .tool-card{
  border-radius:15px!important;
  border-color:var(--nt2-line)!important;
  box-shadow:none!important;
  transition:border-color .15s ease,background .15s ease,transform .15s ease!important;
}
.nt3-card:hover,.nt2-landing-card:hover,.category-card:hover,.nt2-home-tool-card:hover,
body.nt-service-text .category-row:hover,body.nt-service-pdf .tool-card:hover{transform:translateY(-1px)}
.nt3-card-icon,.nt2-landing-card-icon,.category-icon,.nt2-home-tool-icon,
body.nt-service-text .category-icon,body.nt-service-pdf .tool-icon{border-radius:11px!important}
body.nt-service-pdf .tool-card.available .tool-status{display:none!important}
body.nt-service-pdf .tool-card-top{min-height:34px}

/* Official centered catalogue-card variant. */
.nt3-card{min-height:122px!important;padding:18px!important;gap:0}
.nt3-card-icon{width:44px!important;height:44px!important;margin-bottom:11px!important}
.nt3-card strong{font-size:15px!important;line-height:1.3}
.nt3-card small{font-size:11.5px!important;line-height:1.5!important}

/* Home popular/favourites use the same primitive. */
.nt2-home-tool-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin-bottom:8px}
.nt2-home-tool-card{min-height:92px;display:grid;grid-template-columns:42px minmax(0,1fr);align-items:center;gap:13px;padding:15px 16px;border:1px solid var(--nt2-line);background:var(--nt2-surface);color:var(--nt2-text);text-decoration:none}
.nt2-home-tool-card:hover{background:var(--nt2-surface-2);border-color:color-mix(in srgb,var(--nt2-item-color) 42%,var(--nt2-line))!important}
.nt2-home-tool-icon{width:42px;height:42px;display:grid;place-items:center;color:var(--nt2-item-color);background:color-mix(in srgb,var(--nt2-item-color) 10%,var(--nt2-surface-2));border:1px solid color-mix(in srgb,var(--nt2-item-color) 30%,var(--nt2-line))}
.nt2-home-tool-icon svg{width:20px;height:20px}
.nt2-home-tool-card strong{display:block;font-size:13.5px;line-height:1.3}
.nt2-home-tool-card small{display:block;margin-top:4px;color:var(--nt2-muted-2);font-size:10.5px;line-height:1.4}
.nt2-favorites-empty{grid-column:1/-1;padding:15px 17px;border:1px dashed var(--nt2-line-strong);border-radius:14px;color:var(--nt2-muted);font-size:12.5px;background:color-mix(in srgb,var(--nt2-surface) 72%,transparent)}
.nt2-favorite-button.active{color:#f3bf49!important;background:rgba(243,191,73,.1)!important;border-color:rgba(243,191,73,.28)!important}

/* Moon v3 becomes decorative hero artwork rather than a layout column. */
.home-hero,.nt3-category-hero,.nt2-landing-hero,
body.nt-service-text .title-stage,body.nt-service-image .nt-hero,
body.nt-service-pdf .home-layout{position:relative!important}
.home-hero,.nt3-category-hero,.nt2-landing-hero{display:block!important;min-height:318px!important;padding:8px 245px 138px 0!important}
.home-hero .hero-visual,.nt3-category-moon,.nt2-landing-moon{
  position:absolute!important;right:2.5%!important;bottom:22px!important;top:auto!important;
  width:220px!important;height:190px!important;padding:0!important;margin:0!important;display:grid!important;place-items:center!important;transform:none!important;pointer-events:none
}
body.nt-service-text .title-stage{display:block!important;min-height:292px!important;padding:8px 245px 128px 0!important}
body.nt-service-text .title-stage-copy{max-width:760px!important}
body.nt-service-text .title-stage-mark{position:absolute!important;right:1.5%!important;bottom:18px!important;top:auto!important;width:210px!important;height:180px!important;min-width:0!important;display:grid!important;place-items:center!important;transform:none!important;pointer-events:none}
body.nt-service-image .nt-hero{display:block!important;min-height:292px!important;padding:8px 245px 128px 0!important}
body.nt-service-image .nt-hero-copy{max-width:760px!important}
body.nt-service-image .nt-hero-visual{position:absolute!important;right:1.5%!important;bottom:18px!important;top:auto!important;width:210px!important;height:180px!important;display:grid!important;place-items:center!important;transform:none!important;pointer-events:none}
body.nt-service-pdf .home-layout{padding-bottom:118px!important}
body.nt-service-pdf .nt2-pdf-home-moon{position:absolute!important;right:2%!important;top:120px!important;bottom:auto!important;width:210px!important;height:180px!important;display:grid!important;place-items:center!important;transform:none!important;pointer-events:none}

/* CodeFlow breadcrumbs: keep them compact and out of the editor's visual rhythm. */
body.nt-service-code .content{position:relative}
body.nt-service-code .content>.nt2-generated-breadcrumbs{grid-column:1/-1!important;width:min(1180px,calc(100% - 48px))!important;margin:12px auto -6px!important;padding:0!important;min-height:22px;align-self:end}

/* Retire the remaining TextFlow legacy chrome/surface around NightTools shell. */
body.nt-service-text .site-shell,body.nt-service-text .site-body,body.nt-service-text .main-area,body.nt-service-text .content-wrap{border-radius:0!important;box-shadow:none!important}
body.nt-service-text .site-shell::before,body.nt-service-text .site-body::before,body.nt-service-text .main-area::before,body.nt-service-text .content-wrap::before{border-radius:0!important;box-shadow:none!important}

/* Light-mode editor/control normalization. */
html[data-theme="light"] body.nt-service-text .workspace,
html[data-theme="light"] body.nt-service-text .textarea-shell,
html[data-theme="light"] body.nt-service-text .analysis-input-panel,
html[data-theme="light"] body.nt-service-text .check-row{background:#fff!important;border-color:var(--nt2-line)!important;color:var(--nt2-text)!important}
html[data-theme="light"] body.nt-service-text .workspace-toolbar,
html[data-theme="light"] body.nt-service-text .workspace-status,
html[data-theme="light"] body.nt-service-text .textarea-meta{background:#f7f8fa!important;border-color:var(--nt2-line)!important;color:var(--nt2-muted)!important}
html[data-theme="light"] body.nt-service-text .textarea,
html[data-theme="light"] body.nt-service-text .water-highlight-text{
  background:#fff!important;color:#15171c!important;border-color:var(--nt2-line)!important;caret-color:#15171c!important
}
html[data-theme="light"] body.nt-service-text .textarea::placeholder{color:#8b909a!important}
html[data-theme="light"] body.nt-service-text .btn{background:#f7f8fa!important;color:#30343b!important;border-color:var(--nt2-line)!important}
html[data-theme="light"] body.nt-service-text .btn:hover{background:#eef0f4!important}
html[data-theme="light"] body.nt-service-text .btn.primary{background:#db4f7c!important;color:#fff!important;border-color:#db4f7c!important}
html[data-theme="light"] body.nt-service-text .btn.active{background:#fff1f5!important;color:#c83f6d!important;border-color:#e9a7bc!important}

/* PhotoFlow: primary actions remain legible in light mode, including disabled state. */
html[data-theme="light"] body.nt-service-image .primary-btn{color:#fff!important;background:linear-gradient(135deg,#ef4658,#d93b50)!important}
html[data-theme="light"] body.nt-service-image .primary-btn:disabled{color:#fff!important;background:linear-gradient(135deg,#ef8290,#cf8790)!important;opacity:.68!important;box-shadow:none!important}

/* Desktop navigation stops where the footer becomes visible. */
@media (min-width:861px){.nt2-rail,.nt2-tool-panel{transition:bottom .06s linear,transform .18s ease,opacity .18s ease}}

/* Mobile: five service families become an Android/iOS style bottom navigation. */
@media (max-width:860px){
  :root{--nt2-left-offset:0px}
  body.nt2-shell-ready{padding-bottom:var(--nt2-mobile-nav-h)!important}
  .nt2-header{min-height:112px!important}
  .nt2-rail{
    left:0!important;right:0!important;top:auto!important;bottom:0!important;width:100%!important;height:var(--nt2-mobile-nav-h)!important;
    padding:5px max(6px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left))!important;
    display:grid!important;grid-template-columns:repeat(5,1fr)!important;gap:3px!important;border-right:0!important;border-top:1px solid var(--nt2-line)!important;
    background:color-mix(in srgb,var(--nt2-surface) 96%,transparent)!important;backdrop-filter:blur(18px);transform:none!important;z-index:2200!important
  }
  .nt2-rail-item{min-height:52px!important;height:52px!important;border-radius:11px!important;gap:1px!important}
  .nt2-rail-icon{height:27px!important}.nt2-rail-icon svg{width:20px!important;height:20px!important}.nt2-rail-short{font-size:9px!important}
  .nt2-tool-panel{
    position:fixed!important;left:10px!important;right:10px!important;top:auto!important;bottom:calc(var(--nt2-mobile-nav-h) + 10px)!important;
    width:auto!important;height:auto!important;max-height:min(70dvh,620px)!important;border:1px solid var(--nt2-line)!important;border-radius:20px!important;
    box-shadow:var(--nt2-shadow)!important;transform:translateY(calc(100% + var(--nt2-mobile-nav-h) + 40px))!important;opacity:0!important;pointer-events:none!important;z-index:2210!important
  }
  .nt2-mobile-menu-open .nt2-tool-panel{transform:none!important;opacity:1!important;pointer-events:auto!important}
  .nt2-mobile-menu-open .nt2-mobile-backdrop{display:block!important;inset:var(--nt2-header-h) 0 var(--nt2-mobile-nav-h)!important;z-index:2100!important}
  .nt2-sidebar-collapsed .nt2-tool-panel{opacity:0!important;pointer-events:none!important}
  .nt2-sidebar-collapsed.nt2-mobile-menu-open .nt2-tool-panel{opacity:1!important;pointer-events:auto!important}
  .nt2-tool-panel-head{border-radius:20px 20px 0 0}
  .nt2-footer{padding-left:0!important;margin-bottom:0!important}
  .nt2-shell-ready.nt-service-image .nt-shell,.nt2-shell-ready.nt-service-text .site-body{padding-left:0!important}
  .nt2-shell-ready.nt-service-code .content,.nt2-shell-ready.nt-service-pdf .main{margin-left:0!important}
  .nt3-category-page,.nt2-section-landing{margin-left:0!important}
  .nt2-home-tool-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .home-hero,.nt3-category-hero,.nt2-landing-hero,body.nt-service-text .title-stage,body.nt-service-image .nt-hero{padding-right:180px!important}
  .home-hero .hero-visual,.nt3-category-moon,.nt2-landing-moon,body.nt-service-text .title-stage-mark,body.nt-service-image .nt-hero-visual{right:0!important;transform:scale(.82)!important;transform-origin:right bottom!important}
}
@media (max-width:620px){
  .nt2-home-tool-grid{grid-template-columns:1fr}
  .home-hero,.nt3-category-hero,.nt2-landing-hero,body.nt-service-text .title-stage,body.nt-service-image .nt-hero{min-height:auto!important;padding:8px 0 34px!important}
  .home-hero .hero-visual,.nt3-category-moon,.nt2-landing-moon,body.nt-service-text .title-stage-mark,body.nt-service-image .nt-hero-visual{display:none!important}
  .nt3-grid{grid-template-columns:1fr!important}
}
/* Direct legacy roots must be allowed to shrink so the shared footer can occupy the viewport bottom. */
body.nt2-shell-ready>.home-shell,
body.nt2-shell-ready>.nt3-category-page,
body.nt2-shell-ready>.nt-shell,
body.nt2-shell-ready>.site-shell,
body.nt2-shell-ready>.app,
body.nt2-shell-ready>#app{min-height:0!important}


/* ===== NightTools v0.3.3 — navigation & card consistency ===== */
:root{--nt2-nav-bottom:0px}

/* Sidebar remains visually continuous; footer occupies only the content lane on desktop. */
.nt2-rail,.nt2-tool-panel{bottom:0!important}
.nt2-footer{z-index:1800!important}
@media (min-width:861px){
  .nt2-footer{padding-left:var(--nt2-left-offset)!important}
  .nt2-footer-inner{width:min(1180px,calc(100% - 48px))!important}
}

/* Favourites are always the final sidebar group and have a distinct NightTools accent. */
.nt2-tool-panel-scroll{display:flex!important;flex-direction:column!important}
.nt2-favorites-panel{margin-top:auto!important;padding-top:14px!important}
.nt2-favorites-title{color:#ff5366!important;text-shadow:0 0 14px rgba(255,83,102,.34);letter-spacing:.13em!important}
.nt2-favorite-tool-link:hover{border-color:rgba(255,83,102,.25)!important}
.nt2-favorite-panel-empty{padding:8px 9px 4px;color:var(--nt2-muted-2);font-size:11px;line-height:1.45}

/* Wide screens: static Code/Calculator category pages do not jump sideways when the tool panel opens. */
/* All categories now honor --nt2-left-offset at any desktop viewport width. */

/* One catalogue card primitive: icon + copy, aligned like TextFlow/PDFFlow. */
.nt3-card{min-height:100px!important;padding:16px 17px!important;display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;gap:13px!important;align-items:center!important;justify-content:stretch!important;text-align:left!important}
.nt3-card-icon{width:42px!important;height:42px!important;margin:0!important}
.nt3-card-copy{min-width:0;align-self:center}
.nt3-card strong{display:block;font-size:14px!important;line-height:1.35!important}
.nt3-card small{display:block;margin-top:5px!important;max-width:none!important;font-size:11.5px!important;line-height:1.45!important}
.nt3-grid-list .nt3-card{min-height:74px!important}

/* PDF moon must remain inside the hero and never overlap the first card row. */
body.nt-service-pdf .home-layout{min-height:0!important;padding-bottom:0!important}
@media (min-width:621px){
  body.nt-service-pdf .nt2-pdf-home-moon{top:112px!important;bottom:auto!important}
  body.nt-service-pdf .home-layout>.section-title{margin-top:176px!important}
}

/* CodeFlow tool breadcrumbs belong to the editor column, not the centre of the two-column canvas. */
@media (min-width:1121px){
  body.nt-service-code .content:not(.code-home-full)> .nt2-generated-breadcrumbs{grid-column:1!important;grid-row:1!important;width:min(720px,calc(100% - 52px))!important;justify-self:center!important;margin:14px auto -10px!important;padding:0!important}
  body.nt-service-code .content:not(.code-home-full)> .editor{grid-column:1!important;grid-row:2!important}
  body.nt-service-code .content:not(.code-home-full)> .preview{grid-column:2!important;grid-row:2!important}
  body.nt-service-code .content.scan-full> .nt2-generated-breadcrumbs{grid-column:1!important;width:min(1540px,calc(100% - 40px))!important}
}

/* Mobile navigation: Home + top popular tools + More. Desktop rail remains unchanged. */
.nt2-mobile-nav,.nt2-mobile-more-panel{display:none}
@media (max-width:860px){
  .nt2-rail{display:none!important}
  .nt2-mobile-nav{position:fixed;z-index:2230;left:0;right:0;bottom:0;height:calc(var(--nt2-mobile-nav-h) + env(safe-area-inset-bottom));padding:5px 6px calc(5px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;border-top:1px solid var(--nt2-line);background:color-mix(in srgb,var(--nt2-surface) 96%,transparent);backdrop-filter:blur(18px)}
  .nt2-mobile-nav-item{min-width:0;height:52px;border:1px solid transparent;border-radius:11px;background:transparent;color:var(--nt2-muted-2);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;text-decoration:none;padding:3px;cursor:pointer;font:inherit}
  .nt2-mobile-nav-item:hover,.nt2-mobile-nav-item:focus-visible{background:var(--nt2-surface-2);border-color:var(--nt2-line);color:var(--nt2-text)}
  .nt2-mobile-nav-item span{height:25px;display:grid;place-items:center}.nt2-mobile-nav-item svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8}.nt2-mobile-nav-item small{max-width:100%;font-size:8.5px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .nt2-mobile-more-panel{position:fixed;z-index:2240;left:10px;right:10px;bottom:calc(var(--nt2-mobile-nav-h) + env(safe-area-inset-bottom) + 10px);max-height:min(68dvh,560px);overflow:hidden;border:1px solid var(--nt2-line);border-radius:20px;background:var(--nt2-surface);box-shadow:var(--nt2-shadow);transform:translateY(calc(100% + 100px));opacity:0;pointer-events:none;display:flex;flex-direction:column;transition:.18s ease}
  .nt2-mobile-more-open .nt2-mobile-more-panel{transform:none;opacity:1;pointer-events:auto}
  .nt2-mobile-more-head{height:54px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid var(--nt2-line)}
  .nt2-mobile-more-head strong{font-size:15px}.nt2-mobile-more-head button{width:34px;height:34px;border:0;border-radius:10px;background:var(--nt2-surface-2);color:var(--nt2-text);font-size:22px;cursor:pointer}
  .nt2-mobile-more-scroll{overflow:auto;padding:10px}.nt2-mobile-more-title{padding:9px 9px 6px;color:var(--nt2-muted-2);font-size:9px;font-weight:900;letter-spacing:.12em;text-transform:uppercase}
  .nt2-mobile-more-link{display:grid;grid-template-columns:34px minmax(0,1fr);align-items:center;gap:10px;min-height:46px;padding:6px 9px;border-radius:11px;color:var(--nt2-text);text-decoration:none}.nt2-mobile-more-link:hover{background:var(--nt2-surface-2)}.nt2-mobile-more-link span{width:32px;height:32px;display:grid;place-items:center;border:1px solid var(--nt2-line);border-radius:9px}.nt2-mobile-more-link svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8}.nt2-mobile-more-link strong{font-size:12px}
  .nt2-mobile-more-open .nt2-mobile-backdrop{display:block!important;inset:var(--nt2-header-h) 0 var(--nt2-mobile-nav-h)!important;z-index:2220!important}
}

/* Main page: grid mode becomes compact two-column cards on phones; list stays a full-width row. */
@media (max-width:620px){
  .category-grid[data-view="grid"]{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
  .category-grid[data-view="grid"] .category-card{min-height:156px!important;padding:14px 10px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:8px!important}
  .category-grid[data-view="grid"] .category-icon{width:42px!important;height:42px!important;flex:0 0 42px!important}
  .category-grid[data-view="grid"] .category-card h3{font-size:15px!important;text-align:center!important}
  .category-grid[data-view="grid"] .category-card p{display:none!important}.category-grid[data-view="grid"] .category-meta{display:none!important}
  .category-grid[data-view="list"] .category-card{min-height:82px!important;padding:13px 14px!important;display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;gap:12px!important;text-align:left!important}
  .category-grid[data-view="list"] .category-meta{display:none!important}.category-grid[data-view="list"] .category-card p{font-size:11.5px!important;line-height:1.4!important}
}


/* ===== NightTools v0.3.4 — UI stabilization / chrome cleanup ===== */
html,body{max-width:100%;overflow-x:clip}
html{scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--nt2-line-strong) transparent}
*{scrollbar-width:thin;scrollbar-color:var(--nt2-line-strong) transparent}
*::-webkit-scrollbar{width:10px;height:10px}
*::-webkit-scrollbar-track{background:transparent}
*::-webkit-scrollbar-thumb{background:var(--nt2-line-strong);border:2px solid transparent;background-clip:padding-box;border-radius:999px}
*::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--nt2-muted) 70%,var(--nt2-line-strong));border:2px solid transparent;background-clip:padding-box}
html.nt2-theme-switching *,html.nt2-theme-switching *::before,html.nt2-theme-switching *::after{transition:none!important;animation-duration:0s!important}

/* Structural chrome is borderless. Inset separators remain inside navigation groups. */
.nt2-header{border-bottom:0!important}
.nt2-rail,.nt2-tool-panel{border-right:0!important}
.nt2-footer{border-top:0!important}
.nt2-tool-panel-head{border-bottom:0!important;height:52px!important;flex-basis:52px!important;padding-bottom:7px!important}
.nt2-tool-panel-head strong{color:var(--nt2-service-color)!important;font-size:13px!important;font-weight:900!important}
.nt2-tool-panel-head span{display:none!important}
.nt2-tool-group{border-top:0!important;position:relative}
.nt2-tool-group:not(:first-child)::before{content:"";position:absolute;left:8px;right:18px;top:0;height:1px;background:var(--nt2-line)}
.nt2-home-panel .nt2-tool-panel-head strong{color:#ef4658!important}

/* Main service cards use the same icon + copy language as category pages. */
@media (min-width:621px){
  .category-grid[data-view="grid"] .category-card{min-height:100px!important;padding:16px 17px!important;display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;gap:13px!important;align-items:center!important;align-content:center!important;justify-items:stretch!important;text-align:left!important}
  .category-grid[data-view="grid"] .category-icon{width:42px!important;height:42px!important;margin:0!important}
  .category-grid[data-view="grid"] .category-card h3{font-size:14px!important;line-height:1.35!important;text-align:left!important;margin:0 0 4px!important}
  .category-grid[data-view="grid"] .category-card p{display:block!important;max-width:none!important;font-size:11.5px!important;line-height:1.45!important}
  .category-grid[data-view="grid"] .category-meta{grid-column:2!important;justify-content:flex-start!important;margin-top:5px!important}
}

/* Retire service branding eyebrows and the large decorative moon. The crescent logo remains. */
.nt3-category-eyebrow,.nt2-landing-eyebrow,body.nt-service-text .hero-eyebrow,body.nt-service-code .code-home-hero .eyebrow{display:none!important}
.nt2-moon-v3,.nt2-moon-host,.nt2-pdf-home-moon,.nt3-category-moon,.nt2-landing-moon,.hero-visual,body.nt-service-text .title-stage-mark,body.nt-service-image .nt-hero-visual,body.nt-service-code .nt-moon-v2{display:none!important}
.home-hero,.nt3-category-hero,.nt2-landing-hero{display:block!important;min-height:0!important;padding:28px 0 38px!important}
body.nt-service-text .title-stage{display:block!important;min-height:0!important;padding:10px 0 28px!important}
body.nt-service-text .title-stage-copy{max-width:820px!important}
body.nt-service-image .nt-hero{display:block!important;min-height:0!important;padding:10px 0 32px!important}
body.nt-service-image .nt-hero-copy{max-width:820px!important}
body.nt-service-pdf .home-layout{padding-bottom:0!important}
body.nt-service-pdf .home-layout>.section-title{margin-top:34px!important}

/* CodeFlow tool breadcrumbs occupy the same background lane as the editor/preview canvas. */
body.nt-service-code .app-shell>.nt2-code-tool-breadcrumbs{
  margin-left:var(--nt2-left-offset)!important;width:auto!important;max-width:none!important;
  min-height:calc(var(--nt2-header-h) + 46px)!important;padding:var(--nt2-header-h) 0 0!important;
  display:grid!important;grid-template-columns:minmax(460px,44%) minmax(520px,56%)!important;
  align-items:end!important;background:linear-gradient(90deg,var(--nt2-surface) 0 44%,var(--nt2-bg) 44% 100%)!important;
  position:relative!important;z-index:2!important
}
body.nt-service-code .nt2-code-breadcrumbs-inner{grid-column:1;width:min(720px,100%);margin:0 auto;padding:0 clamp(26px,4vw,54px) 12px;display:flex;align-items:center;gap:8px;min-width:0}
body.nt-service-code .app-shell>.nt2-code-tool-breadcrumbs + .content{padding-top:0!important;min-height:calc(100vh - var(--nt2-header-h) - 46px)!important}
body.nt-service-code .app-shell>.nt2-code-tool-breadcrumbs + .content .editor,body.nt-service-code .app-shell>.nt2-code-tool-breadcrumbs + .content .preview{min-height:calc(100vh - var(--nt2-header-h) - 46px)!important}
@media (max-width:860px){body.nt-service-code .app-shell>.nt2-code-tool-breadcrumbs{margin-left:0!important;min-height:160px!important;padding-top:116px!important;grid-template-columns:1fr!important;background:var(--nt2-surface)!important}.nt2-tool-panel-head{height:48px!important;flex-basis:48px!important}}

/* PhotoFlow: navigation is already present in the sidebar; hide duplicate in-workspace mode tabs. */
body.nt2-shell-ready.nt-service-image .tool-tabs{height:0!important;min-height:0!important;margin:0!important;padding:0!important;overflow:hidden!important;opacity:0!important;pointer-events:none!important}
body.nt2-shell-ready.nt-service-image,body.nt2-shell-ready.nt-service-image .nt-shell{overflow-x:clip!important;max-width:100%!important;min-width:0!important}

/* TextFlow: remove the remaining navy legacy surfaces in dark mode. */
html[data-theme="dark"] body.nt-service-text .textarea{background:#111216!important;color:var(--nt2-text)!important}
html[data-theme="dark"] body.nt-service-text .check-row,html[data-theme="dark"] body.nt-service-text .category-art{background:var(--nt2-surface)!important;border-color:var(--nt2-line)!important}
html[data-theme="dark"] body.nt-service-text .workspace-toolbar,html[data-theme="dark"] body.nt-service-text .workspace-status{background:var(--nt2-surface-2)!important;border-color:var(--nt2-line)!important}

/* Calculator: breadcrumbs stay in the content lane and work cards use real dark surfaces. */
body.nt-service-calc .breadcrumbs.nt2-breadcrumbs{padding-left:0!important;margin:0 auto!important;width:min(1180px,calc(100% - 40px))!important;min-height:50px!important}
html[data-theme="dark"] body.nt-service-calc .calculator-panel{background:var(--nt2-surface)!important;border-color:var(--nt2-line)!important}
html[data-theme="dark"] body.nt-service-calc .fields{background:var(--nt2-surface)!important;color:var(--nt2-text)!important}
html[data-theme="dark"] body.nt-service-calc .input-wrap,html[data-theme="dark"] body.nt-service-calc .textarea-wrap,html[data-theme="dark"] body.nt-service-calc .field-select{background:var(--nt2-surface-2)!important;border-color:var(--nt2-line-strong)!important;color:var(--nt2-text)!important}
html[data-theme="dark"] body.nt-service-calc .input-wrap input,html[data-theme="dark"] body.nt-service-calc .textarea-wrap textarea,html[data-theme="dark"] body.nt-service-calc .field-select{color:var(--nt2-text)!important}
html[data-theme="dark"] body.nt-service-calc .result-panel,html[data-theme="dark"] body.nt-service-calc .result-main,html[data-theme="dark"] body.nt-service-calc .result-support-grid,html[data-theme="dark"] body.nt-service-calc .support-cell{background:var(--nt2-surface-2)!important;border-color:var(--nt2-line)!important;color:var(--nt2-text)!important}
html[data-theme="dark"] body.nt-service-calc .formula-card,html[data-theme="dark"] body.nt-service-calc .finance-chart-card{background:var(--nt2-surface)!important;border-color:var(--nt2-line)!important;color:var(--nt2-text)!important}
html[data-theme="dark"] body.nt-service-calc .formula-card code,html[data-theme="dark"] body.nt-service-calc .formula-card-label,html[data-theme="dark"] body.nt-service-calc .result-label,html[data-theme="dark"] body.nt-service-calc .result-unit{color:var(--nt2-muted)!important}
html[data-theme="dark"] body.nt-service-calc .small-action,html[data-theme="dark"] body.nt-service-calc .shape-remove{background:var(--nt2-surface-2)!important;border-color:var(--nt2-line)!important;color:var(--nt2-text)!important}

/* Short pages should dock cleanly without accidental extra scroll caused by legacy min-heights. */
body.nt2-shell-ready>.nt3-category-page{min-height:calc(100dvh - 104px)!important}

/* v0.3.4: service labels inside work areas are redundant in the unified shell. */
body.nt2-shell-ready.nt-service-image #heroKicker {
  display: none !important;
}

/* Avoid viewport-unit rounding creating a page-level horizontal scrollbar in CodeFlow. */
@media (min-width:1121px) {
  body.nt2-shell-ready.nt-service-code .content:not(.scan-full):not(.code-home-full) {
    width:calc(100% - var(--nt2-left-offset))!important;
  }
}


/* v0.3.5: TextFlow no longer owns decorative moons; keep one stable content lane. */
body.nt-service-text .hero-mark,body.nt-service-text .moon-emblem,body.nt-service-text .title-stage-mark{display:none!important}
body.nt-service-text .hero-grid,body.nt-service-text .title-stage{grid-template-columns:1fr!important;border-bottom:1px solid var(--nt2-line)!important;padding-right:0!important}
body.nt-service-text .hero-grid{padding:12px 0 28px!important}
body.nt-service-text .title-stage{padding:10px 0 28px!important;margin-bottom:28px!important}


/* v0.3.5: Calculator category and tool pages share the same outer content lane. */
body.nt-service-calc .content{width:min(1120px,calc(100% - 48px))!important;max-width:none!important;margin-inline:auto!important}
body.nt-service-calc .breadcrumbs.nt2-breadcrumbs{width:min(1120px,calc(100% - 48px))!important;max-width:none!important;margin-inline:auto!important}
body.nt-service-calc .calculator-panel,body.nt-service-calc .formula-card,body.nt-service-calc .finance-chart-card,body.nt-service-calc .content-section{max-width:960px}


/* v0.3.6 CodeFlow specificity-aware final rules are consolidated below. */
/* Uniform sidebar offsets on short and long pages. Only animate explicit user toggles. */
.nt3-category-page,.nt2-section-landing,.nt2-footer,
.nt2-shell-ready.nt-service-text .site-body,.nt2-shell-ready.nt-service-image .nt-shell,
.nt2-shell-ready.nt-service-code .content,.nt2-shell-ready.nt-service-calc .site-shell,
.nt2-shell-ready.nt-service-pdf .main{transition:none!important}
body.nt2-sidebar-changing .nt3-category-page,body.nt2-sidebar-changing .nt2-section-landing,
body.nt2-sidebar-changing .nt2-footer,body.nt2-sidebar-changing.nt-service-text .site-body,
body.nt2-sidebar-changing.nt-service-image .nt-shell,body.nt2-sidebar-changing.nt-service-code .content,
body.nt2-sidebar-changing.nt-service-calc .site-shell,body.nt2-sidebar-changing.nt-service-pdf .main{
  transition:margin-left .17s ease,padding-left .17s ease!important;
}
/* Ship shared header and footer in HTML before page hydration. */
html[data-theme="dark"] .nt2-header,html[data-theme="dark"] .nt2-footer{color:var(--nt2-text)}
html[data-theme="light"] .nt2-header,html[data-theme="light"] .nt2-footer{color:var(--nt2-text)}
[data-nt-static-theme] .nt2-theme-icon--sun,[data-nt-static-theme] .nt2-theme-icon--moon{display:block}
html[data-theme="dark"] [data-nt-static-theme] .nt2-theme-icon--moon{display:none}
html[data-theme="light"] [data-nt-static-theme] .nt2-theme-icon--sun{display:none}
/* Cross-document navigation: modern browsers may retain chrome snapshots while new HTML loads. */
/* Cross-document view transitions deliberately disabled: independent HTML pages. */
/* .nt2-header is stable HTML, but full navigation creates a new document. */
/* No cross-document shared element animation. */

@media(max-width:1120px){
  body.nt-service-code .content>.nt2-code-tool-breadcrumbs{background:var(--nt2-surface)!important}
  body.nt-service-code .content>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner{width:100%!important}
}
@media(max-width:860px){
  html[data-nt-service="code"] body .content,html[data-nt-service="code"][data-nt-tool-page="1"] body .content{margin-left:0!important;padding-top:116px!important}
  body.nt-service-code .content>.nt2-code-tool-breadcrumbs{grid-column:1!important;grid-row:1!important}
  body.nt-service-code .content>.editor{grid-column:1!important;grid-row:2!important}
  body.nt-service-code .content>.preview{grid-column:1!important;grid-row:3!important;min-height:auto!important}
}

/* v0.3.6 canonical CodeFlow geometry: beats legacy route-specific CSS before the first paint. */
body.nt2-shell-ready.nt-service-code .content,
html[data-nt-service="code"] body.nt2-shell-ready .content{
  margin-left:var(--nt2-left-offset)!important;
  width:calc(100% - var(--nt2-left-offset))!important;
  padding-top:var(--nt2-header-h)!important;
  transition:none!important;
}
body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.nt2-code-tool-breadcrumbs,
body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.nt2-generated-breadcrumbs{
  grid-column:1/-1!important;grid-row:1!important;
  width:100%!important;max-width:none!important;
  justify-self:stretch!important;align-self:stretch!important;
  margin:0!important;padding:0!important;min-height:52px!important;
  display:flex!important;align-items:center!important;
  background:linear-gradient(90deg,var(--nt2-surface) 0 44%,var(--nt2-bg) 44% 100%)!important;
}
body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner{
  width:44%!important;max-width:none!important;min-width:0!important;
  margin:0!important;padding:0 clamp(26px,4vw,54px)!important;
}
body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.editor{
  grid-column:1!important;grid-row:2!important;
}
body.nt2-shell-ready.nt-service-code .content:not(.code-home-full):not(.scan-full)>.preview{
  grid-column:2!important;grid-row:2!important;
}
body.nt2-sidebar-changing.nt2-shell-ready.nt-service-code .content{
  transition:margin-left .17s ease,width .17s ease!important;
}
@media(max-width:1120px){
  body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.nt2-code-tool-breadcrumbs{background:var(--nt2-surface)!important}
  body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner{width:100%!important}
}
@media(max-width:860px){
  html[data-nt-service="code"] body.nt2-shell-ready .content,
  body.nt2-shell-ready.nt-service-code .content{
    margin-left:0!important;width:100%!important;padding-top:116px!important;
    grid-template-columns:minmax(0,1fr)!important;
  }
  body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.nt2-code-tool-breadcrumbs{
    grid-column:1!important;grid-row:1!important;background:var(--nt2-surface)!important;
  }
  body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.editor{grid-column:1!important;grid-row:2!important}
  body.nt2-shell-ready.nt-service-code .content:not(.code-home-full):not(.scan-full)>.preview{grid-column:1!important;grid-row:3!important}
}


/* ===== NightTools 0.3.6.1 — stable adapters / responsive QA ===== */
/* Stable type in the shared search; never inherit the font metrics of the active service. */
.nt2-header,.nt2-search,.nt2-search input,.nt2-search input::placeholder{
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif!important;
}
.nt2-search input{font-size:13px!important;line-height:20px!important;font-weight:400!important;letter-spacing:0!important}
.nt2-search input::placeholder{font-size:13px!important;font-weight:400!important;letter-spacing:0!important}
/* A single scrollbar, no unintended horizontal stretching of page roots. */
body.nt2-shell-ready{max-width:100%}
body.nt2-shell-ready>.home-shell,body.nt2-shell-ready>.nt-shell,body.nt2-shell-ready>.site-body,
body.nt2-shell-ready>.site-shell,body.nt2-shell-ready>.nt3-category-page{min-width:0;max-width:100%}
/* Respect reduced motion for deliberate sidebar toggles as well. */
@media(prefers-reduced-motion:reduce){
  body.nt2-sidebar-changing .nt3-category-page,body.nt2-sidebar-changing .nt2-section-landing,
  body.nt2-sidebar-changing .nt2-footer,body.nt2-sidebar-changing.nt-service-text .site-body,
  body.nt2-sidebar-changing.nt-service-image .nt-shell,body.nt2-sidebar-changing.nt-service-code .content,
  body.nt2-sidebar-changing.nt-service-calc .site-shell,body.nt2-sidebar-changing.nt-service-pdf .main{transition:none!important}
}
/* QR breadcrumbs: use each column's surface all the way up to the chrome, no white full-width bar.
   Align with the same 44/56 editor/preview split and do not set a solid surface at 1120px. */
body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.nt2-code-tool-breadcrumbs,
body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.nt2-generated-breadcrumbs{
 background:linear-gradient(to right,var(--nt2-surface) 0 44%,var(--nt2-bg) 44% 100%)!important;
 border-bottom:0!important;
}
/* When the app renders breadcrumbs outside the content grid use the same background treatment. */
body.nt-service-code .app-shell>.nt2-code-tool-breadcrumbs{
 background:linear-gradient(to right,var(--nt2-surface) 0 44%,var(--nt2-bg) 44% 100%)!important;
}
@media(max-width:1120px){
 body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.nt2-code-tool-breadcrumbs,
 body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.nt2-generated-breadcrumbs{
  background:linear-gradient(to right,var(--nt2-surface) 0 44%,var(--nt2-bg) 44% 100%)!important
 }
}
@media(max-width:860px){
 :root{--nt2-mobile-content-top:116px}
 /* The legacy 68px preboot geometry has greater selector specificity than old mobile rules. */
 html[data-nt-service="text"] body.nt2-shell-ready .site-body,
 html[data-nt-service="image"] body.nt2-shell-ready .nt-shell,
 html[data-nt-service="calc"] body.nt2-shell-ready .site-shell{
  padding-top:var(--nt2-mobile-content-top)!important;padding-left:0!important
 }
 html[data-nt-service="code"] body.nt2-shell-ready .content,
 html[data-nt-service="pdf"] body.nt2-shell-ready .main{
  padding-top:var(--nt2-mobile-content-top)!important;margin-left:0!important;width:100%!important
 }
 body.nt2-shell-ready:not(.nt-service-image):not(.nt-service-text):not(.nt-service-code):not(.nt-service-pdf) .home-shell{
  padding-top:0!important;padding-left:0!important
 }
 body.nt-service-image .nt-page main,body.nt-service-image .nt-page .nt-breadcrumbs,
 body.nt-service-text .content-wrap,body.nt-service-calc .content,
 body.nt-service-calc .breadcrumbs.nt2-breadcrumbs{width:min(100% - 28px,1120px)!important;max-width:100%!important}
 .nt2-section-landing,.nt3-category-page{margin-left:0!important;padding-top:calc(var(--nt2-mobile-content-top) + 16px)!important}
 .nt2-footer{padding-left:0!important}
 html{scroll-padding-top:128px}
 body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.nt2-code-tool-breadcrumbs,
 body.nt-service-code .app-shell>.nt2-code-tool-breadcrumbs{
  background:var(--nt2-surface)!important
 }
}
@media(max-width:620px){
 /* The view switch must not push outside the 360–430px mobile viewport. */
 .home-main .section-head{flex-direction:column!important;align-items:stretch!important;gap:12px!important}
 .home-main .home-view-switch{width:100%!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .home-main .home-view-switch button{min-width:0!important;white-space:nowrap!important}
 body.nt-service-home .home-main{width:min(100% - 28px,1120px)!important;min-width:0!important}
 body.nt-service-home .home-hero h1{overflow-wrap:normal;word-break:normal;font-size:clamp(30px,8.6vw,40px)!important}
 body.nt-service-image .nt-hero,body.nt-service-text .title-stage{padding-top:12px!important}
 body.nt-service-image .nt-page main{width:calc(100% - 28px)!important}
 .nt2-search-wrap{min-width:0}
 .nt2-search input{min-width:0}
}

/* NightTools 0.3.6.2: match CodeFlow's responsive grid to the available space,
   not the entire viewport. The original 460+520px minimum overflowed beside sidebar. */
@media (min-width:861px){
  body.nt2-shell-ready.nt-service-code .content:not(.scan-full):not(.code-home-full){
    grid-template-columns:minmax(0,44fr) minmax(0,56fr)!important;
  }
}
@media (min-width:861px) and (max-width:1379px){
  body.nt2-shell-ready.nt-service-code .content:not(.scan-full):not(.code-home-full){
    grid-template-columns:minmax(0,1fr)!important;
  }
  body.nt2-shell-ready.nt-service-code .content:not(.scan-full):not(.code-home-full)>.editor{
    grid-column:1!important;grid-row:2!important;border-right:0!important;border-bottom:1px solid var(--nt2-line)!important;
  }
  body.nt2-shell-ready.nt-service-code .content:not(.scan-full):not(.code-home-full)>.preview{
    grid-column:1!important;grid-row:3!important;
  }
  body.nt2-shell-ready.nt-service-code .content:not(.scan-full):not(.code-home-full)>.nt2-code-tool-breadcrumbs{
    background:var(--nt2-surface)!important;
  }
  body.nt2-shell-ready.nt-service-code .content:not(.scan-full):not(.code-home-full)>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner{
    width:100%!important;
  }
}
/* Full-width payment + QR editors: breadcrumb canvas matches the editor surface.
   No gradient seam on medium screens. */
@media (min-width:1121px){
  body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.nt2-code-tool-breadcrumbs{
    background:linear-gradient(90deg,var(--nt2-surface) 0 44%,var(--nt2-bg) 44% 100%)!important;
  }
}
@media (max-width:860px){
  body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.nt2-code-tool-breadcrumbs{
    background:var(--nt2-surface)!important;
  }
  body.nt2-shell-ready.nt-service-code .content:not(.code-home-full)>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner{
    width:100%!important;
  }
  /* Footer tools and scrolling must not sit beneath the mobile navigation. */
  body.nt2-shell-ready .home-shell,body.nt2-shell-ready .site-shell,
  body.nt2-shell-ready .nt-shell,body.nt2-shell-ready .site-body,
  body.nt2-shell-ready .nt3-category-page,body.nt2-shell-ready .nt2-section-landing{
    padding-bottom:max(74px,calc(64px + env(safe-area-inset-bottom)))!important;
  }
}
/* Keep all landing pages aligned with the common 1120px canvas. */
.nt2-section-landing>.nt2-breadcrumbs,.nt2-landing-hero,.nt2-landing-groups,
.nt3-category-inner{max-width:1120px}
/* Avoid horizontal clipping instead of hiding content overflow from broken children. */
.nt2-header,.nt2-search-wrap,.nt2-search,.nt2-search input{min-width:0}
@media (max-width:390px){
  .nt2-header-left{gap:6px}
  .nt2-header{padding-inline:10px!important}
  .nt2-section-chip{max-width:105px}
}


/* NightTools 0.3.6.3: one horizontal canvas for category pages. */
:root{--nt2-content-max:1120px;--nt2-content-gutter:24px}
body.nt2-shell-ready .nt3-category-inner,
body.nt2-shell-ready .nt2-section-landing>.nt2-breadcrumbs,
body.nt2-shell-ready .nt2-landing-hero,
body.nt2-shell-ready .nt2-landing-groups,
body.nt2-shell-ready .home-main,
body.nt2-shell-ready.nt-service-image .nt-page main,
body.nt2-shell-ready.nt-service-text .content-wrap,
body.nt2-shell-ready.nt-service-code .code-home-inner,
body.nt2-shell-ready.nt-service-calc .content,
body.nt2-shell-ready.nt-service-calc .breadcrumbs.nt2-breadcrumbs {
  width:min(var(--nt2-content-max),calc(100% - 2 * var(--nt2-content-gutter)))!important;
  max-width:var(--nt2-content-max)!important;
  margin-inline:auto!important;
}
/* PDF category now matches all other 1120px categories; tools retain wide canvas. */
body.nt2-shell-ready.nt-service-pdf .page-container:not(.tool-wide):not(.pdf-word-wide){
  width:min(var(--nt2-content-max),calc(100% - 2 * var(--nt2-content-gutter)))!important;
  max-width:var(--nt2-content-max)!important;
  margin-inline:auto!important;
}
/* No remount animation on safe category transitions. */
body.nt2-shell-ready .nt2-footer-inner{max-width:var(--nt2-content-max)}
@media(max-width:860px){:root{--nt2-content-gutter:14px}}


/* ===== NightTools 0.3.6.4: stable content lane / overlay tool drawer =====
   Invariant: panel visibility MUST NOT change the layout width or left coordinate.
   The icon rail (74px) is the only desktop space reserved for navigation.
   The 264px tool drawer is an overlay, as in a conventional app shell.
   Future modules MUST use the shared --nt2-content-max and gutter tokens. */
:root {
  --nt2-left-offset:var(--nt2-rail-w);
  --nt2-content-max:1120px;
  --nt2-content-gutter:24px;
}
html[data-nt-sidebar="expanded"],
html[data-nt-sidebar="collapsed"],
body.nt2-shell-ready,
body.nt2-shell-ready.nt2-sidebar-collapsed,
body.nt2-shell-ready.nt2-no-tool-panel {
  --nt2-left-offset:var(--nt2-rail-w);
}
/* 0.3.6.3 gave category flex children width:100% *plus* a left margin,
   overflowing the viewport and offsetting content horizontally. */
html,body.nt2-shell-ready { margin:0!important; }
body.nt2-shell-ready>.nt3-category-page,
body.nt2-shell-ready>.nt2-section-landing {
  width:calc(100% - var(--nt2-left-offset))!important;
  max-width:calc(100% - var(--nt2-left-offset))!important;
  flex:1 0 auto;
  min-width:0!important;
}
@media (min-width:861px) {
  /* Render drawer above content, never as a column that causes reflow. */
  body.nt2-shell-ready .nt2-tool-panel {
    position:fixed!important;
    left:var(--nt2-rail-w)!important;
    width:var(--nt2-panel-w)!important;
    box-shadow:10px 0 32px rgba(0,0,0,.15);
  }
  /* Disable former margin/padding animation on EVERY page, even during user toggles. */
  body.nt2-shell-ready .nt3-category-page,
  body.nt2-shell-ready .nt2-section-landing,
  body.nt2-shell-ready .nt2-footer,
  body.nt2-shell-ready.nt-service-image .nt-shell,
  body.nt2-shell-ready.nt-service-text .site-body,
  body.nt2-shell-ready.nt-service-calc .site-shell,
  body.nt2-shell-ready.nt-service-code .content,
  body.nt2-shell-ready.nt-service-code .app-shell>.nt2-code-tool-breadcrumbs,
  body.nt2-shell-ready.nt-service-pdf .main,
  body.nt2-sidebar-changing .nt3-category-page,
  body.nt2-sidebar-changing .nt2-section-landing,
  body.nt2-sidebar-changing .nt2-footer {
    transition:none!important;
  }
}
/* PDFFlow already uses an inset within .page-container; the legacy .page
   padding added a second 20-28px inset on narrow viewports. */
body.nt2-shell-ready.nt-service-pdf .main .page {padding-left:0!important;padding-right:0!important}
/* Shared 1120px category canvas for all five services plus Home.
   Parent lanes have the same stable icon-rail offset on desktop. */
body.nt2-shell-ready .home-main,
body.nt2-shell-ready .nt3-category-inner,
body.nt2-shell-ready .nt2-section-landing>.nt2-breadcrumbs,
body.nt2-shell-ready .nt2-landing-hero,
body.nt2-shell-ready .nt2-landing-groups,
body.nt2-shell-ready.nt-service-image .nt-page main,
body.nt2-shell-ready.nt-service-image .nt-page .nt-breadcrumbs,
body.nt2-shell-ready.nt-service-text .content-wrap,
body.nt2-shell-ready.nt-service-code .code-home-inner,
body.nt2-shell-ready.nt-service-calc .content,
body.nt2-shell-ready.nt-service-calc .main-content,
body.nt2-shell-ready.nt-service-calc .breadcrumbs.nt2-breadcrumbs,
body.nt2-shell-ready.nt-service-pdf .page-container:not(.tool-wide):not(.pdf-word-wide) {
  width:min(var(--nt2-content-max),calc(100% - 2 * var(--nt2-content-gutter)))!important;
  max-width:var(--nt2-content-max)!important;
  margin-inline:auto!important;
  box-sizing:border-box!important;
}
/* Keep the footer content on exactly the same canvas, independent of the drawer. */
body.nt2-shell-ready .nt2-footer-inner {
  width:min(var(--nt2-content-max),calc(100% - 2 * var(--nt2-content-gutter)))!important;
  max-width:var(--nt2-content-max)!important;
  margin-inline:auto!important;
}
/* QR editor uses a fixed breakpoint, not an expanded/collapsed-state breakpoint. */
@media (min-width:861px) and (max-width:1379px) {
  body.nt2-shell-ready.nt-service-code .content:not(.scan-full):not(.code-home-full) {
    grid-template-columns:minmax(0,1fr)!important;
  }
  body.nt2-shell-ready.nt-service-code .content:not(.scan-full):not(.code-home-full)>.editor {
    grid-column:1!important;grid-row:2!important;
  }
  body.nt2-shell-ready.nt-service-code .content:not(.scan-full):not(.code-home-full)>.preview {
    grid-column:1!important;grid-row:3!important;
  }
  body.nt2-shell-ready.nt-service-code .content:not(.scan-full):not(.code-home-full)>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner {
    width:100%!important;
  }
}
@media (max-width:860px) {
  :root,html[data-nt-sidebar="expanded"],html[data-nt-sidebar="collapsed"],
  body.nt2-shell-ready,body.nt2-shell-ready.nt2-sidebar-collapsed,
  body.nt2-shell-ready.nt2-no-tool-panel {
    --nt2-left-offset:0px;
    --nt2-content-gutter:14px;
  }
}

/* 0.3.6.5: PhotoFlow native editor canvas matches the other default tools. */
body.nt2-shell-ready.nt-service-image{--max:var(--nt2-content-max,1120px)}


/* NightTools v0.3.6.5 UI recovery — mobile category dock + truly non-sticky search.
   The shared search is a SIBLING of the fixed header, not its child. */
@media (min-width:861px) {
  .nt2-search-wrap{position:fixed;z-index:2030}
}
@media (max-width:860px) {
  :root{--nt2-header-mobile-h:58px;--nt2-mobile-nav-h:60px}
  .nt2-header{
    position:fixed!important;height:var(--nt2-header-mobile-h)!important;
    min-height:var(--nt2-header-mobile-h)!important;
    display:flex!important;grid-template-columns:none!important;align-items:center!important;
    padding:7px 12px!important;gap:5px!important
  }
  .nt2-header-left{flex:1 1 auto;min-width:0;gap:7px}
  .nt2-section-chip{max-width:105px;min-width:0}
  .nt2-header-actions{display:flex!important;flex:0 0 auto;gap:2px}
  .nt2-header-actions .nt2-runtime-chip{display:none!important}
  .nt2-header-actions .nt2-icon-button{width:36px;height:36px;flex-basis:36px}
  .nt2-search-wrap{
    position:relative!important;z-index:1800!important;left:auto!important;top:auto!important;
    transform:none!important;grid-column:auto!important;grid-row:auto!important;
    width:auto!important;max-width:none!important;margin:var(--nt2-header-mobile-h) 0 0!important;
    padding:5px 12px 7px!important;flex:0 0 auto;background:var(--nt2-bg)
  }
  .nt2-search-results{top:calc(100% - 4px);left:12px;right:12px;max-height:min(55dvh,420px)}
  body.nt2-shell-ready>.home-shell{padding-top:0!important}
  html[data-nt-service="image"] body.nt2-shell-ready .nt-shell,
  html[data-nt-service="text"] body.nt2-shell-ready .site-body,
  html[data-nt-service="calc"] body.nt2-shell-ready .site-shell,
  html[data-nt-service="code"] body.nt2-shell-ready .content,
  html[data-nt-service="pdf"] body.nt2-shell-ready .main{padding-top:0!important}
  body.nt2-shell-ready>.nt3-category-page,
  body.nt2-shell-ready>.nt2-section-landing{padding-top:14px!important}
  html{scroll-padding-top:calc(var(--nt2-header-mobile-h) + 10px)}
  .nt2-mobile-nav{height:calc(var(--nt2-mobile-nav-h) + env(safe-area-inset-bottom))!important;padding:4px 6px calc(4px + env(safe-area-inset-bottom))!important}
  .nt2-mobile-nav-item{height:50px;min-height:48px;gap:1px;padding:2px}
  .nt2-mobile-nav-item span{height:24px}
  .nt2-mobile-nav-item svg{width:19px;height:19px}
  .nt2-mobile-nav-item small{font-size:10px}
  .nt2-mobile-nav-item.active{color:var(--nt2-text);background:var(--nt2-surface-2);border-color:var(--nt2-line)}
  body.nt2-shell-ready{padding-bottom:calc(var(--nt2-mobile-nav-h) + env(safe-area-inset-bottom))!important}
  .nt2-tool-panel{bottom:calc(var(--nt2-mobile-nav-h) + env(safe-area-inset-bottom) + 10px)!important}
  .nt2-tool-panel-scroll{min-height:0;padding-bottom:calc(28px + env(safe-area-inset-bottom))!important;overscroll-behavior:contain}
  .nt2-favorites-panel{margin-top:12px!important;padding-top:12px!important}
  .nt2-mobile-menu-open .nt2-mobile-backdrop,
  .nt2-mobile-more-open .nt2-mobile-backdrop{inset:var(--nt2-header-mobile-h) 0 calc(var(--nt2-mobile-nav-h) + env(safe-area-inset-bottom))!important}
  .nt2-mobile-more-panel{bottom:calc(var(--nt2-mobile-nav-h) + env(safe-area-inset-bottom) + 10px)!important}
}
@media(max-width:370px){
  .nt2-header{padding-inline:8px!important}
  .nt2-brand{gap:5px}
  .nt2-brand strong{font-size:12px}
  .nt2-menu-button{width:36px;height:36px;flex-basis:36px}
  .nt2-section-chip{max-width:68px;padding:0 6px}
  .nt2-section-chip-copy{display:none}
}
.nt2-favorite-panel-empty,.nt2-favorites-empty{
  display:flex;flex-direction:column;justify-content:center;align-items:center;
  gap:6px;text-align:center;min-height:108px;padding:16px 12px;
  border-radius:12px;color:var(--nt2-muted-2);line-height:1.4
}
.nt2-favorite-panel-empty strong,.nt2-favorites-empty strong{font-size:12px;color:var(--nt2-text);font-weight:750}
.nt2-favorite-panel-empty small,.nt2-favorites-empty small{font-size:11px;color:var(--nt2-muted-2)}
.nt2-favorite-empty-icon{font-size:23px;line-height:1;color:var(--nt2-muted)}
.nt2-favorites-empty{grid-column:1/-1;border:1px dashed var(--nt2-line-strong);background:var(--nt2-surface);min-height:124px}
/* Search icon is a line icon even on the bare portal homepage (no service CSS). */
.nt2-search svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}


/* ===== NightTools 0.3.6.5-ui3: content-width consistency =====
   CodeFlow working editor/Scanner Pro is intentionally excluded. */
:root{--nt2-content-max:1120px}
/* PhotoFlow category, native image tools, PDFFlow category/tools, TextFlow,
   Calculator categories/tools share the SAME outer responsive content lane. */
body.nt2-shell-ready.nt-service-pdf .page-container,
body.nt2-shell-ready.nt-service-pdf .page-container.tool-wide,
body.nt2-shell-ready.nt-service-pdf .page-container.pdf-word-wide,
body.nt2-shell-ready.nt-service-image .nt-page main,
body.nt2-shell-ready.nt-service-image .nt-page .nt-breadcrumbs,
body.nt2-shell-ready.nt-service-text .content-wrap,
body.nt2-shell-ready.nt-service-calc .content,
body.nt2-shell-ready.nt-service-calc .breadcrumbs.nt2-breadcrumbs,
body.nt2-shell-ready .nt3-category-inner,
body.nt2-shell-ready .nt2-section-landing>.nt2-breadcrumbs,
body.nt2-shell-ready .nt2-landing-hero,
body.nt2-shell-ready .nt2-landing-groups,
body.nt2-shell-ready .home-main {
  box-sizing:border-box!important;
  width:min(var(--nt2-content-max),calc(100% - 2 * var(--nt2-content-gutter)))!important;
  max-width:var(--nt2-content-max)!important;
  margin-left:auto!important;margin-right:auto!important;
}
/* Calculator form panels should no longer cap at 960px while PDF is 1120px.
   Preserve their own internal grid/form proportions and mobile stacking. */
body.nt2-shell-ready.nt-service-calc .content>.calculator-panel,
body.nt2-shell-ready.nt-service-calc .content>.content-section,
body.nt2-shell-ready.nt-service-calc .content>.finance-chart-card,
body.nt2-shell-ready.nt-service-calc .content>.formula-card{max-width:100%!important}
/* Keep mobile search a document-flow block after the fixed header. */
@media(max-width:860px){
  body.nt2-shell-ready>.nt2-search-wrap{position:relative!important;left:auto!important;transform:none!important}
  .nt2-search{width:100%;height:42px}
  .nt2-header{z-index:2000}
}
/* Scan has a single editor canvas: the 44/56 two-column gradient must not split
   its breadcrumbs. Keep the QR studio split for non-scanner modes unchanged. */
@media(min-width:861px){
  body.nt2-shell-ready.nt-service-code .content.scan-full>.nt2-code-tool-breadcrumbs,
  body.nt2-shell-ready.nt-service-code .content.scan-full>.nt2-generated-breadcrumbs,
  body.nt2-shell-ready.nt-service-code .app-shell:has(.content.scan-full)>.nt2-code-tool-breadcrumbs{
    background:var(--nt2-surface)!important;
    border-bottom:1px solid var(--nt2-line)!important;
  }
  /* Drawer overlays the app; shift ONLY breadcrumbs text while drawer is open.
     Editor/scanner width remains untouched (explicit CodeFlow exception). */
  body.nt2-shell-ready.nt-service-code:not(.nt2-sidebar-collapsed) .content>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner,
  body.nt2-shell-ready.nt-service-code:not(.nt2-sidebar-collapsed) .app-shell>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner{
    padding-left:calc(var(--nt2-panel-w) + 22px)!important;
    width:100%!important;
  }
  body.nt2-shell-ready.nt-service-code.nt2-sidebar-collapsed .content>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner,
  body.nt2-shell-ready.nt-service-code.nt2-sidebar-collapsed .app-shell>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner{
    padding-left:clamp(26px,4vw,54px)!important;
  }
}
/* Generated category view switch used by PhotoFlow, no CodeFlow layout changes. */
.nt3-view-switch{align-items:center}
.nt3-view-switch button{min-height:40px}
@media(max-width:620px){
  body.nt-service-image .nt3-view-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  body.nt-service-image .nt3-view-switch button{min-width:0}
}
/* Sibling search block owns the first mobile content row. Padding rather than
   margin prevents first-child margin collapsing into the body on mobile. */
@media(max-width:860px){
  body.nt2-shell-ready>.nt2-search-wrap{
    display:block!important;
    margin:0!important;
    padding:calc(var(--nt2-header-mobile-h) + 5px) 12px 7px!important;
    box-sizing:border-box!important;
    width:100%!important;
    background:var(--nt2-bg)!important;
  }
}


/* ===== NightTools 0.3.6.5-ui4: category view + stable navigation ===== */
/* The 1120px category lane is measured from its PARENT lane on every service.
   PhotoFlow uses identical responsive gutters and box sizing to Calculator/CodeFlow. */
body.nt2-shell-ready > .nt3-category-page > .nt3-category-inner{
  width:min(1120px,calc(100% - 2 * var(--nt2-content-gutter)))!important;
  max-width:1120px!important;box-sizing:border-box!important;margin-inline:auto!important;
}
/* Catalog view switch is intentionally present only on category/hub pages. */
.nt2-catalog-switch{display:flex;justify-content:flex-end;gap:8px;margin:16px 0 14px}
.nt2-catalog-switch button{min-height:40px;min-width:93px}
.nt2-catalog-switch + .nt3-groups{padding-top:5px}
.nt2-catalog-switch + .tool-grid{margin-top:7px}
.tool-grid.nt2-pdf-list{grid-template-columns:minmax(0,1fr)!important}
body.nt-service-pdf .tool-grid.nt2-pdf-list .tool-card{
  display:grid!important;grid-template-columns:42px minmax(0,1fr);grid-template-rows:auto auto;
  column-gap:13px;row-gap:3px;min-height:78px!important;padding:13px 16px!important;
  align-content:center;align-items:center;
}
body.nt-service-pdf .tool-grid.nt2-pdf-list .tool-card-top{
  grid-column:1;grid-row:1 / 3;margin:0!important;justify-content:flex-start;
}
body.nt-service-pdf .tool-grid.nt2-pdf-list .tool-title{grid-column:2;grid-row:1;margin:0}
body.nt-service-pdf .tool-grid.nt2-pdf-list .tool-desc{grid-column:2;grid-row:2;margin:0}
/* All icons inside the shared search are strokes, regardless of tool CSS. */
.nt2-search .nt2-search-icon svg,
.nt2-search-results .nt2-search-icon svg{
  display:block!important;visibility:visible!important;width:18px!important;height:18px!important;
  flex:none!important;stroke:currentColor!important;stroke-width:1.8!important;
  stroke-linecap:round!important;stroke-linejoin:round!important;fill:none!important;
  opacity:1!important;
}
.nt2-search-results .nt2-search-icon svg :is(path,rect,circle,line,polyline,polygon){
  fill:none!important;stroke:currentColor!important;
}
/* CodeFlow breadcrumbs never change horizontal coordinate when drawer toggles;
   the drawer overlays page content without changing editor widths. */
@media(min-width:861px){
  body.nt2-shell-ready.nt-service-code .content>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner,
  body.nt2-shell-ready.nt-service-code .app-shell>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner{
    padding-left:calc(var(--nt2-panel-w) + 22px)!important;
  }
}
@media(max-width:620px){
  .nt2-catalog-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .nt2-catalog-switch button{min-width:0}
}
/* ui4 final precedence: the old collapsed-state override had higher selector
   specificity. Make both states use the exact same breadcrumb text inset. */
@media(min-width:861px){
  body.nt2-shell-ready.nt-service-code.nt2-sidebar-collapsed .content:not(.code-home-full)>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner,
  body.nt2-shell-ready.nt-service-code:not(.nt2-sidebar-collapsed) .content:not(.code-home-full)>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner,
  body.nt2-shell-ready.nt-service-code.nt2-sidebar-collapsed .app-shell>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner,
  body.nt2-shell-ready.nt-service-code:not(.nt2-sidebar-collapsed) .app-shell>.nt2-code-tool-breadcrumbs .nt2-code-breadcrumbs-inner{
    padding-left:calc(var(--nt2-panel-w) + 22px)!important;
    box-sizing:border-box!important;
    width:100%!important;
  }
}

/* NightTools SEO1 UXFIX1: category root width excludes rail instead of 100% + rail. */
@media(min-width:861px){
 body.nt2-shell-ready>.nt3-category-page{
  width:calc(100% - var(--nt2-left-offset))!important;
  margin-left:var(--nt2-left-offset)!important;
  flex:1 1 auto!important;
 }
}
@media(max-width:860px){
 body.nt2-shell-ready>.nt3-category-page{width:100%!important;margin-left:0!important}
 /* Equal-specificity override for the four :not(...) selectors in the legacy 116px rule.
    Header + search already own the mobile top space. */
 body.nt2-shell-ready.nt-service-home:not(.nt-service-image):not(.nt-service-text):not(.nt-service-code):not(.nt-service-pdf)>.home-shell{
  padding-top:0!important;
 }
}

/* UXFIX2: Mobile home no longer reserves the old 116px header/search space twice.
   The search is already a document-flow sibling below the fixed mobile header. */

/* RC3: compact TextFlow breadcrumbs, avoid wrapping/overflow on 320–393px screens.
   Scope to TextFlow only; PDF and CodeFlow breadcrumbs are unchanged. */
@media(max-width:620px){
  body.nt2-shell-ready.nt-service-text .nt2-breadcrumbs{
    display:flex!important;flex-wrap:nowrap!important;overflow:hidden!important;
    white-space:nowrap!important;max-width:100%!important;min-width:0!important;
  }
  body.nt2-shell-ready.nt-service-text .nt2-breadcrumbs>a,
  body.nt2-shell-ready.nt-service-text .nt2-breadcrumbs>span:not(:last-child){flex:0 0 auto!important}
  body.nt2-shell-ready.nt-service-text .nt2-breadcrumbs>strong,
  body.nt2-shell-ready.nt-service-text .nt2-breadcrumbs>span:last-child{
    flex:0 1 auto!important;min-width:0!important;overflow:hidden!important;
    text-overflow:ellipsis!important;white-space:nowrap!important;display:block!important;
  }
}

/* RC5 grouping should not inherit root grid columns */
body.nt-service-pdf #popularTools{display:block!important}
body.nt-service-pdf #popularTools .pdf-catalog-cards{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}
body.nt-service-pdf #popularTools .tool-icon svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8}
@media(max-width:920px){body.nt-service-pdf #popularTools .pdf-catalog-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:620px){body.nt-service-pdf #popularTools .pdf-catalog-cards{grid-template-columns:1fr!important}}
