/* Pawtual — warm-oat single-column theme */

:root {
  --primary: #f4e8d6;
  --primary-deep: #ecdcc3;
  --secondary: #3d6b5a;
  --secondary-deep: #2c5245;
  --accent: #e9785b;
  --accent-deep: #d05f42;
  --graphite: #4a4a48;
  --ink: #3a352e;
  --ink-soft: #7a7062;
  --card: #fffaf1;
  --ring: rgba(61, 107, 90, 0.22);
  --radius: 18px;
  --tab-h: 64px;
  --pad-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 18px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--primary);
  color: var(--ink);
  font-family: ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  overscroll-behavior-y: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app { min-height: 100dvh; }

/* ---------- screens ---------- */
.screens { padding-bottom: var(--pad-bottom); }

.screen { animation: rise 0.22s ease-out; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen-inner {
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px 0;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- masthead ---------- */
.mast { margin-bottom: 16px; }
.mast-title {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--secondary-deep);
}
.mast-title--small { font-size: 1.45rem; }
.mast-sub {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.mast-paw {
  display: block;
  width: 26px;
  height: 26px;
  margin-bottom: 6px;
  background: var(--accent);
  border-radius: 50% 50% 46% 46%;
  position: relative;
}
.mast-paw::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 2px;
  width: 8px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 13px 0 0 var(--accent);
}

/* ---------- paw counters ---------- */
.paw-strip {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.paw-count {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--ring);
  text-align: left;
}
.paw-count--done { box-shadow: inset 0 0 0 1.5px rgba(74,74,72,0.25); }
.paw-count-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--secondary-deep);
  min-width: 1.2em;
  line-height: 1;
}
.paw-count--done .paw-count-num { color: var(--graphite); }
.paw-count-word {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.paw-count-dots { display: flex; gap: 3px; }

/* dots — filled/hollow, never ticks */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--secondary);
  display: inline-block;
  background: transparent;
}
.dot--fill { background: var(--secondary); }
.dot--lg { width: 12px; height: 12px; border-width: 2px; }
.stage-btn--ready .dot--fill { background: var(--secondary); border-color: var(--secondary); }

/* ---------- add strip ---------- */
.add-strip {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(233, 120, 91, 0.35);
  margin-bottom: 22px;
  transition: transform 0.1s ease;
}
.add-strip:active { transform: scale(0.985); }
.add-strip-ring {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  flex: none;
}
.add-strip-text {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.3px;
}

/* ---------- section labels ---------- */
.sect-label {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-soft);
}

/* ---------- bowl card (first recent row) ---------- */
.stack { display: flex; flex-direction: column; gap: 10px; }

.bowl-card {
  position: relative;
  width: 100%;
  display: block;
  text-align: left;
  padding: 18px 18px 16px;
  border-radius: 40% 40% 26px 26px / 30% 30% 26px 26px;
  background: var(--secondary);
  color: #f7efe2;
  box-shadow: 0 6px 16px rgba(61, 107, 90, 0.3);
  overflow: hidden;
  transition: transform 0.1s ease;
}
.bowl-card:active { transform: scale(0.985); }
.bowl-card::after {
  /* bowl rim ring */
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 84px;
  height: 84px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 3px dashed rgba(247, 239, 226, 0.35);
  pointer-events: none;
}
.bowl-card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #ffe0b8;
  margin-bottom: 6px;
}
.bowl-card-name {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  word-break: break-word;
}
.bowl-card-pet {
  display: block;
  margin: 3px 0 0;
  font-size: 0.85rem;
  color: #cfe3da;
}
.bowl-card-note {
  display: block;
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: #e8dcc4;
  line-height: 1.4;
  word-break: break-word;
}
.bowl-card .dot { border-color: #ffe0b8; }
.bowl-card .dot--fill { background: #ffe0b8; }

/* ---------- slim leash rows ---------- */
.routines-stack { display: flex; flex-direction: column; gap: 18px; }

.stage-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.stage-group-label .gcount {
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0;
}
.g--Ready .stage-group-label { color: var(--secondary); }
.g--Doing .stage-group-label { color: var(--accent-deep); }
.g--Done .stage-group-label  { color: var(--graphite); }

.leash-row {
  position: relative;
  display: flex;
  align-items: stretch;
  background: var(--card);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1.5px var(--ring), 0 2px 6px rgba(58, 53, 46, 0.06);
  overflow: hidden;
}
.leash-row::before {
  /* narrow left stage edge */
  content: "";
  width: 6px;
  flex: none;
  background: var(--secondary);
}
.leash-row[data-stage="Doing"]::before { background: var(--accent); }
.leash-row[data-stage="Done"]::before  { background: var(--graphite); }

.ring-notch {
  flex: none;
  align-self: center;
  width: 14px;
  height: 14px;
  margin: 0 8px 0 12px;
  border-radius: 50%;
  border: 3px solid var(--secondary);
}
.leash-row[data-stage="Doing"] .ring-notch { border-color: var(--accent); }
.leash-row[data-stage="Done"] .ring-notch  { border-color: var(--graphite); }

.leash-main {
  flex: 1;
  min-width: 0;
  display: block;
  text-align: left;
  padding: 12px 0;
}
.leash-name {
  display: block;
  margin: 0;
  font-weight: 700;
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leash-meta {
  display: block;
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leash-word {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 6px;
}
.leash-word--Ready { background: rgba(61, 107, 90, 0.14); color: var(--secondary-deep); }
.leash-word--Doing { background: rgba(233, 120, 91, 0.16); color: var(--accent-deep); }
.leash-word--Done  { background: rgba(74, 74, 72, 0.12); color: var(--graphite); }

.leash-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 6px;
}
.leash-btn {
  width: 38px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.leash-btn:active { background: var(--primary-deep); }
.leash-btn--cycle { color: var(--secondary-deep); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.3px; padding: 0 8px; width: auto; min-width: 44px; }

/* ---------- collar-card form ---------- */
.collar-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1.5px var(--ring), 0 4px 14px rgba(58, 53, 46, 0.08);
  padding: 18px 16px 16px;
  position: relative;
}
.collar-card::before {
  /* collar band */
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: repeating-linear-gradient(90deg, var(--accent) 0 14px, var(--secondary) 14px 28px);
}

.field { margin-top: 16px; }
.field:first-of-type { margin-top: 12px; }
.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--secondary-deep);
  margin-bottom: 6px;
}
.field-label .req { color: var(--accent-deep); }
.field-label .opt { color: var(--ink-soft); text-transform: none; letter-spacing: 0; font-weight: 600; }

.field-input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--ring);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  appearance: none;
}
.field-input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(61, 107, 90, 0.14);
}
.field-input--area { resize: vertical; min-height: 74px; }
.field-input::placeholder { color: #b3a894; }

.field-err {
  margin: 6px 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-deep);
}

