:root {
  --paper: #f4efe6;
  --ink: #2a241f;
  --muted: #6f655c;
  --line: #d8cfc2;
  --accent: #1d7a61;
  --surface: #fffdf8;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -8%, #ffe8c8 0, transparent 32%),
    linear-gradient(180deg, #faf6ef, var(--paper));
}

.routines-chrome {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.92);
  position: sticky;
  top: 0;
  z-index: 5;
}

.back-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.chrome-copy {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 180px;
}

.chrome-copy strong { font-size: 1.15rem; }
.chrome-copy span,
.muted { color: var(--muted); }

.chrome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.person-filter {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.person-filter select,
.print-button {
  font: inherit;
}

.person-filter select {
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.print-button {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.routines-root {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  display: grid;
  gap: 22px;
}

.routine-sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px 26px;
  break-inside: avoid;
}

.routine-sheet h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
}

.routine-meta {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.step-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.12rem;
  line-height: 1.35;
}

.checkbox {
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid var(--ink);
  border-radius: 4px;
  flex: 0 0 auto;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  z-index: 20;
}

.toast.error { background: #9b2c2c; }

@media (max-width: 700px) {
  .routines-chrome { padding: 14px 16px; }
  .routine-sheet { padding: 18px; }
}

@media print {
  body {
    background: white;
    color: black;
  }

  .no-print,
  .toast {
    display: none !important;
  }

  .routines-root {
    max-width: none;
    padding: 0;
    gap: 18px;
  }

  .routine-sheet {
    border: 1px solid #222;
    border-radius: 0;
    padding: 16px 18px 20px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .step-list li {
    font-size: 14pt;
  }

  .checkbox {
    border-color: #000;
  }
}
