/* NIGHTSHIFT alpha-0036 | presentation-only finishing layer.
   Loaded last to keep existing status colours, account accents and behaviour. */
:root { color-scheme:dark; --ns-focus:var(--ns-accent,#7fe7bc); }
html { scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body { text-rendering:optimizeLegibility; -webkit-font-smoothing:antialiased; }
button,input,select,textarea { font-family:inherit; }
button,select,a { -webkit-tap-highlight-color:transparent; }
:where(button,input,select,textarea,a,[tabindex]):focus-visible { outline:2px solid var(--ns-focus);outline-offset:3px; }
:where(button,[type=submit],[role=button]):disabled { cursor:not-allowed;opacity:.6; }
:where(.panel,.stat-card,.fleet-node,.admin-panel,.auth-card,.public-calendar-panel,.public-calendar-details) { box-shadow:0 8px 30px rgba(0,0,0,.075); }
:where(.panel,.stat-card,.fleet-node,.admin-panel,.auth-card) { background-clip:padding-box; }
:where(.admin-shell,.page-content,.public-main) { min-width:0; }
:where(.panel,.stat-card,.fleet-node,.admin-panel,.node-top,.service,.discovery-item) { overflow-wrap:anywhere; }
:where(.panel-titlebar,.intro,.fleet-header,.admin-flex,.public-calendar-toolbar) { min-width:0; }
:where(.node-name,.service-name-line h3,.admin-panel h2,.panel h2,.intro h1) { overflow-wrap:anywhere; }
:where(.admin-table,.rank-table) { font-variant-numeric:tabular-nums; }
:where(input,select,textarea) { max-width:100%; }
:where(textarea) { resize:vertical;line-height:1.5; }
:where(.btn,.ghost-action,.form-primary,.action-link,.outline-btn,.station-modal-save,.station-modal-cancel,.station-modal-close,.scope-go,.logout-btn) { transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease; }
:where(.btn,.ghost-action,.form-primary,.action-link,.outline-btn,.station-modal-save,.station-modal-cancel,.scope-go):active:not(:disabled) { transform:translateY(1px); }
:where(.sidebar .nav-link,.public-nav a) { transition:background-color .16s ease,color .16s ease,border-color .16s ease; }
:where(.admin-table,.rank-table) th { white-space:nowrap; }
:where(.admin-table,.rank-table) td { line-height:1.55; }
:where(.flash,.public-error,.station-modal-status) { overflow-wrap:anywhere; }
:where(.auth-card,.admin-panel) input:not([type=checkbox]):not([type=radio]),
:where(.auth-card,.admin-panel) select { min-height:39px; }
.station-modal-panel { min-width:0; }
.station-modal-body { scrollbar-gutter:stable; }
/* Preserve data tables on phones without forcing the whole viewport to scroll sideways. */
@media(max-width:900px) {
 .page-content { padding-left:22px;padding-right:22px; }
 .topbar { padding-left:22px;padding-right:22px; }
 .intro,.fleet-header { flex-wrap:wrap;align-items:flex-start; }
 .intro-actions,.fleet-controls { flex-wrap:wrap; }
 .admin-shell { min-width:0; }
 .admin-table { display:block;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain; }
}
@media(max-width:680px) {
 .page-content { padding:24px 14px 32px; }
 .topbar { padding-left:14px;padding-right:14px;min-width:0; }
 .topbar-right { gap:10px; }
 .intro { gap:16px;margin-bottom:22px; }
 .intro h1,.admin-shell h1 { font-size:clamp(25px,6vw,34px);line-height:1.16; }
 .panel { padding:18px 16px; }
 .stat-card { padding:17px 16px;min-width:0; }
 .node-top { padding:16px;flex-wrap:wrap; }
 .node-actions { flex-wrap:wrap; }
 .fleet-controls,.filters { max-width:100%; }
 .search { min-width:0;max-width:100%; }
 .search input { width:100%;min-width:0; }
 .admin-panel { max-width:100%; }
 .station-modal { padding:8px; }
 .station-modal-panel { border-radius:12px;max-height:calc(100dvh - 16px); }
 .station-modal-body { padding:16px; }
 .station-modal-actions { flex-wrap:wrap; }
 .auth-page { padding:16px; }
 .auth-card { padding:28px 22px; }
 .auth-brand { margin-bottom:30px; }
}
@media(max-width:390px) {
 .stat-card strong { font-size:clamp(26px,9vw,39px); }
 .top-clock { font-size:11px; }
 .station-modal-top { gap:10px; }
}
@media(prefers-reduced-motion:reduce) {
 html {scroll-behavior:auto;}
 *,*::before,*::after {animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important;}
}

/* Give focus rings room between fields and neighbouring text, site-wide. */
:where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]),select,textarea) {
 margin-block:6px;
}
/* Nested compact search fields have their own wrapper spacing. */
.search input {margin-block:0;}