.stage-picker { display: flex; gap: 8px; }
.stage-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 4px;
  border-radius: 12px;
  border: 1.5px solid var(--ring);
  background: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-soft);
  transition: all 0.12s ease;
}
.stage-btn[aria-checked="true"] {
  color: #fff;
  border-color: transparent;
}
.stage-btn--ready[aria-checked="true"] { background: var(--secondary); }
.stage-btn--doing[aria-checked="true"] { background: var(--accent); }
.stage-btn--done[aria-checked="true"]  { background: var(--graphite); }
.stage-btn[aria-checked="true"] .dot { border-color: #fff; background: transparent; }

.save-btn {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  border-radius: 14px;
  background: var(--secondary);
  color: #f7efe2;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 10px rgba(61, 107, 90, 0.28);
}
.save-btn:active { background: var(--secondary-deep); }

.ghost-btn {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  color: var(--ink-soft);
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--ring);
}

/* ---------- paw search ---------- */
.paw-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.paw-search-input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--ring);
  border-radius: 999px;
  padding: 13px 44px 13px 46px;
  outline: none;
  appearance: none;
}
.paw-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233, 120, 91, 0.16);
}
.paw-search-input::placeholder { color: #b3a894; }
.paw-search-input::-webkit-search-cancel-button { display: none; }

.paw-search-mark {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  pointer-events: none;
  background: var(--secondary);
  border-radius: 50% 50% 55% 55%;
  opacity: 0.85;
}
.paw-search-mark::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 1px;
  width: 6px;
  height: 7px;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 11px 0 0 var(--secondary);
}

.paw-search-clear {
  position: absolute;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.15rem;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
}
.paw-search-clear:active { background: var(--primary-deep); }

/* ---------- empty states ---------- */
.empty {
  display: block;
  text-align: center;
  padding: 30px 20px 10px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.empty-bowl {
  display: block;
  width: 74px;
  height: 74px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 3px solid rgba(61, 107, 90, 0.18);
  position: relative;
}
.empty-bowl::before {
  /* faint paw above the bowl ring */
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 14px;
  height: 15px;
  transform: translateX(-50%);
  border-radius: 50% 50% 55% 55%;
  background: rgba(233, 120, 91, 0.35);
}
.empty-bowl::after {
  content: "";
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 6px;
  border-radius: 50%;
  background: rgba(233, 120, 91, 0.35);
  box-shadow: -8px 6px 0 rgba(233, 120, 91, 0.35), 8px 6px 0 rgba(233, 120, 91, 0.35);
}
.empty--hint { padding-top: 20px; }

/* ---------- bottom tab bar ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--primary-deep);
  border-top: 1.5px solid var(--ring);
  box-shadow: 0 -4px 14px rgba(58, 53, 46, 0.08);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-soft);
}
.tab-word {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.tab-paw {
  position: relative;
  width: 22px;
  height: 20px;
  border-radius: 50% 50% 48% 48%;
  background: currentColor;
  opacity: 0.75;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.tab-paw::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 2px;
  width: 6px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 7px 0 0 currentColor, -5px -2px 0 currentColor, 13px -2px 0 currentColor;
}
.tab--active {
  color: var(--secondary-deep);
}
.tab--active .tab-paw {
  opacity: 1;
  transform: translateY(2px) scale(0.94);
  /* the active paw presses in with a short soft shadow */
  filter: drop-shadow(0 3px 2px rgba(58, 53, 46, 0.35));
}
.tab--active .tab-word { font-weight: 800; }

/* ---------- delete confirm ---------- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(58, 53, 46, 0.45);
  display: grid;
  place-items: center;
  padding: 24px;
}
.confirm {
  width: 100%;
  max-width: 320px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 18px 16px;
  box-shadow: 0 10px 30px rgba(44, 82, 69, 0.35);
}
.confirm-title {
  margin: 0 0 6px;
  font-size: 1.1rem;
  color: var(--secondary-deep);
}
.confirm-text {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.confirm-row { display: flex; gap: 10px; }
.confirm-btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-weight: 800;
}
.confirm-btn--quiet { box-shadow: inset 0 0 0 1.5px var(--ring); color: var(--ink-soft); }
.confirm-btn--loud { background: var(--accent); color: #fff; }
.confirm-btn--loud:active { background: var(--accent-deep); }
