:root {
  --ui-clay-canvas:#e8f0ea;
  --ui-clay-face:#f5f9f5;
  --ui-clay-low:#e4eee6;
  --ui-clay-ink:#203c30;
  --ui-clay-muted:#526b5b;
  --ui-clay-line:#bccfc0;
  --ui-clay-accent:#087457;
  --ui-clay-link:#086749;
  --ui-clay-ring:#087457;
  --ui-clay-radius:24px;
  --ui-clay-control-radius:16px;
  --ui-clay-face-gradient:linear-gradient(145deg,#fafdf9,#f2f7f1 62%,#edf4ec);
  --ui-clay-shadow:5px 8px 18px -5px rgba(34,73,47,.16),inset 1px 1px 2px rgba(255,255,255,.92),inset -1px -2px 4px rgba(53,99,65,.06);
  --ui-clay-small-shadow:2px 4px 9px -3px rgba(34,73,47,.16),inset 1px 1px 2px rgba(255,255,255,.9);
  --ui-clay-well:inset 2px 2px 5px rgba(41,77,51,.1),inset -1px -1px 2px rgba(255,255,255,.85);
  --ui-clay-button-shadow:2px 4px 8px -2px rgba(7,77,48,.24),inset 1px 1px 2px rgba(255,255,255,.28),inset -1px -2px 3px rgba(0,44,29,.16);
  --ui-clay-button-pressed:inset 2px 3px 5px rgba(0,44,29,.28),inset -1px -1px 2px rgba(255,255,255,.16);
  --ui-clay-sidebar:linear-gradient(160deg,#064E3B,#04382A);
  --ui-clay-on-sidebar:#edfff4;
  --ui-clay-selection:#c2e6d2;
}
html[data-theme="dark"] {
  color-scheme:dark;
  --ui-clay-canvas:#0e1915;
  --ui-clay-face:#1d3026;
  --ui-clay-low:#14251c;
  --ui-clay-ink:#ecf7ef;
  --ui-clay-muted:#b4cbbc;
  --ui-clay-line:#4c6b57;
  --ui-clay-accent:#10B981;
  --ui-clay-link:#10B981;
  --ui-clay-ring:#10B981;
  --ui-clay-face-gradient:linear-gradient(145deg,#243b2e,#1d3026 64%,#1a2c22);
  --ui-clay-shadow:5px 8px 18px -5px rgba(0,0,0,.36),inset 1px 1px 2px rgba(214,255,226,.09),inset -1px -2px 4px rgba(0,0,0,.2);
  --ui-clay-small-shadow:2px 4px 9px -3px rgba(0,0,0,.4),inset 1px 1px 2px rgba(214,255,226,.075);
  --ui-clay-well:inset 2px 2px 5px rgba(0,0,0,.3),inset -1px -1px 2px rgba(214,255,226,.065);
  --ui-clay-selection:#365c46;
}
html[data-theme="light"] {color-scheme:light;}
body.ap-clay ::selection {background:var(--ui-clay-selection);color:var(--ui-clay-ink);}
body.ap-clay :is(input,textarea) {caret-color:var(--ui-clay-link);}

/* Resolve the legacy public/admin token families through one shared palette. */
html[data-theme] body.ap-clay,
html body.ap-clay {
  --bg:var(--ui-clay-canvas);--bg-mint:var(--ui-clay-canvas);
  --mint-bg:var(--ui-clay-canvas);--surface:var(--ui-clay-face);
  --surface-alt:var(--ui-clay-low);--surface-elevated:var(--ui-clay-face);
  --text:var(--ui-clay-ink);--text-dark:var(--ui-clay-ink);
  --text-secondary:var(--ui-clay-muted);--text-dim:var(--ui-clay-muted);
  --border:var(--ui-clay-line);--border-light:var(--ui-clay-line);
  --primary:var(--ui-clay-accent);--on-primary:#fff;
  --radius-md:16px;--radius-lg:24px;--radius-2xl:24px;
  --clay-r-card:var(--ui-clay-radius);--clay-r-pod:var(--ui-clay-control-radius);
  --clay-grad:var(--ui-clay-face-gradient);--clay-shadow:var(--ui-clay-shadow);
  --clay-shadow-hover:var(--ui-clay-shadow);--clay-shadow-well:var(--ui-clay-well);
  --clay-shadow-button:var(--ui-clay-button-shadow);
  --ap33-bg:var(--ui-clay-canvas);--ap33-surface:var(--ui-clay-face);
  --ap33-soft:var(--ui-clay-low);--ap33-ink:var(--ui-clay-ink);
  --ap33-text:var(--ui-clay-ink);--ap33-muted:var(--ui-clay-muted);
  --ap33-border:var(--ui-clay-line);--ap33-shadow:var(--ui-clay-shadow);
  --ap33-green:var(--ui-clay-link);--ap33-green-deep:var(--ui-clay-link);
  --apclay-canvas:var(--ui-clay-canvas);--apclay-face:var(--ui-clay-face);
  --apclay-face-low:var(--ui-clay-low);--apclay-ink:var(--ui-clay-ink);
  --apclay-muted:var(--ui-clay-muted);--apclay-border:var(--ui-clay-line);
  --apclay-grad:var(--ui-clay-face-gradient);--apclay-soft-grad:var(--ui-clay-face-gradient);
  --apclay-drop:var(--ui-clay-shadow);--apclay-hover:var(--ui-clay-shadow);
  --apclay-well:var(--ui-clay-well);
  --ap37-text:var(--ui-clay-ink);--ap37-subtext:var(--ui-clay-muted);
  --ap37-accent:var(--ui-clay-link);--ap37-outline:var(--ui-clay-line);
  --ap37-radius:var(--ui-clay-radius);
  --ap36-ink:var(--ui-clay-ink);--ap36-muted:var(--ui-clay-muted);
  --ap36-deep:var(--ui-clay-link);--ap36-forest:var(--ui-clay-link);
  --ap36-surface:var(--ui-clay-face);--ap36-stroke:var(--ui-clay-line);
  --ap36-shadow:var(--ui-clay-shadow);
  font-family:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  font-size:16px;
  color:var(--ui-clay-ink);
  background:var(--ui-clay-canvas);
}
html body.ap-clay :is(.main-content,.login-page-container,.login-form-panel) {
  background:var(--ui-clay-canvas);
}
html body.ap-clay :is(.card,.stat-card,.summary-card,.parameter-card,.metric-card,
  .settings-card,.device-card,.chart-card,.filter-card,.data-card,.about-card,
  .ap-page-header,.ap-dashboard-welcome,.ap-filter-panel,.ap-device-filter,
  .ap-notification-panel,.ap36-panel,.ap36-preview,.ap36-banner,.error-card,
  .login-form-card,.modal-content,.ap36-modal-panel,.device-modal-card,.table-card,
  .param-chart-card,.fan-control-card,.rule-based-card,.author-card,.about-visual-card,
  .clay-card,.empty-state,.ap-reset,.ap-toolbar-surface) {
  border-radius:var(--ui-clay-radius)!important;
  border:1px solid transparent!important;
  background:var(--ui-clay-face-gradient)!important;
  box-shadow:var(--ui-clay-shadow)!important;
  color:var(--ui-clay-ink);
}
html body.ap-clay.public-page :is(#fan-public-section,#fan-alert-section,#tentang,
  #daftar-perangkat,#map-section > div,#grafik > div:first-child,
  #beranda .hero-media-overlay,#beranda .hero-scada-card,.recap-card,
  .ap-trend-card,.edu-card,.ap36-sensor-chip) {
  background:var(--ui-clay-face-gradient)!important;
  border:1px solid transparent!important;
  border-radius:var(--ui-clay-radius)!important;
  box-shadow:var(--ui-clay-shadow)!important;
  color:var(--ui-clay-ink);
}
html body.ap-clay :is(.device-metric,.fan-monitor-stat,.ap-trend-latest,.setting-item,
  .ap36-statusbar,.ap36-media-tile,.ap36-edu-row,.notif-item,.ap-feed-caption,
  .ap-reset-metric,.ap-reset-instructions,.ap-reset-audit-item,
  .fan-state-visual,.fan-controls-wrapper,.fan-panel-grid>.rule-based-card) {
  border-radius:var(--ui-clay-control-radius)!important;
  background:var(--ui-clay-low)!important;
  border-color:var(--ui-clay-line)!important;
  box-shadow:none!important;
  color:var(--ui-clay-ink);
}
html body.ap-clay :is(.navbar,.topbar) {
  background:var(--ui-clay-face-gradient)!important;
  border-color:var(--ui-clay-line)!important;
  box-shadow:var(--ui-clay-small-shadow)!important;
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
  color:var(--ui-clay-ink);
}
html body.ap-clay :is(.sidebar,.sidebar.ap37-sidebar,.login-brand-panel) {
  background:var(--ui-clay-sidebar)!important;
  color:var(--ui-clay-on-sidebar);
  box-shadow:inset -2px 0 5px rgba(0,0,0,.13),5px 0 16px rgba(8,46,29,.13)!important;
}
html body.ap-clay .sidebar :is(.nav-item,.nav-item.active) {
  min-height:44px;
  border-radius:var(--ui-clay-control-radius);
  color:var(--ui-clay-on-sidebar)!important;
}
html body.ap-clay .sidebar :is(.nav-item.active,.nav-item[aria-current="page"]) {
  background:linear-gradient(145deg,#337d60,#24634d)!important;
  border:1px solid #719d83;
  box-shadow:inset 2px 2px 4px rgba(255,255,255,.2),inset -2px -2px 5px rgba(0,0,0,.15),0 4px 8px rgba(0,0,0,.12);
}
html body.ap-clay .sidebar :is(.sidebar-section-label,.ap37-nav-label) {color:#b9dbc8;}

/* Layered important controls take precedence over legacy ID-specific overrides. */
@layer aeropublic-clay-controls {
html body.ap-clay :is(.form-input,.form-select,.form-textarea,.setting-input,
  .search-input,.ap-reset-input,.modal-input,.ap36-field input:not([type="range"]),.ap36-field select,.ap36-field textarea) {
  min-height:44px!important;
  border-radius:var(--ui-clay-control-radius)!important;
  background:var(--ui-clay-low)!important;
  border:1px solid var(--ui-clay-line)!important;
  box-shadow:var(--ui-clay-well)!important;
  color:var(--ui-clay-ink)!important;
  font:inherit;
}
html body.ap-clay :is(input,textarea)::placeholder {color:var(--ui-clay-muted)!important;opacity:1;}
html body.ap-clay :is(.form-label,.ap36-field > span,.setting-label) {color:var(--ui-clay-ink);font-weight:700;}
html body.ap-clay :is(.btn,.ap-action,.ap36-btn,.btn-icon,.ap37-menu-btn,
  .ap37-refresh-button,.btn-add-device,.btn-autoregister,.btn-export,.ap36-tab,
  .modal-cancel-btn,.modal-save-btn,.hero-spec-link,.fan-btn,.pair-btn,
  .chart-period-tab,.filter-chip,.btn-filter,.ap-reset-btn,.admin-login-btn) {
  min-height:44px!important;
  border-radius:var(--ui-clay-control-radius)!important;
  font-family:inherit;
  font-weight:700;
  font-size:14px;
  line-height:1.4;
  cursor:pointer;
}
html body.ap-clay :is(.btn-icon,.ap37-menu-btn,.password-toggle) {min-width:44px!important;min-height:44px!important;padding:0!important;}
html body.ap-clay :is(.theme-toggle-btn,.password-toggle) svg {
  width:20px;height:20px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round;
}
html body.ap-clay .password-toggle {display:grid;place-items:center;border-radius:12px;}
html body.ap-clay .password-toggle .password-slash {display:none;}
html body.ap-clay .password-toggle[aria-pressed="true"] .password-slash {display:block;}
html body.ap-clay .login-form-card .input-icon {width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;}
html body.ap-clay .checkbox-wrapper {min-height:44px;gap:10px;}
html body.ap-clay input[type="checkbox"] {accent-color:var(--ui-clay-accent);}
html body.ap-clay :is(.btn-outline,.btn-secondary,.btn-icon,.ap36-btn-muted,
  .ap-action-outline,.ap37-menu-btn,.ap37-refresh-button,.modal-cancel-btn,.hero-spec-link,.btn-export) {
  background:var(--ui-clay-face-gradient)!important;
  color:var(--ui-clay-link)!important;
  border:1px solid var(--ui-clay-line)!important;
  box-shadow:var(--ui-clay-small-shadow)!important;
}
html body.ap-clay :is(.btn-primary,.ap-action-primary,.ap36-btn-primary,.btn-login,
  .btn-add-device,.modal-save-btn,.btn-save,.btn-filter) {
  background:linear-gradient(145deg,#087457,#075d44)!important;
  color:#fff!important;
  border:1px solid #075d44!important;
  box-shadow:var(--ui-clay-button-shadow)!important;
}
html body.ap-clay :is(.btn,.ap-action,.ap36-btn,.btn-icon,.btn-login,.btn-add-device,
  .modal-save-btn,.ap37-menu-btn,.fan-btn,.pair-btn,.filter-chip,.chart-period-tab,
  .btn-save,.btn-filter,.btn-export):active:not(:disabled):not([aria-disabled="true"]) {
  box-shadow:var(--ui-clay-well)!important;
  transform:none!important;
}
html body.ap-clay :is(.btn-primary,.ap-action-primary,.ap36-btn-primary,.btn-login,
  .btn-add-device,.modal-save-btn,.btn-save,.btn-filter):active:not(:disabled):not([aria-disabled="true"]) {
  box-shadow:var(--ui-clay-button-pressed)!important;
}
html body.ap-clay :is(.btn-outline,.btn-secondary,.btn-icon,.ap-action-outline,.ap36-btn-muted,.btn-export):hover:not(:disabled):not([aria-disabled="true"]) {
  background:var(--ui-clay-low)!important;border-color:var(--ui-clay-link)!important;
  transform:none!important;
}
html body.ap-clay :is(.btn-primary,.ap-action-primary,.ap36-btn-primary,.btn-login,.btn-save,.btn-filter,
  .btn-add-device,.modal-save-btn):hover:not(:disabled):not([aria-disabled="true"]) {
  background:#075d44!important;
  transform:none!important;
}
html body.ap-clay :is(button:disabled,[aria-disabled="true"]) {
  opacity:.6!important;cursor:not-allowed;filter:none!important;
}
html body.ap-clay :is(a,button,input,select,textarea,[tabindex]):focus-visible {
  outline:3px solid var(--ui-clay-ring)!important;
  outline-offset:3px!important;
}
html body.ap-clay .sidebar :is(a,button):focus-visible {outline-color:#bdffda!important;}
html body.ap-clay :is(.ap36-tab.active,.ap36-tab[aria-selected="true"],.filter-btn.active) {
  background:var(--ui-clay-low)!important;
  color:var(--ui-clay-link)!important;
  border-color:var(--ui-clay-line)!important;
  box-shadow:var(--ui-clay-well)!important;
}
html body.ap-clay .ap36-tab:not(.active):not([aria-selected="true"]) {color:var(--ui-clay-muted)!important;}
html body.ap-clay :is(.ap36-pills span,.ap36-step,.param-sensor-chip,.tech-badge) {
  background:var(--ui-clay-low)!important;color:var(--ui-clay-link)!important;
  border-color:var(--ui-clay-line)!important;box-shadow:var(--ui-clay-small-shadow);
}
}
html body.ap-clay :is(.table-container,.device-metrics,.ap36-tabs) {
  border-radius:var(--ui-clay-control-radius);
  background:var(--ui-clay-low);
}
html body.ap-clay :is(th,.table-header) {background:var(--ui-clay-low);color:var(--ui-clay-ink);}
html body.ap-clay :is(td,th) {border-color:var(--ui-clay-line);}
html body.ap-clay :is(.stat-value,.summary-value,.device-metric-value,.metric-value) {
  color:var(--ui-clay-ink);font-variant-numeric:tabular-nums;
}
html body.ap-clay :is(.stat-label,.summary-label,.ap-page-description,.breadcrumb,
  .device-location,.setting-description,.login-subtitle) {color:var(--ui-clay-muted);}
html body.ap-clay .ap-search-input {
  background:var(--ui-clay-low);border-color:var(--ui-clay-line);
  border-radius:var(--ui-clay-control-radius);box-shadow:var(--ui-clay-well);
}
html body.ap-clay .ap-search-input .form-input {
  background:transparent!important;border:0!important;box-shadow:none!important;
}
html body.ap-clay.public-page #beranda .hero-scada-title [data-load-line] {
  color:var(--ui-clay-ink)!important;-webkit-text-fill-color:currentColor;
  background:none!important;
}
html body.ap-clay.public-page #beranda .hero-scada-title .line:last-child [data-load-line] {
  color:var(--ui-clay-link)!important;
}
html body.ap-clay :is(.stat-card,.summary-card,.device-card,.parameter-card,.metric-card,
  .settings-card,.chart-card,.ap36-panel,.ap36-preview):hover {transform:none!important;}
html body.ap-clay :is(.fan-btn,.pair-btn,.chart-period-tab):hover {transform:none!important;}
html body.ap-clay :is(.badge,.nav-badge,.filter-chip,.tech-badge,.param-sensor-chip) {line-height:1.5;}
html body.ap-clay :is(.login-form-card,.error-card) {padding:clamp(24px,4vw,40px);}
html body.ap-clay .devices-grid {grid-template-columns:repeat(auto-fill,minmax(min(100%,390px),1fr))!important;}
html body.ap-clay .devices-grid > .empty-state {grid-column:1/-1;min-width:0;max-width:100%;}
html body.ap-clay :is(.ap-notification-panel,.table-container) .empty-state {
  background:transparent!important;border:0!important;box-shadow:none!important;
}
html body.ap-clay .error-card::before {height:0;}
html body.ap-clay .public-footer {background:var(--ui-clay-low)!important;color:var(--ui-clay-ink);}
html body.ap-clay .ap36-banner h2 {letter-spacing:-.03em;}
html body.ap-clay .ap36-banner::before,html body.ap-clay .ap36-banner::after {content:none;}

@media(max-width:767px) {
  html body.ap-clay :is(.form-input,.form-select,.form-textarea,.setting-input,
    .search-input,.ap-reset-input,.modal-input,.ap36-field input,.ap36-field select,.ap36-field textarea) {font-size:16px;}
  html body.ap-clay :is(.header-actions,.ap36-actions,.toolbar-actions) {gap:8px;flex-wrap:wrap;}
  html body.ap-clay :is(.modal-content,.ap36-modal-panel) {max-width:calc(100vw - 24px);}
}
@media(prefers-reduced-motion:reduce) {
  html body.ap-clay :is(.btn,.ap-action,.ap36-btn,.btn-icon,.ap36-tab) {transition:none!important;}
}
html[data-reduced-motion="true"] body.ap-clay :is(.btn,.ap-action,.ap36-btn,.btn-icon,.ap36-tab) {transition:none!important;}
html:focus-within {scroll-behavior:auto!important;}

@layer aeropublic-clay-polish {
  html body.ap-clay [hidden] {display:none!important;}
  html body.ap-clay :is(.reveal,.stagger-children):focus-within,
  html body.ap-clay .stagger-children:focus-within > * {opacity:1!important;transform:none!important;}

  html body.ap-clay.public-page > .navbar {
    width:min(calc(100% - 48px),1552px)!important;
    min-height:88px!important;
    margin-inline:auto!important;
  }
  html body.ap-clay.public-page #mainContent {
    width:min(calc(100% - 48px),1552px)!important;
    padding-inline:0!important;
  }
  html body.ap-clay.public-page #mainContent > section {scroll-margin-top:120px;}
  html body.ap-clay.public-page #beranda.hero-scada {
    min-height:calc(100svh - 148px)!important;
    grid-template-columns:minmax(0,1.2fr) minmax(320px,1fr)!important;
    gap:32px!important;
    padding:32px!important;
    border-radius:var(--ui-clay-radius)!important;
  }
  html body.ap-clay.public-page #beranda .hero-media-overlay {
    padding:32px!important;
    min-width:0!important;
  }
  html body.ap-clay.public-page #beranda .hero-scada-title {
    font-size:clamp(34px,3.6vw,56px)!important;
    line-height:1.12!important;
    letter-spacing:-.035em!important;
    margin:0 0 20px!important;
  }
  html body.ap-clay.public-page #beranda .hero-scada-desc {
    font-size:16px!important;
    line-height:1.7!important;
    max-width:48ch!important;
    color:var(--ui-clay-ink)!important;
    margin-bottom:24px!important;
  }
  html body.ap-clay.public-page #beranda .hero-overview {padding:0!important;min-width:0;}
  html body.ap-clay.public-page #beranda .hero-scada-card {max-width:none!important;padding:24px!important;}
  html body.ap-clay.public-page #beranda .ap36-sensor-rail {margin-top:24px!important;}
  html body.ap-clay.public-page :is(.ap36-sensor-chip small,.home-overview-copy,.ap-edu-point small,.ap-edu-number span) {
    color:var(--ui-clay-muted)!important;
    font-size:13px!important;
  }
  html body.ap-clay.public-page :is(.ap-edu-number,.ap-edu-point) {
    background:var(--ui-clay-face)!important;
    color:var(--ui-clay-ink)!important;
  }
  html body.ap-clay.public-page :is(.ap-edu-category,.ap-kicker),
  html body.ap-clay.public-page #beranda .tracking-wide {
    text-transform:none!important;
    letter-spacing:.01em!important;
    font-size:13px!important;
  }
  html body.ap-clay.public-page :is(.nav-brand,.ap34-education-skip,.footer-link,
    .fan-alert-link,#publicAqiDeviceSelect,#publicChartLocation,#chartPauseBtn,
    .scada-card-header > a,.about-intro-media a) {
    min-height:44px!important;
    align-items:center;
  }
  html body.ap-clay.public-page :is(#themeToggle,#mobileNavToggle) {
    width:44px!important;height:44px!important;min-width:44px!important;
    flex-shrink:0;
  }
  html body.ap-clay.public-page :is(.footer-link,.fan-alert-link) {display:inline-flex!important;}
  html body.ap-clay.public-page .ap34-education-skip:focus-visible {opacity:1!important;visibility:visible!important;}
  html body.ap-clay.public-page .public-search-wrapper {display:grid;gap:4px;}
  html body.ap-clay.public-page .public-search-wrapper > i {display:none;}
  html body.ap-clay.public-page .public-search-label,
  html body.ap-clay.public-page .public-control-label {
    font-size:13px;line-height:1.4;font-weight:600;color:var(--ui-clay-muted);
  }
  html body.ap-clay.public-page #publicSearchInput {min-height:44px!important;padding-left:14px!important;}
  html body.ap-clay.public-page .telemetry-toolbar {gap:16px!important;flex-wrap:wrap!important;}
  html body.ap-clay.public-page .telemetry-toolbar > div:last-child {flex-wrap:wrap!important;min-width:0;max-width:100%;}
  html body.ap-clay.public-page #edukasi:focus-within {content-visibility:visible!important;}
  html body.ap-clay.public-page #edukasi:focus-within > div {opacity:1!important;transform:none!important;}
  html body.ap-clay.public-page #edukasi .ap-edu-viewport {mask-image:none!important;-webkit-mask-image:none!important;}
  html body.ap-clay.public-page :is(.fan-eyebrow,.fan-alert-link) {color:var(--ui-clay-link)!important;}
  html body.ap-clay.public-page .footer-bottom-bar {color:var(--ui-clay-ink)!important;font-size:13px!important;}
  html body.ap-clay.public-page .dashboard-bottom > .bg-brand-50 p {
    background:var(--ui-clay-face)!important;color:var(--ui-clay-ink)!important;
  }
  html body.ap-clay.public-page :is(.ap-edu-footer-eyebrow,.ap-db-source,.fan-stat-label,.fan-stat-help) {
    color:var(--ui-clay-muted)!important;font-size:13px!important;
  }
  html body.ap-clay.public-page .ap-edu-number {background:var(--ui-clay-face)!important;}
  html body.ap-clay.public-page .ap-edu-number span {color:var(--ui-clay-ink)!important;}
  html body.ap-clay.public-page :is(.dashboard-bottom a,.about-intro-media a[href$=".mp4"]) {
    display:inline-flex!important;align-items:center;min-height:44px!important;
  }
  html body.ap-clay.public-page .leaflet-control-zoom a {width:44px!important;height:44px!important;line-height:44px!important;}
  html body.ap-clay.public-page .about-intro-media a[href$=".jpg"] > span {
    white-space:normal!important;text-overflow:clip!important;font-size:12px!important;line-height:1.4!important;
  }
  html body.ap-clay.public-page .public-device-filters {
    display:grid!important;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);
    column-gap:16px;row-gap:6px;max-width:420px;width:100%;text-align:left;
  }
  html body.ap-clay.public-page .public-device-filters label:first-of-type {grid-column:1;grid-row:1;}
  html body.ap-clay.public-page .public-device-filters label:last-of-type {grid-column:2;grid-row:1;}
  html body.ap-clay.public-page .public-device-filters input {grid-column:1;grid-row:2;}
  html body.ap-clay.public-page .public-device-filters select {grid-column:2;grid-row:2;}
  html body.ap-clay.public-page .public-device-filters :is(input,select) {width:100%!important;min-width:0!important;}

  @media(max-width:1439px) {
    html body.ap-clay.public-page .public-search-wrapper {display:none!important;}
  }
  @media(min-width:1280px) {
    html body.ap-clay.public-page #publicNav {
      display:flex!important;flex-direction:row!important;position:relative!important;
      inset:auto!important;width:auto!important;padding:4px!important;
      border-radius:9999px!important;background:var(--ui-clay-low)!important;
      box-shadow:var(--ui-clay-well)!important;
    }
  }
  @media(max-width:1279px) {
    html body.ap-clay.public-page > .navbar {min-height:72px!important;}
    html body.ap-clay.public-page #beranda.hero-scada {min-height:calc(100svh - 132px)!important;}
    html body.ap-clay.public-page #mobileNavToggle {display:inline-grid!important;place-items:center;}
    html body.ap-clay.public-page #publicNav.hidden {display:none!important;}
    html body.ap-clay.public-page #publicNav:not(.hidden) {
      display:flex!important;flex-direction:column!important;position:absolute!important;
      top:calc(100% + 8px)!important;left:0!important;right:0!important;
      width:100%!important;padding:16px!important;gap:8px!important;
      background:var(--ui-clay-face-gradient)!important;border-radius:var(--ui-clay-radius)!important;
      box-shadow:var(--ui-clay-shadow)!important;z-index:70;
    }
    html body.ap-clay.public-page #publicNav .nav-link {display:flex;align-items:center;width:100%;min-height:44px;}
    html body.ap-clay.public-page #publicNav .nav-pill-indicator {display:none;}
  }
  @media(max-width:1023px) {
    html body.ap-clay.public-page #beranda.hero-scada {grid-template-columns:minmax(0,1fr)!important;min-height:calc(100svh - 132px)!important;}
    html body.ap-clay.public-page #beranda .hero-overview {display:none!important;}
    html body.ap-clay.public-page #beranda .hero-media-overlay {max-width:640px;width:100%;}
    html body.ap-clay.public-page .public-search-wrapper {display:none!important;}
  }
  @media(max-width:639px) {
    html body.ap-clay.public-page > .navbar,
    html body.ap-clay.public-page #mainContent {width:calc(100% - 32px)!important;}
    html body.ap-clay.public-page #beranda.hero-scada {padding:16px!important;}
    html body.ap-clay.public-page #beranda .hero-media-overlay {padding:24px!important;}
    html body.ap-clay.public-page #beranda .hero-cta-group {display:grid!important;grid-template-columns:minmax(0,1fr);gap:12px!important;}
    html body.ap-clay.public-page #beranda .hero-cta-group a {justify-content:center;width:100%;}
    html body.ap-clay.public-page #beranda .ap36-sensor-rail {display:grid!important;grid-template-columns:minmax(0,1fr);gap:8px!important;}
    html body.ap-clay.public-page #beranda .ap36-sensor-chip {width:100%;padding:10px 12px!important;border-radius:16px!important;box-shadow:var(--ui-clay-small-shadow)!important;}
    html body.ap-clay.public-page #beranda .ap36-sensor-chip > div {display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:2px 8px;flex:1;min-width:0;}
    html body.ap-clay.public-page .public-device-filters {column-gap:12px;}
    html body.ap-clay.public-page .admin-login-btn svg {display:none!important;}
  }
  @media(max-width:375px) {
    html body.ap-clay.public-page .nav-brand {gap:6px!important;}
    html body.ap-clay.public-page .nav-brand .logo-text {font-size:14px!important;}
    html body.ap-clay.public-page .brand-logo-frame {width:28px!important;height:28px!important;flex-basis:28px!important;padding:2px!important;}
    html body.ap-clay.public-page .brand-logo-frame img {width:24px!important;height:20px!important;}
    html body.ap-clay.public-page #beranda .hero-scada-title {font-size:28px!important;}
    html body.ap-clay.public-page .admin-login-btn {width:44px!important;min-width:44px!important;padding-inline:0!important;justify-content:center;}
    html body.ap-clay.public-page .admin-login-btn span {display:none!important;}
    html body.ap-clay.public-page .admin-login-btn svg {display:block!important;}
  }
}


