/* NightDrift design system. Screen-only: original document/print styles remain intact. */
@media screen {
html:has(body[data-ndrp-portal]) { color-scheme:dark; }
html body[data-ndrp-portal] {
  --nd-bg:#0b0f14; --nd-panel:#121a23; --nd-raised:#19232e; --nd-line:#293544;
  --nd-text:#f2f5fa; --nd-muted:#a4b1c2; --nd-accent:#efb47b; --nd-accent-soft:#efb47b14;
  --bg:var(--nd-bg); --panel:var(--nd-panel); --panel2:var(--nd-raised); --panel3:#101720;
  --line:var(--nd-line); --border:var(--nd-line); --text:var(--nd-text); --muted:var(--nd-muted);
  --accent:var(--nd-accent); --accent2:var(--nd-accent); --shadow:0 10px 30px #00000018;
  --lspd-bg:var(--nd-bg); --lspd-card:var(--nd-panel); --lspd-line:var(--nd-line);
  background:var(--nd-bg)!important; color:var(--nd-text); margin:0;
  font-family:Inter,"Segoe UI",Arial,sans-serif; font-size:14px; line-height:1.55;
  -webkit-font-smoothing:antialiased; accent-color:var(--nd-accent);
}
html body[data-ndrp-portal="industry"] { --nd-accent:#80bcff; --nd-accent-soft:#80bcff14; }
html body[data-ndrp-portal="fire"] { --nd-accent:#edaa83; --nd-accent-soft:#edaa8314; }
html body[data-ndrp-portal="medical"] { --nd-accent:#7bcee2; --nd-accent-soft:#7bcee214; }
html body[data-ndrp-portal].lspd-body { --nd-accent:#80bcff; --nd-accent-soft:#80bcff14; }
body[data-ndrp-portal]::before { display:none; }
body[data-ndrp-portal] *,body[data-ndrp-portal] *::before,body[data-ndrp-portal] *::after { box-sizing:border-box; }
body[data-ndrp-portal] ::selection { background:#80bcff40; color:#fff; }
body[data-ndrp-portal] :is(h1,h2,h3,h4) { color:var(--nd-text); line-height:1.2; }
body[data-ndrp-portal] h1 { font-size:clamp(27px,3.4vw,43px); letter-spacing:-1.3px; font-weight:700; }
body[data-ndrp-portal] h2 { font-size:22px; letter-spacing:-.5px; }
body[data-ndrp-portal] h3 { letter-spacing:-.3px; }
body[data-ndrp-portal] :is(.eyebrow,.system-label,.login-kicker) { color:var(--nd-accent)!important; background:none; -webkit-text-fill-color:var(--nd-accent); font-size:10px; font-weight:700; letter-spacing:2px; }
body[data-ndrp-portal] .eyebrow::before { background:var(--nd-accent); height:1px; }
body[data-ndrp-portal] :is(.shell,.portal-shell) { width:min(1320px,calc(100% - 64px)); padding-top:32px; padding-bottom:48px; margin:0 auto; }
body[data-ndrp-portal] :is(.hero,.law-admin-head) { gap:24px; }
body[data-ndrp-portal] :is(.hero p,.header-center p,.portal-brand p) { color:var(--nd-muted); font-size:14px; line-height:1.7; }
body[data-ndrp-portal] :is(.card,.panel,.lspd-card,.stat-card,.config,.denied,.recovery-card,.ticket-list,.ticket-main,.events,.warning-panel,.quick,.audit-summary,.audit-item) {
  border-radius:12px; box-shadow:0 8px 26px #00000012; backdrop-filter:none;
}
/* Higher specificity replaces previous department gradient overrides. Status borders stay semantic. */
html body[data-ndrp-portal] :is(.card,.panel,.lspd-card,.stat-card,.config,.denied,.recovery-card,.ticket-list,.ticket-main) {
  background:var(--nd-panel)!important; border-color:var(--nd-line)!important;
}
body[data-ndrp-portal] :is(.entry,.thread article,.task,.request,.board-column,.board-order,.planned-recipe,.shopping-item,.ingredient,.base-recipe,.location,.setup) {
  background:#101720!important; border-radius:9px; box-shadow:none;
}
body[data-ndrp-portal] :is(.task.overdue,.notice.error,.error,.danger,.bad,.audit-item.danger) { border-color:#d87583!important; }
body[data-ndrp-portal] :is(.success,.good) { border-color:#599d82; }
body[data-ndrp-portal] :is(.task.done,.completed) { opacity:.8; }
body[data-ndrp-portal] :is(a,button,input,select,textarea,summary):focus-visible { outline:2px solid var(--nd-accent)!important; outline-offset:3px; }
html body[data-ndrp-portal] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="color"]),select,textarea) {
  background:#0b121b!important; color:var(--nd-text); border:1px solid #344355!important;
  border-radius:8px!important; font-family:inherit; font-size:14px; max-width:100%; min-width:0;
}
body[data-ndrp-portal] input::placeholder,body[data-ndrp-portal] textarea::placeholder { color:#8594a8; }
body[data-ndrp-portal] select option { background:#121a23; color:var(--nd-text); }
body[data-ndrp-portal] :is(input,select,textarea):disabled { opacity:.5; cursor:not-allowed; }
body[data-ndrp-portal] input[readonly] { color:#b4c2d4!important; }
body[data-ndrp-portal] button { font-family:inherit; }
body[data-ndrp-portal] :is(.button,.btn,.admin-btn,.secondary-home,.back-button,.back,.lspd-primary,.lspd-secondary,.planner-clear,.add-to-plan,.station-duty-button) { border-radius:8px!important; font-weight:600; box-shadow:none; }
html body[data-ndrp-portal] :is(.button.primary,.admin-btn,.lspd-primary,.add-to-plan,.auth-submit) {
  background:var(--nd-accent)!important; border:1px solid var(--nd-accent)!important; color:#0b1520!important; box-shadow:none;
}
html body[data-ndrp-portal] :is(.button.secondary,.secondary-home,.back-button,.planner-clear,.lspd-secondary,.station-duty-button) {
  background:#172331!important; color:var(--nd-accent)!important; border:1px solid #34465b!important; box-shadow:none;
}
body[data-ndrp-portal] :is(button,a).danger,body[data-ndrp-portal] :is(button,a).delete { background:#3b1d27!important; color:#ffc0cb!important; border-color:#9a4e61!important; }
body[data-ndrp-portal] :is(button,a):hover { filter:none; }
body[data-ndrp-portal] :is(.card,.recipe-card,.system,.portal-card):hover { box-shadow:none; }
body[data-ndrp-portal] button:disabled { opacity:.45; cursor:not-allowed; transform:none; }
body[data-ndrp-portal] :is(.meta,.muted,small) { line-height:1.5; }
body[data-ndrp-portal] :is(.table-wrap,.table-responsive,.ndrp-table-scroll) { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
body[data-ndrp-portal] .ndrp-table-scroll:focus-visible { outline:2px solid var(--nd-accent); outline-offset:2px; }
body[data-ndrp-portal] table { font-size:13px; border-collapse:collapse; }
body[data-ndrp-portal] :is(th,td) { border-bottom-color:var(--nd-line); padding:13px 14px; }
body[data-ndrp-portal] th { color:#abbacf; font-size:10px; font-weight:650; text-transform:uppercase; letter-spacing:.8px; background:#101821; }
body[data-ndrp-portal] tbody tr:hover { background:#1a2735; }
body[data-ndrp-portal] :is(.stats article,.stats-inline span,.stat-card) { background:var(--nd-panel); box-shadow:none; border:1px solid var(--nd-line); border-radius:10px; }
body[data-ndrp-portal] :is(.stats strong,.stat-card strong) { font-variant-numeric:tabular-nums; }
body[data-ndrp-portal] :is(.stats-inline b,.shopping-amount,.required-qty,.desired-production b,.hardware-price) { color:var(--nd-accent); }
/* Shared portal navigation */
body[data-ndrp-portal] .ndrp-bar { display:flex; width:100%; max-width:none; position:static; border-radius:0; align-items:center; justify-content:space-between; gap:20px; padding:17px max(24px,calc((100% - 1320px)/2)); border-bottom:1px solid var(--nd-line); background:#0c1118; margin:0; }
body[data-ndrp-portal] .ndrp-wordmark { display:flex; align-items:center; gap:11px; color:var(--nd-text)!important; font-size:13px; text-decoration:none; }
body[data-ndrp-portal] .ndrp-mark { width:31px; height:31px; display:grid; place-items:center; border:1px solid #80bcff45; border-radius:8px; color:var(--nd-accent); font-weight:800; font-size:15px; }
body[data-ndrp-portal] .ndrp-wordmark strong { letter-spacing:1px; font-size:12px; }
body[data-ndrp-portal] .ndrp-wordmark small { display:block; color:var(--nd-accent); font-size:9px; letter-spacing:1.6px; text-transform:uppercase; }
body[data-ndrp-portal] .ndrp-links { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
body[data-ndrp-portal] .ndrp-links a { color:var(--nd-muted)!important; padding:8px 11px; border-radius:7px; font-size:12px; text-decoration:none; }
body[data-ndrp-portal] .ndrp-links a:hover,body[data-ndrp-portal] .ndrp-links a[aria-current="page"] { background:var(--nd-accent-soft); color:var(--nd-accent)!important; }
body[data-ndrp-portal] .ndrp-skip { position:absolute; top:-100px; left:16px; z-index:100; padding:12px; background:#1a293b; color:white; }
body[data-ndrp-portal] .ndrp-skip:focus { top:10px; }
/* Industry portal and calculator */
body[data-ndrp-portal="industry"].portal-body { display:block; }
body[data-ndrp-portal="industry"] .portal-brand { text-align:left; background:linear-gradient(90deg,#0b0f14f2,#0b0f1490),url('/assets/nightdrift/city-v1.jpg') center 57%/cover; padding:42px; border:1px solid var(--nd-line); border-radius:14px; margin-bottom:25px; }
body[data-ndrp-portal="industry"] .portal-brand .eyebrow { justify-content:flex-start; }
body[data-ndrp-portal="industry"] .portal-brand h1 { font-size:clamp(32px,4vw,52px); }
body[data-ndrp-portal="industry"] .portal-home { display:none; }
body[data-ndrp-portal="industry"] .portal-grid { grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr)); gap:18px; }
body[data-ndrp-portal="industry"] .portal-card { min-height:280px; padding:26px; border-radius:12px; background:var(--nd-panel); box-shadow:none; border-color:var(--nd-line); }
body[data-ndrp-portal="industry"] .portal-card::before { display:none; }
body[data-ndrp-portal="industry"] .portal-card:hover { border-color:var(--nd-accent); transform:translateY(-3px); }
body[data-ndrp-portal="industry"] .portal-icon { width:44px; height:44px; margin-bottom:22px; color:var(--nd-accent); border-radius:10px; background:var(--nd-accent-soft); }
body[data-ndrp-portal="industry"] .portal-icon svg { width:24px; height:24px; }
body[data-ndrp-portal="industry"] .portal-card h2 { font-size:25px; }
body[data-ndrp-portal="industry"] .portal-open { color:var(--nd-accent); border-top:1px solid var(--nd-line); padding-top:18px; width:100%; font-size:12px; }
body[data-ndrp-portal="industry"] .hero { padding-bottom:24px; border-bottom:1px solid var(--nd-line); }
body[data-ndrp-portal="industry"] .tabs { border-radius:10px; padding:8px; background:#101821; }
body[data-ndrp-portal="industry"] :is(.tab,.subgroup-tab) { border-radius:7px; }
body[data-ndrp-portal="industry"] :is(.tab.active,.subgroup-tab.active) { background:#80bcff17; color:#b8d9ff; border-color:#80bcff60; box-shadow:none; }
body[data-ndrp-portal="industry"] .station-info { padding:26px; }
body[data-ndrp-portal="industry"] .station-image::after { background:linear-gradient(90deg,transparent,#121a2340); }
body[data-ndrp-portal="industry"] .desired-production { border-color:#80bcff35; background:#80bcff08; }
body[data-ndrp-portal="industry"] .result-line { background:#7ddab40c; }
body[data-ndrp-portal="industry"] .login-shell { min-height:calc(100vh - 78px); background:linear-gradient(90deg,#0b0f14b8,#0b0f14dd),url('/assets/nightdrift/city-v1.jpg') center/cover; }
body[data-ndrp-portal="industry"] .login-card { text-align:left; border:1px solid var(--nd-line); padding:36px; border-radius:14px; background:#101923f5!important; }
body[data-ndrp-portal="industry"] .login-card h1 { font-size:37px; }
body[data-ndrp-portal="industry"] .discord-button { background:#5865f2; border-radius:8px; font-size:14px; text-align:center; }
/* Operations entrance retains real department emblems. */
body[data-ndrp-portal="operations"] .portal-header { padding:30px 28px; background:linear-gradient(90deg,#0b0f14e8,#0b0f1490),url('/assets/nightdrift/city-v1.jpg') center 60%/cover; border:1px solid var(--nd-line); border-radius:14px; grid-template-columns:100px minmax(0,1fr) 100px; gap:20px; }
body[data-ndrp-portal="operations"] .header-center h1 { font-size:clamp(28px,3.7vw,46px); }
body[data-ndrp-portal="operations"] .header-logo>span { background:#101821c9; box-shadow:none; border-radius:12px; }
body[data-ndrp-portal="operations"] .portal-police-mark { width:48px; height:48px; object-fit:contain; }
body[data-ndrp-portal="operations"] .job-nav { margin:0 0 18px; font-size:12px; }
body[data-ndrp-portal="operations"] .login-card { margin:28px auto; width:min(660px,100%); padding:32px; border:1px solid var(--nd-line); border-radius:12px; background:var(--nd-panel); box-shadow:none; }
body[data-ndrp-portal="operations"] :is(.login-card:before,.login-card:after,.login-glow) { display:none; }
body[data-ndrp-portal="operations"] .login-card h2 { font-size:28px; }
body[data-ndrp-portal="operations"] .portal-seal { border-color:var(--nd-line); border-radius:8px; }
body[data-ndrp-portal="operations"] .portal-seal :is(span,b) { background:#19232e; color:#bfccdc; font-size:11px; padding:7px 9px; }
body[data-ndrp-portal="operations"] .secure-pill { color:#95ceb5; background:#95ceb50b; border-color:#95ceb533; white-space:nowrap; }
body[data-ndrp-portal="operations"] .access-features { display:flex; flex-wrap:wrap; }
body[data-ndrp-portal="operations"] .access-features span { font-size:11px; }
html body[data-ndrp-portal="operations"] .login-card .discord { background:#5865f2!important; color:white!important; border-color:#7c86f8!important; box-shadow:none; }
body[data-ndrp-portal="operations"] .system { background:var(--nd-panel)!important; border:1px solid var(--nd-line); border-top:2px solid var(--nd-accent); border-radius:12px; min-height:270px; }
body[data-ndrp-portal="operations"] .system.fire { border-top-color:#e79191; }
body[data-ndrp-portal="operations"] .system.medical { border-top-color:#7bcee2; }
body[data-ndrp-portal="operations"] .system.police { border-top-color:#80bcff; }
body[data-ndrp-portal="operations"] .system.mechanic { border-top-color:#efb47b; }
body[data-ndrp-portal="operations"] .system:hover { border-color:var(--nd-accent); transform:translateY(-2px); }
body[data-ndrp-portal="operations"] .system .personal-greeting { font-size:23px; }
/* Existing sidebar layouts keep their positioning and mobile menu behavior. */
html body[data-ndrp-portal] :is(.sidebar,.main-sidebar) { background:#0e141c!important; border-right-color:var(--nd-line); box-shadow:none; }
body[data-ndrp-portal] :is(.sidebar,.main-sidebar) .ndrp-suite-link { display:block; color:var(--nd-accent); font-size:10px; text-transform:uppercase; letter-spacing:1.6px; padding:11px 12px; margin:0 0 14px; border-bottom:1px solid var(--nd-line); }
html body[data-ndrp-portal] :is(.sidebar,.main-sidebar) :is(nav a,.nav-link,.nav-group>a) { border-radius:7px; color:#a9b7c9!important; box-shadow:none!important; font-size:13px; background:transparent!important; }
html body[data-ndrp-portal] :is(.sidebar,.main-sidebar) :is(nav a,.nav-link,.nav-group>a):hover { background:#1a2532!important; color:#fff!important; }
html body[data-ndrp-portal] :is(.sidebar,.main-sidebar) :is(nav a,.nav-link,.nav-group>a).active { background:var(--nd-accent-soft)!important; color:var(--nd-accent)!important; border-left-color:var(--nd-accent)!important; box-shadow:inset 2px 0 var(--nd-accent)!important; }
html body[data-ndrp-portal] .sidebar :is(.nav-label,.nav-title,.sidebar-nav details.nav-group>summary) { color:#8394aa!important; -webkit-text-fill-color:#8394aa!important; font-size:10px!important; letter-spacing:1px; }
body[data-ndrp-portal] :is(.station-card,.sidebar-profile,.topbar-profile-menu,.sidebar-profile-menu) { background:#151e29!important; border-color:var(--nd-line)!important; border-radius:10px; box-shadow:none; }
body[data-ndrp-portal] :is(.topbar,.lspd-header,.top) { background:transparent; border-bottom-color:var(--nd-line); box-shadow:none; }
body[data-ndrp-portal] .topbar { height:auto; min-height:86px; padding-top:14px; padding-bottom:14px; }
body[data-ndrp-portal] .topbar h1 { font-size:clamp(22px,2.3vw,30px); letter-spacing:-.7px; }
body[data-ndrp-portal] .content { font-size:14px; }
body[data-ndrp-portal] :is(.grid,.split,.stats-grid,.records-layout)>* { min-width:0; }
body[data-ndrp-portal="operations"]:has(>.sidebar) .hero { background:linear-gradient(90deg,#121a23f5,#121a23b8),url('/assets/nightdrift/city-v1.jpg') center 60%/cover; border-color:var(--nd-line); }
body[data-ndrp-portal="operations"]:has(>.sidebar) :is(button,.button):not(.secondary):not(.danger):not(.delete) { background:var(--nd-accent); color:#15202a; }
body[data-ndrp-portal] :is(.sidebar,.main-sidebar) .ndrp-suite-link { text-decoration:none; }
body[data-ndrp-portal] .stat-card strong { font-size:30px; letter-spacing:-1px; }
body[data-ndrp-portal] .profile-avatar { border-color:var(--nd-line); background:#213045; color:#c7ddf5; }
body[data-ndrp-portal] :is(.auth-card,.auth-panel) { background:#121a23f5; border-color:var(--nd-line); border-radius:14px; box-shadow:none; }
html body[data-ndrp-portal].auth-page { background:linear-gradient(90deg,#0b0f14dc,#0b0f14b5),url('/assets/nightdrift/city-v1.jpg') center/cover fixed!important; }
html body[data-ndrp-portal].portal-embedded { background:transparent!important; }
body[data-ndrp-portal].portal-embedded .ndrp-bar { display:none; }
body[data-ndrp-portal] [hidden] { display:none!important; }
@media(max-width:900px) {
  body[data-ndrp-portal] :is(.shell,.portal-shell) { width:calc(100% - 36px); }
  body[data-ndrp-portal] .ndrp-bar { padding:14px 18px; }
  body[data-ndrp-portal] .portal-brand { padding:30px; }
  body[data-ndrp-portal] .topbar-actions { flex-wrap:wrap; }
  body[data-ndrp-portal] :is(.forms,.panels) { grid-template-columns:1fr; }
}
@media(max-width:600px) {
  body[data-ndrp-portal] :is(.shell,.portal-shell) { width:calc(100% - 28px); padding-top:23px; }
  body[data-ndrp-portal] .ndrp-bar { padding:13px 14px; flex-wrap:wrap; gap:10px; }
  body[data-ndrp-portal] .ndrp-links { width:100%; gap:3px; }
  body[data-ndrp-portal] .ndrp-links a { padding:7px 8px; font-size:11px; }
  body[data-ndrp-portal] h1 { font-size:30px; letter-spacing:-.8px; overflow-wrap:anywhere; }
  body[data-ndrp-portal] h2 { font-size:20px; }
  body[data-ndrp-portal] .portal-brand { padding:25px 22px; }
  body[data-ndrp-portal] :is(.portal-grid,.systems) { grid-template-columns:minmax(0,1fr); }
  body[data-ndrp-portal] .portal-card { min-height:245px; padding:22px; }
  body[data-ndrp-portal] .portal-header { grid-template-columns:1fr 1fr; grid-template-areas:'medical fire' 'center center'; gap:16px; padding:23px 18px; }
  body[data-ndrp-portal] .header-center { grid-area:center; }
  body[data-ndrp-portal] .header-logo-medical { grid-area:medical; }
  body[data-ndrp-portal] .header-logo-fire { grid-area:fire; }
  body[data-ndrp-portal] .portal-header .header-center h1 { font-size:31px; }
  body[data-ndrp-portal] .login-card { padding:24px; }
  body[data-ndrp-portal] .login-topline { flex-wrap:wrap; gap:10px; }
  body[data-ndrp-portal] :is(.hero,.law-admin-head) { flex-wrap:wrap; }
  body[data-ndrp-portal] :is(.hero-links,.admin-nav) { flex-wrap:wrap; }
  body[data-ndrp-portal] .ticket-grid { grid-template-columns:minmax(0,1fr); }
  body[data-ndrp-portal] .content { padding:22px 16px; }
  body[data-ndrp-portal] .grid.two { grid-template-columns:minmax(0,1fr); }
  body[data-ndrp-portal] .app-shell .topbar { flex-wrap:wrap; gap:12px; }
  body[data-ndrp-portal] .app-shell .topbar-title { flex:1; min-width:0; }
  body[data-ndrp-portal] .app-shell .topbar-title h1 { white-space:normal; overflow:visible; }
  body[data-ndrp-portal] .app-shell .topbar-actions { flex-basis:100%; justify-content:flex-end; }
  body[data-ndrp-portal] .topbar { padding-left:16px; padding-right:16px; }
}
@media(prefers-reduced-motion:reduce) { body[data-ndrp-portal] *,body[data-ndrp-portal] *::before,body[data-ndrp-portal] *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
}

body[data-ndrp-portal] img.ndrp-logo-image{width:44px;height:44px;object-fit:contain;border:0;border-radius:8px}
