@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --ink: #1d2e30;
  --ink-soft: #3e5c58;
  --paper: #f2f0e8;
  --paper-raised: #fbfaf5;
  --brass: #b8863e;
  --brass-dark: #9a6f30;
  --confirmed: #4f7a5a;
  --confirmed-bg: #e7efe6;
  --flagged: #a8452f;
  --flagged-bg: #f6e6e1;
  --line: #d8d3c4;
  --shadow: 0 1px 2px rgba(29, 46, 48, 0.06), 0 4px 14px rgba(29, 46, 48, 0.07);
  --radius: 14px;
  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.4em;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

a {
  color: var(--ink-soft);
}

button {
  font-family: var(--font-body);
}

:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

.app-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  min-height: 100vh;
}

.app-shell.wide {
  max-width: 960px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.15s ease;
  font-family: var(--font-body);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--ink-soft);
}

.btn-brass {
  background: var(--brass);
  color: #fff;
}

.btn-brass:hover {
  background: var(--brass-dark);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.btn-outline:hover {
  border-color: var(--ink-soft);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="password"],
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  font-family: var(--font-body);
  background: #fff;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
  min-height: 70px;
}

.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 280px;
  margin: 0 auto;
}

.pin-grid button {
  aspect-ratio: 1;
  font-size: 24px;
  font-family: var(--font-mono);
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.pin-grid button:active {
  background: var(--paper);
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 18px 0;
}

.pin-dots .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-soft);
  background: transparent;
}

.pin-dots .dot.filled {
  background: var(--ink-soft);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}

.chip.selected {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.checkbox-row:last-child {
  border-bottom: none;
}

.checkbox-row input {
  width: 20px;
  height: 20px;
}

.checkbox-row label {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.confirmed {
  background: var(--confirmed);
}

.status-dot.flagged {
  background: var(--flagged);
}

.status-dot.pending {
  background: var(--line);
}

.banner {
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.banner.flag {
  background: var(--flagged-bg);
  color: var(--flagged);
}

.banner.ok {
  background: var(--confirmed-bg);
  color: var(--confirmed);
}

.time-stamp {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink-soft);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(29, 46, 48, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal {
  background: var(--paper-raised);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
}

.center-flow {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.text-center {
  text-align: center;
}

.muted {
  color: var(--ink-soft);
  font-size: 14px;
}

.error-text {
  color: var(--flagged);
  font-size: 14px;
  margin-top: 8px;
}

.role-pick {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 28px;
}

.role-card {
  display: block;
  background: var(--paper-raised);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.role-card:hover {
  border-color: var(--brass);
}

.role-card h2 {
  margin-bottom: 4px;
}

.role-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

/* --- Logbook spine (family view signature element) --- */

.logbook-day {
  position: relative;
  padding-left: 28px;
  margin-bottom: 22px;
}

.logbook-day::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: -22px;
  width: 1.5px;
  background: var(--line);
}

.logbook-day:last-child::before {
  display: none;
}

.day-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.day-heading .day-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.day-heading .day-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
}

.log-entry {
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.log-entry::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 18px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1.5px var(--line);
}

.log-entry.has-flag::before {
  background: var(--flagged);
  box-shadow: 0 0 0 1.5px var(--flagged);
}

.log-entry.all-good::before {
  background: var(--confirmed);
  box-shadow: 0 0 0 1.5px var(--confirmed);
}

.log-entry .entry-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}

.log-entry .visit-label {
  font-weight: 600;
  font-size: 14px;
}

.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  font-size: 13.5px;
}

.entry-grid .k {
  color: var(--ink-soft);
}

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.week-nav button {
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--font-mono);
}

.checklist-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.checklist-strip .task {
  flex: 1;
  min-width: 140px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
}

.checklist-strip .task .task-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.checklist-strip .task.done {
  border-color: var(--confirmed);
  background: var(--confirmed-bg);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

@media (max-width: 480px) {
  .entry-grid {
    grid-template-columns: 1fr;
  }
}