/* Admin operation surfaces: stable rows, readable forms, restrained depth. */
html body.ap-clay.ap37-unified .sidebar-nav .nav-item {gap:10px!important;min-height:46px;padding:10px 12px!important;}
html body.ap-clay.ap37-unified .sidebar .nav-badge {flex:0 0 auto;min-width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;padding:0 6px;line-height:1;font-size:12px;box-shadow:none!important;}
html body.ap-clay.ap37-unified .sidebar .nav-item.active {box-shadow:inset 1px 1px 2px rgba(255,255,255,.16),0 3px 8px rgba(0,0,0,.12)!important;}
html body.ap-clay .settings-card-header {align-items:flex-start;gap:14px;padding-bottom:20px;}
html body.ap-clay .settings-card-title-group p {line-height:1.6;}
html body.ap-clay .settings-card-body {display:flex;flex-direction:column;gap:20px;min-width:0;}
html body.ap-clay .settings-card-body .setting-item {padding:12px;}
html body.ap-clay .btn-save {min-height:44px;padding:12px 20px;border-radius:16px;background:var(--ui-clay-accent);color:white;font-weight:700;}
html body.ap-clay .firmware-reference {padding:16px;border:1px solid var(--ui-clay-line);border-radius:16px;background:var(--ui-clay-low);}
html body.ap-clay .firmware-reference summary {cursor:pointer;min-height:32px;font-weight:700;}
html body.ap-clay .firmware-reference dl {margin-top:16px;display:grid;gap:6px 16px;grid-template-columns:1fr 2fr;font-size:14px;line-height:1.6;}
html body.ap-clay .firmware-reference dt {font-weight:700;}
html body.ap-clay .firmware-reference dd {margin:0 0 12px;overflow-wrap:anywhere;color:var(--ui-clay-muted);}
@media(max-width:640px) {html body.ap-clay .firmware-reference dl {grid-template-columns:1fr;}html body.ap-clay .card-submit-bar .btn-save {width:100%;}}

