/*
 * "Once a day, an email": the SmartGuardian page's daily summary section.
 *
 * Its own file, loaded only by smartguardian.html, because css/site.css is
 * being rebuilt by the redesign session on the same branch and two sessions
 * editing one stylesheet is how a night's work gets lost in a merge.
 *
 * The card is laid out after the summary the sensor's own service sends
 * every day (Nigel's account, read 13 Oct 2026): sensors online and offline,
 * whether activity was seen, the number of alerts, and a breakdown of the
 * day by activity. The figures on the card are made up; nothing from a real
 * home is shown.
 */

.ds-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.ds-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; }
.ds-list li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.ds-list li > span {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--teal-tint); color: var(--teal);
  display: grid; place-items: center; font-weight: 700; font-size: 0.85rem;
}
.ds-list strong { display: block; color: var(--ink); }
.ds-list p { margin: 2px 0 0; }

.ds-note { margin-top: 18px; font-size: 0.92rem; color: #4a5a5c; }

/* The email itself. */
.ds-mail {
  background: #fff;
  border: 1px solid #dfe8e7;
  border-radius: 18px;
  box-shadow: 0 24px 60px -24px rgba(11, 59, 61, 0.35), 0 2px 6px rgba(11, 59, 61, 0.06);
  overflow: hidden;
  font-size: 0.95rem;
}
.ds-mail-head { padding: 16px 20px 14px; border-bottom: 1px solid #eef3f2; background: #fbfdfd; }
.ds-mail-from { display: flex; align-items: center; gap: 10px; color: #4a5a5c; font-size: 0.85rem; }
.ds-mail-from img { width: 28px; height: 28px; border-radius: 8px; }
.ds-mail-subject { margin: 8px 0 0; font-weight: 700; color: var(--ink); font-size: 1.02rem; }
.ds-mail-body { padding: 18px 20px 20px; display: grid; gap: 16px; }

.ds-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ds-stat { border-radius: 12px; background: var(--teal-tint); padding: 10px 12px; }
.ds-stat b { display: block; font-size: 1.25rem; color: var(--ink); line-height: 1.2; }
.ds-stat small { color: #3f5254; font-size: 0.78rem; }
.ds-stat.is-calm { background: #edf7ef; }

.ds-bars h3 { font-size: 0.85rem; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.06em; color: #3f5254; }
.ds-bar { display: grid; grid-template-columns: 7.5em 1fr 4.2em; gap: 10px; align-items: center; margin: 6px 0; font-size: 0.88rem; color: #2b3b3d; }
.ds-bar i { display: block; height: 10px; border-radius: 6px; background: var(--teal); width: var(--w); }
.ds-bar.b2 i { background: var(--orange); }
.ds-bar.b3 i { background: #6fa8a6; }
.ds-bar span:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.ds-rooms { display: flex; flex-wrap: wrap; gap: 6px; }
.ds-rooms span { border: 1px solid #dfe8e7; border-radius: 999px; padding: 3px 10px; font-size: 0.8rem; color: #2b3b3d; }

.ds-mail-foot { font-size: 0.78rem; color: #5b6b6d; border-top: 1px solid #eef3f2; padding-top: 12px; }

@media (max-width: 860px) {
  .ds-grid { grid-template-columns: 1fr; }
  .ds-mail { order: 2; }
}
@media (max-width: 420px) {
  .ds-stats { grid-template-columns: 1fr 1fr; }
  .ds-stats .ds-stat:last-child { grid-column: 1 / -1; }
  .ds-bar { grid-template-columns: 6.2em 1fr 3.8em; }
}

/*
 * A div, not a section, on purpose: the redesign colours sections by their
 * position (round4.css, round5.css: main > .svc-section:nth-of-type(4n+3)),
 * so one more <section> would shift the ground of every section below it.
 * Its own padding (the same as .svc-section) and its own ground instead.
 */
.ds-section { padding: 96px 0; background: linear-gradient(180deg, #f3f8f7 0%, #eaf4f3 100%); }
@media (max-width: 640px) { .ds-section { padding: 64px 0; } }

/* 13 Oct, later: the card rebuilt from the maker's own published example
   (user manual sec. 9.3.3): sensor status bars, a midnight-to-midnight
   timeline per person, minutes and shares for Lying / Sitting / Bending /
   Standing, alerts by type. Colours follow theirs. */
.ds-block h3 { font-size: 0.78rem; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.06em; color: #3f5254; }
.ds-sbar, .ds-pct { display: grid; grid-template-columns: 4.6em 1fr 2.6em; gap: 8px; align-items: center; margin: 5px 0; font-size: 0.84rem; color: #2b3b3d; }
.ds-pct { grid-template-columns: 5em 1fr 3.4em; }
.ds-sbar i, .ds-pct i { display: block; height: 12px; border-radius: 4px; width: max(var(--w), 3px); }
.ds-sbar i.on { background: #6aa84f; } .ds-sbar i.off { background: #c9303e; }
.ds-sbar b, .ds-pct b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.ds-tl { position: relative; height: 26px; border: 1px solid #dfe8e7; border-radius: 6px; background: #fff; overflow: hidden; }
.ds-tl i { position: absolute; top: 0; bottom: 0; left: var(--a); width: var(--b); }
.ds-mail .ly { background: #c9303e; } .ds-mail .si { background: #7b2ff7; } .ds-mail .be { background: #e9b81c; } .ds-mail .st { background: #6aa84f; }
.ds-ticks { display: flex; justify-content: space-between; font-size: 0.7rem; color: #5b6b6d; margin-top: 4px; }
.ds-key { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: 0.82rem; color: #2b3b3d; }
.ds-key li { display: flex; align-items: center; gap: 6px; } .ds-key b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.ds-key i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.ds-split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.ds-alerts { margin: 0; display: grid; gap: 6px; font-size: 0.86rem; color: #2b3b3d; }
.ds-alerts span { display: flex; justify-content: space-between; border-bottom: 1px solid #eef3f2; padding-bottom: 4px; }
@media (max-width: 480px) { .ds-split { grid-template-columns: 1fr; } .ds-key { grid-template-columns: 1fr; } }
