*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:    #0077b6;
  --blue-lt: #e8f4fc;
  --green:   #1a9e4a;
  --yellow:  #d4a017;
  --red:     #c0392b;
  --grey:    #6b7280;
  --border:  #e2e8f0;
  --bg:      #f8fafc;
  --card-bg: #ffffff;
  --text:    #1a202c;
  --text-sm: #4a5568;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- header ---- */
header {
  background: #fff;
  border-bottom: 2px solid var(--blue);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 56px;
}
.site-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}
nav { display: flex; gap: 1.2rem; }
nav a {
  color: var(--text-sm);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
nav a:hover { color: var(--blue); border-color: var(--blue); }

/* ---- main / footer ---- */
main {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}
footer {
  background: #fff;
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-sm);
}

/* ---- hero / status card ---- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 1.75rem;
  gap: 0.6rem;
}
.status-card {
  width: 100%;
  max-width: 480px;
  border-radius: 14px;
  border: 2px solid transparent;
  padding: 2rem 2.5rem;
  text-align: center;
}
.status-pressure {
  font-size: 3.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 0.4rem;
}
.status-text {
  font-size: 1.05rem;
  font-weight: 600;
}
.pressure-green  {
  background: #eaf7ef;
  border-color: #1a9e4a;
  color: #14773a;
}
.pressure-yellow {
  background: #fef8e6;
  border-color: #d4a017;
  color: #9a7210;
}
.pressure-red {
  background: #fde8e6;
  border-color: #c0392b;
  color: #952d22;
}

.updated {
  font-size: 0.8rem;
  color: var(--grey);
}

/* ---- SLO cards ---- */
.slo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.slo-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1rem;
  text-align: center;
}
.slo-label { font-size: 0.8rem; color: var(--text-sm); margin-bottom: 0.4rem; }
.slo-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.3rem;
}
.slo-sub   { font-size: 0.72rem; color: var(--grey); }
.slo-green  { color: var(--green);  }
.slo-yellow { color: var(--yellow); }
.slo-red    { color: var(--red);    }

/* ---- charts ---- */
.chart-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.25rem 1rem;
  margin-bottom: 1.5rem;
}
.chart-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.chart-wrap { height: 340px; position: relative; }

/* ---- recommendation ---- */
.recommendation {
  background: var(--blue-lt);
  border: 1px solid #b3d7ee;
  border-radius: 8px;
  padding: 1.25rem 1.25rem;
  margin-bottom: 1.5rem;
}
.recommendation h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--blue);
}
.recommendation-warn {
  background: #fff8e6;
  border-color: #f0d080;
}
.recommendation-warn h2 { color: var(--yellow); }

/* ---- calendar ---- */
.calendar-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.calendar-legend { font-size: 0.85rem; color: var(--text-sm); margin-bottom: 0.5rem; }
.legend-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0;
  font-size: 0.82rem;
  margin-bottom: 1.5rem;
  color: var(--text-sm);
}
.legend-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  margin-right: 3px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}
.cal-month {}
.cal-month-name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}
.cal-dow-row span {
  font-size: 0.65rem;
  text-align: center;
  color: var(--grey);
  font-weight: 600;
}
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}
.cal-day {
  aspect-ratio: 1;
  border-radius: 3px;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  color: rgba(0,0,0,0.5);
  font-weight: 600;
}
.cal-day.empty   { background: transparent; }
.cal-day.good     { background: #6bbf8e; color: #fff; }
.cal-day.warn     { background: #f5c842; color: #333; }
.cal-day.bad      { background: #f08030; color: #fff; }
.cal-day.critical { background: #d94040; color: #fff; }
.cal-day.nodata   { background: #e2e8f0; }
.legend-dot.good     { background: #6bbf8e; }
.legend-dot.warn     { background: #f5c842; }
.legend-dot.bad      { background: #f08030; }
.legend-dot.critical { background: #d94040; }
.legend-dot.nodata   { background: #e2e8f0; border: 1px solid #ccc; }

/* ---- notices ---- */
.notices-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.notices-section > p { font-size: 0.85rem; color: var(--text-sm); margin-bottom: 1.5rem; }
.notice-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.notice-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
}
.notice-item.planned    { border-left-color: var(--blue); }
.notice-item.unplanned  { border-left-color: var(--red);  }
.notice-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.4rem; }
.notice-date { font-size: 0.8rem; color: var(--grey); font-weight: 600; }
.notice-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 4px;
}
.planned-tag   { background: var(--blue-lt); color: var(--blue); }
.unplanned-tag { background: #fde8e6; color: var(--red); }
.notice-title  { font-weight: 600; margin-bottom: 0.4rem; }
.notice-body   { font-size: 0.9rem; color: var(--text-sm); margin-bottom: 0.5rem; }
.notice-source { font-size: 0.82rem; color: var(--blue); }
.no-notices    { color: var(--grey); font-style: italic; }

/* ---- streak ---- */
.streak {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 20px;
}
.streak-ok   { background: #eaf7ef; color: #14773a; }
.streak-warn { background: #fde8e6; color: #952d22; }

/* ---- chart note ---- */
.chart-note { font-size: 0.8rem; color: var(--text-sm); margin: -0.5rem 0 0.75rem; }
.chart-wrap-sm { height: 220px; }

/* ---- records ---- */
.records-section { margin-bottom: 2rem; }
.records-section h2 {
  font-size: 1rem; font-weight: 600; margin-bottom: 1rem;
  color: var(--text-sm); text-transform: uppercase; letter-spacing: 0.4px;
}
.records-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.record-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
.record-min   { border-left-color: var(--red);   }
.record-max   { border-left-color: var(--green);  }
.record-streak { border-left-color: var(--yellow); }
.record-label { font-size: 0.78rem; color: var(--text-sm); margin-bottom: 0.3rem; }
.record-value { font-size: 1.5rem; font-weight: 700; }
.record-date  { font-size: 0.78rem; color: var(--grey); margin-top: 0.2rem; }

/* ---- monthly table ---- */
.months-section { margin-bottom: 2rem; }
.months-section h2 {
  font-size: 1rem; font-weight: 600; margin-bottom: 1rem;
  color: var(--text-sm); text-transform: uppercase; letter-spacing: 0.4px;
}
.months-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.months-table th {
  background: var(--bg);
  padding: 0.6rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  color: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
}
.months-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.months-table tr:last-child td { border-bottom: none; }
.months-table td.slo-green  { color: var(--green);  }
.months-table td.slo-yellow { color: var(--yellow); }
.months-table td.slo-red    { color: var(--red);    }

/* ---- misc ---- */
.updated-footer { font-size: 0.8rem; color: var(--grey); text-align: right; margin-top: 0.5rem; }

@media (max-width: 600px) {
  .slo-row { grid-template-columns: 1fr; }
  .records-grid { grid-template-columns: 1fr; }
  .calendar-grid { grid-template-columns: repeat(2, 1fr); }
  .header-inner { gap: 1rem; }
  nav { gap: 0.8rem; }
}
