:root {
  --bg: #f8f9fa;
  --ink: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --paper: #ffffff;
  --blue: #1a73e8;
  --blue-soft: #e8f0fe;
  --red: #d93025;
  --red-soft: #fce8e6;
  --green: #188038;
  --green-soft: #e6f4ea;
  --yellow: #f9ab00;
  --yellow-soft: #fef7e0;
  --gray: #80868b;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Roboto, "Segoe UI", sans-serif;
}

.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.mark i { display: block; }
.g-blue { background: #4285f4; }
.g-red { background: #ea4335; }
.g-yellow { background: #fbbc04; }
.g-green { background: #34a853; }

h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.who {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.back {
  border: 0;
  background: none;
  color: var(--blue);
  font: 500 0.95rem/1 Roboto, "Segoe UI", sans-serif;
  padding: 0 0 10px;
}

.back[hidden] { display: none; }

main { padding: 16px; max-width: 920px; margin: 0 auto; }

.tile {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: var(--paper);
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  font: inherit;
  color: inherit;
}

.tile-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tile-text b { font-weight: 500; font-size: 1.05rem; }
.tile-text span { color: var(--muted); font-size: 0.9rem; line-height: 1.35; }
.chev { color: #9aa0a6; font-size: 1.4rem; }

.tile .hero-icon { margin-bottom: 0; width: 48px; height: 48px; }

.page { display: none; }
.page.on { display: block; }

.hero-card, .add-card, .day-panel {
  background: var(--paper);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px 20px;
}

.hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  margin-bottom: 14px;
}

.hero-icon.cal { background: var(--blue-soft); }
.hero-icon.shop { background: #e6f4ea; }
.hero-icon.photo { background: var(--yellow-soft); }
.hero-icon.kit { background: var(--red-soft); color: var(--red); }
.hero-icon.health { background: #fce8e6; color: #c5221f; }

h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 500;
}

.lead, .hint {
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.45;
}

.example {
  margin: 16px 0;
  padding: 14px 16px;
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 12px;
  font-weight: 500;
}

.banner {
  background: var(--yellow-soft);
  color: #3c4043;
  padding: 10px 14px;
  border-radius: 10px;
  margin: 0 0 12px;
}

.banner[hidden] { display: none; }

.month-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.month-bar h2 {
  flex: 1;
  margin: 0;
  font-size: 1.15rem;
  white-space: nowrap;
}

.icon-btn, .text-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  height: 36px;
  min-width: 36px;
  padding: 0 12px;
  font: 500 1rem/1 Roboto, "Segoe UI", sans-serif;
}

.icon-btn { font-size: 1.3rem; padding: 0; }
.icon-btn.plus {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 500;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.form-actions .primary { margin-top: 0; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--paper);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}

.cal-grid > * { min-width: 0; }

.dow, .cell {
  min-height: 64px;
  padding: 6px 4px 4px;
  border-right: 1px solid #f1f3f4;
  border-bottom: 1px solid #f1f3f4;
}

.dow {
  min-height: 0;
  padding: 8px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
}

.cell {
  background: var(--paper);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}

button.cell {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  border-top: 0;
  border-left: 0;
  margin: 0;
}

.cell.out { color: #bdc1c6; background: #fcfcfd; }
.cell.on { background: var(--blue-soft); }
.cell .num {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 500;
}

.cell.today .num {
  background: var(--blue);
  color: #fff;
}

.pills { margin-top: 2px; }
.pill {
  height: 6px;
  border-radius: 99px;
  margin: 2px 1px 0;
  display: inline-block;
  width: calc(100% - 2px);
}

.pill.blue { background: var(--blue); }
.pill.red { background: var(--red); }
.pill.green { background: var(--green); }
.pill.yellow { background: var(--yellow); }

.add-card { margin-bottom: 14px; }
.add-card h3, .day-panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 500;
}

label {
  display: block;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}

input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.primary {
  margin-top: 6px;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 24px;
  padding: 10px 22px;
  font: 500 0.95rem/1 Roboto, "Segoe UI", sans-serif;
}

.event {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f3f4;
}

.event:last-child { border-bottom: 0; }

.event .when {
  width: 46px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.25;
}

.event .body { flex: 1; min-width: 0; }
.event .title { font-weight: 500; }
.event .meta { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }

.empty {
  color: var(--muted);
  padding: 8px 0 4px;
}

@media (min-width: 720px) {
  .dow, .cell { min-height: 78px; }
}
