:root {
  color-scheme: light;
  font-family:
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #f5f8f7;
  color: #1d2528;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, #f1f7f5 0, #f8faf7 340px),
    #f8faf7;
}

button,
input,
select { font: inherit; }
button,
select { color: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.page {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 16px 0 38px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 12px;
}

.eyebrow,
.section-label {
  display: block;
  margin: 0 0 5px;
  color: #65736f;
  font-size: 12px;
  font-weight: 850;
}

h1,
h2,
h3 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(27px, 3vw, 40px); line-height: 1.05; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  max-width: 760px;
}

.updated {
  margin: 0;
  color: #65736f;
  font-size: 13px;
  font-weight: 750;
}

.selector-panel,
.connection-card,
.chart-card,
.detail-charts,
.participation-panel,
.device-panel {
  border: 1px solid rgba(55, 78, 73, 0.10);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 14px 34px rgba(44, 67, 61, 0.08);
}

.selector-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 10px;
}
.selector-panel[hidden] { display: none; }
.selector-panel label,
.selector-panel span {
  color: #65736f;
  font-size: 12px;
  font-weight: 800;
}
.selector-panel select {
  max-width: 180px;
  height: 30px;
  border: 1px solid #cbd8d4;
  border-radius: 11px;
  background: #fff;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 850;
}