html body.ap-clay .settings-maintenance {margin-top:24px;}
html body.ap-clay .settings-maintenance>summary {cursor:pointer;padding:18px 20px;border:1px solid var(--ui-clay-line);border-radius:16px;font-weight:700;background:var(--ui-clay-low);}
html body.ap-clay .settings-maintenance .ap-reset {margin-top:16px;}

html body.ap-clay #mainDashboard .ap-welcome-copy {max-width:72ch;}
html body.ap-clay #mainDashboard .ap-toolbar-surface {display:flex;align-items:center;flex-wrap:wrap;gap:12px 16px;padding:20px;margin-bottom:24px;}
html body.ap-clay #mainDashboard .ap-toolbar-surface .form-select {flex:1 1 240px;min-width:0;max-width:100%;}
html body.ap-clay #mainDashboard .toolbar-actions {display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;}
html body.ap-clay #mainDashboard .summary-grid {gap:20px;}
html body.ap-clay #mainDashboard .summary-card {padding:20px!important;min-width:0;}
html body.ap-clay #mainDashboard .summary-label {line-height:1.5;font-size:14px;}
@media(max-width:640px) {html body.ap-clay #mainDashboard .toolbar-actions {width:100%;margin-left:0;}html body.ap-clay #mainDashboard .toolbar-actions .btn {flex:1 1 160px;justify-content:center;}}

html body.ap-clay #mainDashboard .summary-info .mt-1 span {color:var(--ui-clay-muted)!important;font-size:12px!important;line-height:1.5;}

/* History and map use full-width panels so filters never crowd the plot. */
html body.ap-clay #mainDashboard .content-grid {display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:24px;}
html body.ap-clay #mainDashboard .content-grid>.card {min-width:0;overflow:hidden;height:auto!important;max-height:none!important;}
html body.ap-clay #mainDashboard .content-grid>.card:first-child>.card-header {display:block;}
html body.ap-clay #mainDashboard .chart-controls {display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:12px;width:100%;margin-top:16px;}
html body.ap-clay #mainDashboard .chart-controls :is(select,button) {max-width:100%;min-width:0;min-height:44px;}
html body.ap-clay #mainDashboard .chart-controls select {width:100%!important;}
html body.ap-clay #chartPairBar,html body.ap-clay #chartDeviceInfo {grid-column:1/-1;}
html body.ap-clay #chartPairBar {display:flex;flex-wrap:wrap;gap:8px;}
html body.ap-clay #chartDeviceInfo {line-height:1.6;overflow-wrap:anywhere;}
html body.ap-clay #mainDashboard .h-360-rel {height:360px!important;min-height:360px;flex:none;position:relative;}
html body.ap-clay #map-section {scroll-margin-top:100px;}
html body.ap-clay #map-section .card-header {flex-wrap:wrap;gap:12px;}
html body.ap-clay .admin-map-status {padding:12px 20px;margin:0;font-size:14px;line-height:1.6;color:var(--ui-clay-muted);}
html body.ap-clay .admin-map-popup {line-height:1.6;color:#203c30;font-size:14px;}
html body.ap-clay .admin-map-popup .btn {min-height:44px;white-space:normal;}
html body.ap-clay #map .leaflet-control-zoom a {width:44px;height:44px;line-height:44px;}

/* Text on inset surfaces must remain readable in both themes. */
html body.ap-clay.dashboard-layout .input-addon-group .input-suffix {background:var(--ui-clay-low)!important;color:var(--ui-clay-ink)!important;font-size:13px!important;}
html body.ap-clay :is(.about-version,.ap-edu-footer-icon) {background:var(--ui-clay-low)!important;color:var(--ui-clay-ink)!important;}
html body.ap-clay .leaflet-control-attribution a {text-decoration:underline!important;text-underline-offset:2px;}
html body.ap-clay .ap-edu-footer-icon .ap-edu-icon-text {color:var(--ui-clay-link)!important;font-size:12px!important;}
html body.ap-clay.public-page #footerUpdate {color:var(--ui-clay-link)!important;}
html body.ap-clay .ap37-device-hint {color:var(--ui-clay-ink)!important;}
html body.ap-clay .pair-btn:is(.active,[aria-pressed="true"]) {background:#087457!important;color:#fff!important;}
html body.ap-clay .ap36-preview-edu {background:var(--ui-clay-face)!important;}
html body.ap-clay .ap36-preview-edu :is(.ap36-overline,#cmsPreviewEduDesc) {color:var(--ui-clay-muted)!important;}
html body.ap-clay #cmsPreviewEduTitle {color:var(--ui-clay-ink)!important;}

/* The admin drawer and content column share one 992px breakpoint. */
html body.ap-clay.ap37-unified #sidebar {
  height:100vh;height:100dvh;min-height:0!important;max-height:100dvh;
  overflow:hidden;box-sizing:border-box;
}
html body.ap-clay.ap37-unified #sidebar :is(.sidebar-header,.sidebar-footer) {flex-shrink:0;}
html body.ap-clay.ap37-unified #sidebar .sidebar-nav {
  flex:1;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;
  scrollbar-width:thin!important;scrollbar-color:#719d83 transparent;
}
html body.ap-clay.ap37-unified #sidebar .sidebar-nav::-webkit-scrollbar {display:block!important;width:5px;}
html body.ap-clay.ap37-unified #sidebar .sidebar-nav::-webkit-scrollbar-thumb {background:#719d83;border-radius:4px;}
html body.ap-clay.ap37-unified #sidebar .nav-item {height:auto!important;min-height:46px!important;white-space:normal!important;}
html body.ap-clay.ap37-unified #sidebar .nav-item>span:not(.nav-badge) {flex:1;min-width:0;white-space:normal!important;overflow-wrap:anywhere;}
html body.ap-clay.ap37-unified #sidebar .nav-item .ap37-icon {flex-shrink:0;}
html body.ap-clay.ap37-unified #sidebar .nav-badge {flex:0 0 auto;}
@media(min-width:992px) {
  html body.ap-clay.ap37-unified #sidebar {width:270px;transform:none!important;visibility:visible;}
  html body.ap-clay.ap37-unified .main-content {margin-left:270px!important;width:calc(100% - 270px);max-width:calc(100% - 270px);}
  html body.ap-clay.ap37-unified .topbar #menuToggle,
  html body.ap-clay.ap37-unified #sidebarOverlay {display:none!important;}
}
@media(max-width:991px) {
  html body.ap-clay.ap37-unified.ap-sidebar-open {overflow:hidden;}
  html body.ap-clay.ap37-unified #sidebar {width:min(280px,calc(100vw - 56px));transform:translateX(-100%)!important;visibility:hidden;}
  html body.ap-clay.ap37-unified #sidebar.open {transform:translateX(0)!important;visibility:visible;}
  html body.ap-clay.ap37-unified .main-content {margin-left:0!important;width:100%;max-width:100%;}
  html body.ap-clay.ap37-unified .topbar #menuToggle {display:grid!important;flex:0 0 44px;width:44px;height:44px;}
  html body.ap-clay.ap37-unified #sidebarOverlay.active {display:block;}
}

/* Type system: Inter for UI, Fira Code (tabular) for telemetry values. */
body.ap-clay {
  --ui-clay-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
body.ap-clay :is(#pm25Value, #co2Value, #temperatureValue, #humidityValue, [id^="val-"],
  #chartLatestCo2, #chartLatestPm25, #chartLatestTemp, #chartLatestHum, #publicFanLastUpdate,
  .metric-value, .stat-value, .recap-value, .fan-monitor-stat strong, .ap-trend-latest strong,
  td[style*="text-align:right"], td[style*="text-align: right"], .data-table td.num, .device-metric-value) {
  font-family: var(--ui-clay-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

/* Hover/contrast: legacy --primary-dark (#066b4c/#04382a) is a light-theme value; on dark faces it dropped to 1.1-1.8:1. */
html[data-theme="dark"] body.ap-clay { --primary-dark: #34d399; --primary-light: #6ee7b7; }
html body.ap-clay :is(.btn-primary, .clay-btn-primary, .btn-save):is(:hover, :focus-visible) { color: var(--on-primary, #fff) !important; }

/* Search field: wrapper owns the well. Must live in the same @layer as the control rule:
   !important in layers inverts order, so unlayered !important cannot win. */
@layer aeropublic-clay-controls{
  html body.ap-clay .ap-search-input input.form-input{border:0!important;box-shadow:none!important;background:transparent!important;}
}
html body.ap-clay .ap-search-input:focus-within{outline:2px solid var(--ui-clay-accent);outline-offset:2px;}

/* Notification row actions: clay chips, 44px targets, state colour only on the icon. */
html body.ap-clay .notif-actions-btn{display:flex;gap:8px;align-items:center;}
html body.ap-clay .notif-action-btn{
  width:44px;height:44px;min-height:44px;padding:0;display:inline-flex;align-items:center;justify-content:center;
  border-radius:var(--ui-clay-control-radius);border:1px solid var(--ui-clay-line);
  background:var(--ui-clay-low);box-shadow:var(--ui-clay-well);color:var(--ui-clay-ink);cursor:pointer;
  transition:transform .15s ease,box-shadow .15s ease;
}
html body.ap-clay .notif-action-btn.mark-read{color:var(--ui-clay-accent);}
html body.ap-clay .notif-action-btn.delete{color:var(--ap-bad,#b91c1c);}
html body.ap-clay .notif-action-btn:hover{transform:translateY(-1px);}
html body.ap-clay .notif-action-btn:active{transform:scale(.96);}
html body.ap-clay .notif-action-btn:focus-visible{outline:2px solid var(--ui-clay-accent);outline-offset:2px;}
:root{--ap-ok:#15803d;--ap-warn:#b45309;--ap-bad:#b91c1c;}
html[data-theme="dark"]{--ap-ok:#4ade80;--ap-warn:#fbbf24;--ap-bad:#fca5a5;}

/* ==== Admin shell normalization (single authority; all admin pages load this last) ====
   Why here: legacy sheets leak per-page differences (telemetry-review.css adds nav margin on some pages,
   content-manager loads fewer sheets). Values below are the one scale every admin page uses. */
html body.ap-clay.ap34-admin{
  --ap-admin-title:1.75rem;      /* page title (h2) */
  --ap-admin-section:1.0625rem;  /* card / section title (h3) */
  --ap-admin-radius:24px;        /* card radius */
  --ap-admin-control-h:44px;     /* min interactive height */
}
/* Sidebar: identical rhythm on every page */
html body.ap-clay.ap37-unified .sidebar-nav .nav-item{margin:3px 4px!important;font-size:.875rem;}
html body.ap-clay.ap37-unified .sidebar .nav-label{font-size:.6875rem;}
/* Topbar identity chip: pill + visible avatar (content-manager lacked the shared sheets) */
html body.ap-clay.ap34-admin .user-menu{border-radius:9999px;background:var(--ui-clay-low);background-image:none;box-shadow:var(--ui-clay-well);}
html body.ap-clay.ap34-admin .user-menu .user-avatar{background:var(--ui-clay-accent);color:#fff;border-radius:9999px;}
/* Headings: one scale */
html body.ap-clay.ap34-admin .dashboard-content h2{font-size:var(--ap-admin-title);line-height:1.2;}
html body.ap-clay.ap34-admin .dashboard-content :is(h3,.card-header h3,.settings-card-title-group h3){font-size:var(--ap-admin-section)!important;line-height:1.3;}
/* Cards and controls */
html body.ap-clay.ap34-admin .dashboard-content .card{border-radius:var(--ap-admin-radius)!important;}
html body.ap-clay.ap34-admin .dashboard-content :is(.btn,.btn-edit,.btn-delete,.ap-reset-btn),
html body.ap-clay.ap34-admin .dashboard-content .device-actions button{min-height:var(--ap-admin-control-h)!important;border-radius:16px!important;}

/* Dark theme: Content Studio message/hint/badge surfaces were fixed light. */
html[data-theme="dark"] body.ap-clay .ap36-message.success{background:rgba(16,185,129,.14)!important;color:#6ee7b7!important;border-color:rgba(52,211,153,.35)!important;}
html[data-theme="dark"] body.ap-clay .ap36-message.error{background:rgba(248,113,113,.14)!important;color:#fca5a5!important;border-color:rgba(248,113,113,.35)!important;}
html[data-theme="dark"] body.ap-clay :is(.ap36-hint,.ap36-draft-badge){background:var(--ui-clay-low)!important;color:var(--ui-clay-muted)!important;border-color:var(--ui-clay-line)!important;}
html[data-theme="dark"] body.ap-clay .ap36-draft-badge{color:#6ee7b7!important;}

/* Content Studio tabs: one line each; scroll sideways when the column is too narrow instead of wrapping. */
html body.ap-clay .ap36-tabs{grid-template-columns:repeat(5,minmax(max-content,1fr));overflow-x:auto;scrollbar-width:none;}
html body.ap-clay .ap36-tab{white-space:nowrap;padding-inline:14px;}

/* Settings: header row never wraps the title under the icon; one border per input+unit group; status line gets a well. */
html body.ap-clay .settings-card-header{flex-wrap:nowrap;align-items:center;}
html body.ap-clay .settings-card-title-group{min-width:0;flex:1 1 auto;}
html body.ap-clay .settings-card-icon{flex:0 0 auto;}
@layer aeropublic-clay-controls{
  html body.ap-clay .input-addon-group .setting-input.setting-input.setting-input.setting-input{border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;}
}
html body.ap-clay .input-addon-group{overflow:hidden;background:var(--ui-clay-low);border-color:var(--ui-clay-line);box-shadow:var(--ui-clay-well);}
html body.ap-clay .input-addon-group:focus-within{outline:2px solid var(--ui-clay-accent);outline-offset:2px;}
html body.ap-clay #settingsStatus{margin:0 0 16px;padding:12px 16px;border:1px solid var(--ui-clay-line);border-radius:16px;background:var(--ui-clay-low);box-shadow:var(--ui-clay-well);}
