:root {
  color-scheme: light;
  --ink: #233e2b;
  --leaf: #2f6f35;
  --leaf-light: #8caf72;
  --paper: #fbfaf4;
  --cream: #f4f1e8;
  --line: #d7ddcc;
  --muted: #657065;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f1efe5;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='460' height='330' viewBox='0 0 460 330'%3E%3Cdefs%3E%3Cg id='m' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0 18c-24-20-24-46 0-58 24 12 24 38 0 58Z'/%3E%3Cpath d='M0 18c-38-4-58-27-48-52 28-4 49 13 48 52Z'/%3E%3Cpath d='M0 18c38-4 58-27 48-52-28-4-49 13-48 52Z'/%3E%3Cpath d='M0 18c-34 12-61 2-68-24 28-13 55-3 68 24Z'/%3E%3Cpath d='M0 18c34 12 61 2 68-24-28-13-55-3-68 24Z'/%3E%3Cpath d='M-72 0c24 38 120 38 144 0'/%3E%3C/g%3E%3C/defs%3E%3Cg stroke-width='1.45'%3E%3Cg stroke='%23477b2c' stroke-opacity='.16' transform='translate(88 92) rotate(-22) scale(.78)'%3E%3Cuse href='%23m'/%3E%3C/g%3E%3Cg stroke='%238b1738' stroke-opacity='.10' transform='translate(328 76) rotate(24) scale(.52)'%3E%3Cuse href='%23m'/%3E%3Cg stroke='%23477b2c' stroke-opacity='.12' transform='translate(330 248) rotate(-34) scale(.68)'%3E%3Cuse href='%23m'/%3E%3Cg stroke='%238b1738' stroke-opacity='.08' transform='translate(108 260) rotate(31) scale(.46)'%3E%3Cuse href='%23m'/%3E%3Cg stroke='%239eaf33' stroke-opacity='.12' transform='translate(218 158) rotate(-7) scale(.58)'%3E%3Cuse href='%23m'/%3E%3Cg stroke='%23477b2c' stroke-opacity='.09' transform='translate(438 182) rotate(18) scale(.42)'%3E%3Cuse href='%23m'/%3E%3Cg stroke='%238b1738' stroke-opacity='.07' transform='translate(20 178) rotate(-28) scale(.40)'%3E%3Cuse href='%23m'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse at 14% 20%, rgba(71, 123, 44, .13) 0 2px, transparent 3px 32px),
    radial-gradient(ellipse at 86% 68%, rgba(139, 23, 56, .075) 0 2px, transparent 3px 38px),
    linear-gradient(135deg, rgba(71, 123, 44, .065) 0 1px, transparent 1px 28px),
    linear-gradient(45deg, rgba(139, 23, 56, .045) 0 1px, transparent 1px 42px),
    radial-gradient(circle at 10% 5%, rgba(158, 175, 51, .20), transparent 34rem),
    radial-gradient(circle at 92% 42%, rgba(139, 23, 56, .10), transparent 27rem),
    var(--cream);
  background-size: 460px 330px, auto, auto, auto, auto, auto, auto, auto;
  background-position: 10px 88px, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
  background-attachment: fixed;
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0;
}

.page-header,
.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.page-header {
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -.04em;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.page-header a {
  flex: 0 0 auto;
  padding: 11px 16px;
  color: #9d1f2d;
  text-decoration: none;
  border: 1px solid #e5c9c9;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
}

.chart-panel {
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(47, 111, 53, .18);
  border-radius: 28px;
  background: rgba(251, 250, 244, .94);
  box-shadow: 0 18px 45px rgba(36, 54, 34, .08);
}

.visit-summaries {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--line);
}

.visit-summaries div {
  min-width: 0;
  padding: 18px;
  background: #fff;
}

.visit-summaries dt {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.visit-summaries dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 700;
  line-height: 1;
}

.chart-toolbar {
  margin-bottom: 28px;
}

#updated-at {
  margin-top: 5px;
  color: var(--muted);
  font-size: .92rem;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

select {
  min-width: 150px;
  padding: 10px 36px 10px 12px;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.chart-scroll {
  overflow-x: auto;
  padding: 8px 2px 4px;
}

.visits-chart {
  display: grid;
  grid-template-columns: repeat(var(--bars, 1), minmax(24px, 1fr));
  align-items: end;
  gap: 6px;
  min-width: calc(var(--bars, 1) * 32px);
  height: 345px;
  padding: 24px 8px 0;
  border-bottom: 1px solid var(--line);
}

.update-schedule {
  margin-top: 14px;
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
}

.bar-item {
  display: grid;
  grid-template-rows: 28px minmax(0, 1fr) 40px;
  align-items: end;
  height: 100%;
  text-align: center;
}

.bar-value {
  align-self: start;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 700;
}

.bar-track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
}

.bar {
  width: min(100%, 36px);
  min-height: 2px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--leaf-light), var(--leaf));
}

.bar-label {
  align-self: start;
  padding-top: 8px;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.15;
}

.empty-state {
  grid-column: 1 / -1;
  align-self: center;
  color: var(--muted);
}

@media (max-width: 620px) {
  .wrap {
    width: min(100% - 24px, 1120px);
    padding: 20px 0;
  }

  .page-header,
  .chart-toolbar {
    align-items: flex-start;
  }

  .chart-toolbar {
    flex-direction: column;
  }

  .visit-summaries {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visit-summaries div:last-child {
    grid-column: 1 / -1;
  }

  label,
  select {
    width: 100%;
  }

  .visits-chart {
    height: 290px;
  }
}