.connection-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 11px;
  box-shadow: none;
}
.connection-card strong,
.connection-card span {
  font-size: 13px;
  font-weight: 850;
}
.connection-card span { color: #65736f; }
.connection-ok strong { color: #14784e; }
.connection-delayed strong { color: #9d5a00; }
.connection-offline strong,
.connection-empty strong,
.connection-error strong { color: #b33138; }

.chart-section,
.detail-charts,
.participation-panel,
.device-panel { margin-top: 14px; }
.chart-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 7px;
  min-width: 0;
}
.chart-section-head > div:first-child {
  min-width: 0;
  flex: 1 1 220px;
}
.range-controls {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}
.range-controls button,
.quick-actions button {
  min-height: 36px;
  border: 1px solid #c9d7d2;
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 850;
}
.range-controls button.is-active {
  border-color: #196c4d;
  background: #196c4d;
  color: #fff;
}

.primary-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 12px;
}
.chart-card { min-width: 0; max-width: 100%; }
.chart-card {
  padding: 13px 14px 12px;
}
.chart-card header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 6px;
}
.chart-card h3 {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 24px;
  line-height: 1.05;
}
.chart-card h3 small,
.chart-card > small,
.chart-card header p {
  color: #65736f;
  font-size: 12px;
  font-weight: 800;
}
.chart-card header p { margin: 4px 0 0; text-align: right; }
.chart-card > small { display: block; margin-top: 4px; line-height: 1.35; opacity: .72; }
.chart-wrap {
  position: relative;
  height: 210px;
}
.chart-wrap-large { height: clamp(220px, 23vw, 245px); }
.chart-wrap-medium { height: clamp(190px, 20vw, 215px); }
.chart-wrap-small { height: clamp(180px, 18vw, 200px); }
.chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 16px;
  background: #f3f7f5;
  color: #65736f;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}
.chart-empty[hidden] { display: none; }

.detail-charts,
.participation-panel,
.device-panel {
  padding: 0;
}
.detail-charts {
  box-shadow: 0 8px 20px rgba(44, 67, 61, 0.045);
  background: rgba(255, 255, 255, 0.92);
}
.detail-charts summary,
.participation-panel summary,
.device-panel summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 950;
  list-style: none;
}
.detail-charts summary::-webkit-details-marker,
.participation-panel summary::-webkit-details-marker,
.device-panel summary::-webkit-details-marker { display: none; }
.detail-charts summary::after,
.participation-panel summary::after,
.device-panel summary::after {
  content: '⌄';
  flex: 0 0 auto;
  color: #65736f;
  font-size: 17px;
  line-height: 1;
  transition: transform .15s ease;
}
.detail-charts[open] summary::after,
.participation-panel[open] summary::after,
.device-panel[open] summary::after { transform: rotate(180deg); }
.detail-charts summary small {
  min-width: 0;
  color: #65736f;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 16px;
}
.chart-card-wide { grid-column: 1 / -1; }
.participation-panel summary small {
  color: #65736f;
  font-size: 13px;
  font-weight: 800;
}
.participation-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 16px;
}
.feedback-card,
.summary-card,
.action-card,
.recent-card {
  border: 1px solid #e1e8e5;
  border-radius: 18px;
  background: #fbfcfb;
  padding: 15px;
}
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quick-actions button:disabled,
.action-card input:disabled {
  cursor: not-allowed;
  opacity: .58;
}
.form-message {
  margin: 10px 0 0;
  color: #65736f;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0;
}
.summary-grid div,
.recent-list li,
.device-panel dl div {
  border-radius: 14px;
  background: #f2f6f4;
  padding: 10px;
}
.summary-grid dt {
  margin-bottom: 5px;
  color: #65736f;
  font-size: 12px;
  font-weight: 850;
}
.summary-grid dd {
  margin: 0;
  font-size: 22px;
  font-weight: 950;
}
.memo-label {
  display: block;
  margin: 12px 0 6px;
  color: #65736f;
  font-size: 12px;
  font-weight: 850;
}
.action-card input {
  width: 100%;
  height: 39px;
  border: 1px solid #cbd8d4;
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
}
.recent-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.recent-list strong {
  display: block;
  font-size: 13px;
}
.recent-list p {
  margin: 5px 0 0;
  color: #5f6c68;
  font-size: 13px;
  line-height: 1.4;
}
.device-panel dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0 16px 16px;
}
.device-panel dt {
  margin-bottom: 4px;
  color: #65736f;
  font-size: 12px;
  font-weight: 850;
}
.device-panel dd {
  margin: 0;
  font-size: 13px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 1180px) {
    grid-template-columns: 1.2fr repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar { display: block; }
  .topbar-meta { justify-content: flex-start; margin-top: 12px; }
  .primary-charts,
  .detail-chart-grid,
  .participation-content { grid-template-columns: 1fr; }
  .chart-card-wide { grid-column: auto; }
  .device-panel dl { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 699px) {
  .page { width: min(100% - 20px, 1240px); padding-top: 14px; }
  .topbar-meta,
  .selector-panel,
  .connection-card,
  .chart-section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .range-controls { justify-content: flex-start; }
  .selector-panel select { max-width: none; width: 100%; }
  .guidance-banner { grid-template-columns: 1fr; }
  .chart-wrap,
  .chart-wrap-large { height: 220px; }
  .chart-wrap-medium { height: 205px; }
  .chart-wrap-small { height: 190px; }
  .detail-charts summary small { display: none; }
  .range-controls button,
  .quick-actions button { flex: 1 1 calc(50% - 8px); min-height: 42px; }
  .participation-panel summary { display: block; }
  .participation-panel summary small { display: block; margin-top: 5px; }
  .summary-grid,
  .device-panel dl { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 430px) {
}

/* Eco hero dashboard: isolated top overview layout. */
* { box-sizing: border-box; }

body {
  overflow-x: clip;
  background:
    radial-gradient(circle at 8% 0, rgba(255, 203, 139, .16), transparent 24%),
    linear-gradient(180deg, #f6fbf8 0, #eef7f4 330px, #f8faf7 100%);
}

.page {
  width: min(1328px, calc(100% - 28px));
  padding: 10px 0 28px;
}

.topbar {
  min-height: 58px;
  margin-bottom: 10px;
  align-items: center;
  gap: 16px;
}

.eyebrow,
.section-label {
  margin-bottom: 3px;
  font-size: 14px;
  line-height: 1.15;
  letter-spacing: 0;
  word-break: keep-all;
}

h1 {
  color: #1f3833;
  font-size: clamp(30px, 2.8vw, 42px);
  line-height: 1.05;
}

.topbar-meta {
  max-width: 860px;
  gap: 8px 10px;
  align-items: center;
}

.selector-panel,
.connection-card {
  min-height: 34px;
  padding: 5px 10px;
  border-radius: 14px;
}

.selector-panel label,
.selector-panel span,
.selector-panel select,
.connection-card strong,
.connection-card span,
.updated {
  font-size: 13px;
  line-height: 1.25;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.selector-panel select { height: 28px; }
.connection-card { flex-wrap: wrap; gap: 3px 7px; }
.connection-card strong::after { content: ' ·'; color: #8a9692; }
.updated { flex: 0 1 auto; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.eco-hero,
.eco-hero *,
.eco-hero-comfort,
.eco-hero-right,
.eco-hero-metrics,
.eco-hero-guide {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.eco-hero {
  display: grid;
  gap: 16px;
  align-items: stretch;
  width: 100%;
}

.eco-hero-right {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.eco-hero-metrics {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.eco-hero-comfort,
.eco-hero-metric,
.eco-hero-guide,
.chart-card,
.detail-charts,
.participation-panel,
.device-panel {
  border: 1px solid rgba(40, 76, 66, .1);
  box-shadow: 0 10px 24px rgba(20, 50, 40, .055);
}

.eco-hero-comfort {
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  align-items: center;
  gap: 7px;
  padding: 14px 18px 12px;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(160deg, #ffffff 0%, #eefaf5 100%);
}

.eco-hero-comfort__top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
}

.eco-hero-comfort__icon {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 auto;
}

.eco-hero-comfort__titles {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.eco-hero-comfort__eyebrow {
  color: #2f7e5e;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.eco-hero-comfort__status {
  display: block;
  color: #203934;
  font-size: 24px;
  font-weight: 850;
  line-height: 1.05;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.eco-hero-comfort__ring {
  --score: 0;
  --ring-color: #28a66f;
  position: relative;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-self: center;
  isolation: isolate;
  background: conic-gradient(var(--ring-color) calc(var(--score) * 1%), #dfeee7 0);
  box-shadow: inset 0 0 0 1px rgba(44, 126, 91, .08), 0 12px 22px rgba(50, 119, 89, .11);
}

.eco-hero-comfort__ring::before {
  content: '';
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: white;
  z-index: -1;
}

.eco-hero-comfort__ring-inner {
  display: grid;
  justify-items: center;
  align-content: center;
  line-height: 1;
}

.eco-hero-comfort__score {
  color: #173d32;
  font-size: 68px;
  font-weight: 850;
  line-height: .9;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

.eco-hero-comfort__score-unit {
  margin-top: 8px;
  color: #5b716a;
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.eco-hero-comfort__note {
  margin: 0;
  width: 100%;
  color: #526760;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.eco-hero-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 8px 9px;
  gap: 3px;
  overflow: hidden;
  text-align: center;
  border-radius: 20px;
}

.eco-hero-metric--temperature { --eco-metric-color: #ef7656; background: #fff7f3; }
.eco-hero-metric--humidity { --eco-metric-color: #3389d6; background: #f2f9ff; }
.eco-hero-metric--particulate { --eco-metric-color: #24a99d; background: #f0fbf8; }
.eco-hero-metric--co2 { --eco-metric-color: #36a96d; background: #f2fbf1; }
.eco-hero-metric--noise { --eco-metric-color: #8262c9; background: #f7f3ff; }

.eco-hero-metric__icon {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex: 0 0 auto;
}

.eco-hero-metric__icon--pm {
  width: 36px;
  height: 36px;
}

.eco-hero-metric--particulate {
  gap: 2px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.eco-hero-metric__title {
  margin: 0;
  color: #2e4740;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  word-break: keep-all;
}

.eco-hero-metric__reading {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.eco-hero-metric__value {
  color: #1d2f2b;
  font-size: clamp(29px, 2.5vw, 36px);
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

.eco-hero-metric__unit {
  color: #5f706b;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.eco-hero-metric__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
  padding: 5px 9px;
  border: 1px solid rgba(40, 76, 66, .08);
  border-radius: 999px;
  background: rgba(255,255,255,.74);
  color: color-mix(in srgb, var(--eco-metric-color) 68%, #1f342f);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
  max-width: 100%;
}

.eco-hero-pm {
  width: 100%;
  display: grid;
  gap: 1px;
}

.eco-hero-pm__row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.eco-hero-pm__row span {
  color: #4f6760;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.eco-hero-pm__row strong {
  justify-self: end;
  color: #1d2f2b;
  font-size: 21px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

.eco-hero-pm__unit {
  color: #5f706b;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.eco-hero-metric__reading--noise {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.eco-hero-metric__value--noise {
  font-size: clamp(28px, 2.25vw, 34px);
}

.eco-hero-guide {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  overflow: hidden;
  border-radius: 22px;
  background: #fffaf0;
}

.eco-hero-guide__icon {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.eco-hero-guide__body {
  min-width: 0;
}

.eco-hero-guide__eyebrow {
  display: block;
  color: #bd7428;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.eco-hero-guide__title {
  display: block;
  margin-top: 2px;
  color: #263c36;
  font-size: clamp(21px, 1.8vw, 27px);
  font-weight: 850;
  line-height: 1.15;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.eco-hero-guide__description {
  margin: 3px 0 0;
  color: #526760;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.chart-section {
  margin-top: 14px;
  padding-top: 0;
}

.chart-section-head {
  min-height: 34px;
  margin-bottom: 8px;
  align-items: center;
}

.chart-section h2 {
  font-size: 20px;
  line-height: 1.1;
}

.range-controls { gap: 6px; }
.range-controls button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 13px;
}

.primary-charts {
  display: grid;
  gap: 14px;
}

.chart-card {
  padding: 10px 12px 9px;
  border-radius: 20px;
}

.chart-card header { gap: 10px; margin-bottom: 4px; }
.chart-card h3 { font-size: 22px; line-height: 1; }
.chart-card h3 small,
.chart-card > small,
.chart-card header p { font-size: 12px; line-height: 1.25; }
.detail-charts,
.participation-panel,
.device-panel { margin-top: 14px; }

@media (min-width: 1200px) {
  .topbar { height: 62px; }
  .eco-hero {
    grid-template-columns: 310px minmax(0, 1fr);
  }
  .eco-hero-right {
    grid-template-rows: 166px 104px;
  }
  .eco-hero-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .eco-hero-comfort {
    height: 284px;
  }
  .eco-hero-metric {
    height: 166px;
  }
  .eco-hero-guide {
    height: 104px;
  }
  .primary-charts {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  }
  .chart-card { height: 250px; }
  .chart-wrap-large { height: 176px; }
}

@media (max-width: 1199px) {
  .topbar { display: block; min-height: 0; }
  .topbar-meta { justify-content: flex-start; margin-top: 10px; }
  .eco-hero { grid-template-columns: 1fr; }
  .eco-hero-comfort { height: auto; min-height: 270px; }
  .eco-hero-right { grid-template-rows: auto auto; }
  .eco-hero-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .eco-hero-metric { height: 160px; }
  .primary-charts { grid-template-columns: 1fr 1fr; }
  .chart-wrap-large { height: 190px; }
}

@media (max-width: 899px) {
  .eco-hero-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .primary-charts { grid-template-columns: 1fr; }
}

@media (max-width: 599px) {
  .page { width: min(100% - 20px, 1328px); padding-top: 10px; }
  .topbar-meta,
  .selector-panel,
  .connection-card,
  .chart-section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .connection-card strong::after { content: ''; }
  .eco-hero-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eco-hero-metric { height: auto; min-height: 150px; }
  .eco-hero-guide {
    height: auto;
    grid-template-columns: 52px minmax(0, 1fr);
    padding: 12px;
  }
  .eco-hero-guide__icon { width: 52px; height: 52px; }
}

@media (max-width: 390px) {
  .eco-hero-metrics { grid-template-columns: 1fr; }
  .eco-hero-guide { grid-template-columns: 1fr; }
  .eco-hero-guide__icon { justify-self: start; }
}

/* AI graph annotations */
.trend-actions {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.graph-ai-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #8cc7d2;
  border-radius: 12px;
  background: #e9f8fb;
  color: #176273;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.chart-annotation-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.chart-annotation-marker {
  position: absolute;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #176273;
  color: #fff;
  box-shadow: 0 6px 14px rgba(28, 73, 81, .22);
  font-size: 12px;
  font-weight: 950;
  transform: translate(-50%, -50%);
}

.chart-annotation-line {
  position: absolute;
  width: 0;
  border-left: 2px dashed rgba(23, 98, 115, .48);
  transform: translateX(-1px);
}

.chart-annotation-line--co2 {
  border-left-color: rgba(38, 136, 91, .48);
}

.chart-annotation-line--noise_dbfs {
  border-left-color: rgba(118, 84, 184, .48);
}

.chart-annotation-marker--co2 {
  background: #26885b;
}

.chart-annotation-marker--noise_dbfs {
  background: #7654b8;
}

.chart-annotation-callout {
  position: absolute;
  max-width: 220px;
  border: 1px solid rgba(23, 98, 115, .16);
  border-left-width: 4px;
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 18px rgba(30, 64, 58, .14);
  padding: 7px 9px;
  color: #263c36;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  transform: translateX(-50%);
  pointer-events: none;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.chart-annotation-callout--co2 {
  border-color: rgba(38, 136, 91, .24);
  border-left-color: #26885b;
  background: #f1fbf5;
}

.chart-annotation-callout--noise_dbfs {
  border-color: rgba(118, 84, 184, .24);
  border-left-color: #7654b8;
  background: #f6f2ff;
}

.graph-ai-panel {
  margin-top: 10px;
  border: 1px solid rgba(44, 92, 83, .12);
  border-radius: 18px;
  background: #fff;
  padding: 13px 14px;
  box-shadow: 0 8px 20px rgba(44, 67, 61, .05);
}

.graph-ai-panel__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.graph-ai-panel__head strong {
  color: #233b36;
  font-size: 16px;
  line-height: 1.35;
}

.graph-ai-panel__head span {
  color: #687873;
  font-size: 13px;
  font-weight: 750;
}

.graph-ai-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.graph-ai-list__group {
  border-radius: 14px;
  background: #f1f8fb;
  padding: 10px 11px;
}

.graph-ai-list__group--noise_dbfs {
  background: #f6f2ff;
}

.graph-ai-list strong {
  display: block;
  color: #176273;
  font-size: 14px;
  line-height: 1.3;
}

.graph-ai-list__item {
  margin-top: 8px;
}

.graph-ai-list__item b {
  display: block;
  color: #263c36;
  font-size: 14px;
  line-height: 1.3;
}

.graph-ai-list__item span {
  display: block;
  margin-top: 2px;
  color: #687873;
  font-size: 12px;
  font-weight: 750;
}

.graph-ai-list p,
.graph-ai-question p {
  margin: 4px 0 0;
  color: #4c5f59;
  font-size: 14px;
  line-height: 1.4;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.graph-ai-question {
  margin-top: 9px;
  border-radius: 14px;
  background: #fff8e6;
  padding: 10px 11px;
}

.graph-ai-question span {
  color: #9b681b;
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 699px) {
  .trend-actions {
    justify-content: flex-start;
  }
  .graph-ai-status,
  .range-controls button {
    flex: 1 1 calc(50% - 8px);
    min-height: 40px;
  }
  .chart-annotation-callout {
    display: none;
  }
  .chart-annotation-marker {
    width: 26px;
    height: 26px;
  }
  .graph-ai-list {
    grid-template-columns: 1fr;
  }
}

/* Always-on five metric trend board */
.eco-trends {
  margin-top: 10px;
  min-width: 0;
}

.eco-trends__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 8px;
}

.eco-trends__toolbar h2 {
  font-size: 20px;
  line-height: 1.05;
}

.eco-trends__toolbar .section-label {
  margin-bottom: 3px;
}

.eco-trend-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.eco-trend-card {
  min-width: 0;
  max-width: 100%;
  height: 220px;
  padding: 10px 10px 8px;
  border: 1px solid rgba(55, 78, 73, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 24px rgba(44, 67, 61, 0.06);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
}

.eco-trend-card__header {
  min-width: 0;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 7px;
}

.eco-trend-card__header h3 {
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: #253d37;
  font-size: clamp(21px, 1.8vw, 26px);
  line-height: 1;
  white-space: nowrap;
}

.eco-trend-card__header h3 small {
  color: #667771;
  font-size: 11px;
  font-weight: 850;
}

.eco-trend-card__header p {
  margin: 0;
  color: #65736f;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.25;
  text-align: right;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.eco-trend-card__chart {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 118px;
}

.eco-trend-card canvas {
  width: 100% !important;
  height: 100% !important;
}

.eco-trend-card__ai {
  min-width: 0;
  min-height: 34px;
  border-radius: 11px;
  background: #f7faf9;
  padding: 5px 7px;
  font-size: 10.5px;
  line-height: 1.25;
}

.eco-trend-card__ai-title {
  display: block;
  color: #243d37;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eco-trend-card__ai-detail {
  margin: 2px 0 0;
  color: #526760;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.eco-trend-card--temperature .eco-trend-card__ai { background: #fff4ef; }
.eco-trend-card--humidity .eco-trend-card__ai { background: #eef7ff; }
.eco-trend-card--particulate .eco-trend-card__ai { background: #eefbf8; }
.eco-trend-card--co2 .eco-trend-card__ai { background: #f0fbf5; }
.eco-trend-card--noise .eco-trend-card__ai { background: #f6f2ff; }

.chart-annotation-callout {
  max-width: 155px;
  padding: 5px 7px;
  font-size: 10.5px;
  line-height: 1.18;
}

.chart-annotation-marker {
  width: 21px;
  height: 21px;
  font-size: 11px;
}

.chart-annotation-marker--temperature { background: #d85f37; }
.chart-annotation-marker--humidity { background: #2f7fc8; }
.chart-annotation-marker--particulate { background: #159488; }
.chart-annotation-marker--co2 { background: #26885b; }
.chart-annotation-marker--noise_dbfs { background: #7654b8; }
.chart-annotation-line--temperature { border-left-color: rgba(216, 95, 55, .45); }
.chart-annotation-line--humidity { border-left-color: rgba(47, 127, 200, .45); }
.chart-annotation-line--particulate { border-left-color: rgba(21, 148, 136, .45); }
.chart-annotation-line--co2 { border-left-color: rgba(38, 136, 91, .45); }
.chart-annotation-line--noise_dbfs { border-left-color: rgba(118, 84, 184, .45); }
.chart-annotation-callout--temperature { border-left-color: #d85f37; background: #fff4ef; }
.chart-annotation-callout--humidity { border-left-color: #2f7fc8; background: #eef7ff; }
.chart-annotation-callout--particulate { border-left-color: #159488; background: #eefbf8; }
.chart-annotation-callout--co2 { border-left-color: #26885b; background: #f0fbf5; }
.chart-annotation-callout--noise_dbfs { border-left-color: #7654b8; background: #f6f2ff; }

@media (min-width: 1200px) {
  .page { padding-top: 8px; padding-bottom: 20px; }
  .topbar { height: 58px; }
  .eco-hero { margin-top: 8px; grid-template-columns: 278px minmax(0, 1fr); gap: 12px; }
  .eco-hero-right { grid-template-rows: 138px 86px; gap: 10px; }
  .eco-hero-comfort { height: 234px; padding: 10px 14px 9px; }
  .eco-hero-comfort__ring { width: 158px; height: 158px; }
  .eco-hero-comfort__ring::before { inset: 15px; }
  .eco-hero-comfort__score { font-size: 56px; }
  .eco-hero-comfort__status { font-size: 21px; }
  .eco-hero-metric { height: 138px; padding: 8px 7px 7px; gap: 2px; }
  .eco-hero-metric__icon { width: 38px; height: 38px; }
  .eco-hero-metric__title { font-size: 14px; }
  .eco-hero-metric__value { font-size: clamp(24px, 2vw, 30px); }
  .eco-hero-metric__status { font-size: 11px; padding: 4px 7px; }
  .eco-hero-guide { height: 86px; grid-template-columns: 52px minmax(0, 1fr); padding: 9px 13px; }
  .eco-hero-guide__icon { width: 50px; height: 50px; }
  .eco-hero-guide__title { font-size: clamp(18px, 1.5vw, 23px); }
  .eco-hero-guide__description { font-size: 12px; }
}

@media (max-width: 1399px) and (min-width: 1200px) {
  .chart-annotation-callout { display: none; }
}

@media (max-width: 1199px) {
  .eco-trend-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .eco-trend-card { height: 220px; }
}

@media (max-width: 899px) {
  .eco-trend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eco-trends__toolbar { align-items: stretch; flex-direction: column; }
}

@media (max-width: 599px) {
  .eco-trend-grid { grid-template-columns: 1fr; }
  .eco-trend-card { height: auto; min-height: 220px; }
  .eco-trend-card__chart { height: 130px; }
  .chart-annotation-callout { display: none; }
}
