:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #193149; background: #edf3f5; }
* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 10% 0%, #fff 0, transparent 30%), #edf3f5; }
.container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 46px 0 64px; }
.card { background: rgba(255,255,255,.96); border: 1px solid #dbe5e9; border-radius: 22px; box-shadow: 0 12px 32px rgba(32,62,80,.07); }
.login-card { width: min(430px, 100%); margin: 8vh auto 0; padding: 34px; }
.eyebrow { margin: 0 0 7px; color: #158183; font-size: .76rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.1rem, 5vw, 3.3rem); line-height: 1; letter-spacing: -.045em; }
h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.025em; }
.page-subtitle { margin: 10px 0 0; color: #657b8d; }
.muted, .empty p { color: #60788d; line-height: 1.5; }
label { display: block; margin: 20px 0 7px; font-size: .9rem; font-weight: 700; }
input { width: 100%; padding: 12px 14px; border: 1px solid #b9ccd5; border-radius: 10px; font: inherit; }
input:focus { outline: 3px solid rgba(22,128,131,.18); border-color: #168083; }
button { padding: 12px 18px; border: 0; border-radius: 12px; background: #168083; color: #fff; font: inherit; font-weight: 750; cursor: pointer; transition: transform .15s, background .15s, opacity .15s; }
button:hover { background: #106a6d; transform: translateY(-1px); }
button:disabled { cursor: wait; opacity: .7; transform: none; }
.secondary { background: #e2ecef; color: #193149; }
.alert { margin-top: 20px; padding: 12px 14px; border-radius: 10px; background: #fff0ef; color: #a32c25; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.topbar h1 { font-size: clamp(1.25rem, 2.2vw, 1.7rem); line-height: 1.2; letter-spacing: -.025em; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.logout { margin: 0; padding: 10px 14px; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; font-size: .8rem; font-weight: 750; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.online { color: #14734f; background: #e3f5eb; }
.status.offline { color: #8a6320; background: #fff2d5; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.gauge-card { padding: 22px 28px 12px; overflow: hidden; }
.metric-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.gauge { position: relative; width: min(100%,500px); height: 370px; margin: -34px auto -42px; }
.measure-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 18px 0 28px; padding: 5px 6px 5px 18px; }
.last-updated { margin: 0; color: #435d70; font-weight: 750; }
.measure-feedback { margin: 4px 0 0; color: #718493; font-size: .86rem; }
.measure-button { display: flex; align-items: center; gap: 9px; min-width: 168px; justify-content: center; background: #193e59; }
.measure-button:hover { background: #102f46; }
.measure-symbol { font-size: 1.35rem; }
.measure-button.loading .measure-symbol { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chart-card { padding: 25px 28px 18px; }
.chart-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.range-picker { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; padding: 4px; border-radius: 12px; background: #edf3f5; }
.range-picker button { padding: 7px 10px; border-radius: 9px; background: transparent; color: #637989; font-size: .78rem; }
.range-picker button:hover { transform: none; background: #e2eaed; }
.range-picker button.active { background: #fff; color: #193e59; box-shadow: 0 2px 7px rgba(25,49,73,.1); }
.chart-legend { display: flex; gap: 22px; margin: 20px 0 2px; color: #637989; font-size: .78rem; font-weight: 700; }
.chart-legend span::before { content: ""; display: inline-block; width: 18px; height: 3px; margin: 0 7px 3px 0; border-radius: 4px; }
.temp-key::before { background: #f26b4d; }.humidity-key::before { background: #2687c8; }
.chart-wrap { position: relative; height: clamp(280px, 38vw, 390px); width: 100%; }
#history-chart { display: block; width: 100% !important; height: 100% !important; }
#history-chart.calculating { opacity: .3; }
#history-chart[hidden] { display: none; }
.chart-loading { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 10px; color: #637989; font-size: .9rem; font-weight: 700; }
.chart-loading[hidden] { display: none; }
.loading-spinner { width: 22px; height: 22px; border: 3px solid #d4e1e6; border-top-color: #2687c8; border-radius: 50%; animation: spin .75s linear infinite; }
.chart-empty { display: grid; place-items: center; height: 100%; color: #718493; text-align: center; }
.chart-empty[hidden] { display: none; }
.controls { margin-top: 28px; padding: 25px 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.command-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; margin-top: 20px; }
.command-grid form { min-width: 0; }.command { width: 100%; min-height: 46px; padding: 9px; background: #377388; }
.command-help { margin: 13px 0 0; font-size: .86rem; }
code { color: #116e71; }
@media (max-width: 720px) {
  .container { width: min(100% - 22px,1160px); padding: 25px 0 40px; }
  .topbar { align-items: flex-start; }.header-actions { flex-direction: column; align-items: flex-end; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 14px; }.gauge-card { padding: 18px 20px 10px; }
  .chart-card, .controls { padding: 21px 17px 16px; }.chart-header { flex-direction: column; }.range-picker { width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }.range-picker button { white-space: nowrap; }
  .command-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 460px) {
  .topbar h1 { font-size: 1.2rem; }.page-subtitle { font-size: .88rem; }.logout { padding: 8px 10px; font-size: .8rem; }
  .status { font-size: .72rem; padding: 7px 9px; }.measure-panel { align-items: stretch; flex-direction: column; padding: 4px 0; }.measure-button { width: 100%; }
  .gauge { width: min(100%,380px); height: 300px; margin: -24px auto -34px; }
}
