/* Pegora — Porch Pegboard Queue theme. Cream single-column, peg-tag slips, house-key tabs. */

:root {
  --paper: #f7f0df;
  --card: #fffcf3;
  --ink: #33302a;
  --muted: #8a8374;
  --line: #e3dac4;
  --teal: #2f6f6b;
  --peach: #f4a261;
  --mustard: #f2c14e;
  --sage: #8aa87f;
  --coral: #e76f51;
  --coral-dark: #c95a3e;
  --wood: #d9b98c;
  --wood-dark: #b7966a;
}

* { box-sizing: border-box; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- masthead ---------- */

.masthead {
  text-align: center;
  padding: 18px 16px 10px;
}

.masthead h1 {
  margin: 4px 0 2px;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--teal);
}

.tagline {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.lamp-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mustard);
  border: 2px solid var(--teal);
  vertical-align: middle;
}

/* ---------- layout ---------- */

#screens {
  max-width: 480px;
  margin: 0 auto;
  padding: 6px 16px calc(104px + env(safe-area-inset-bottom, 0px));
}

.screen[hidden] { display: none; }

.section-label {
  margin: 20px 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* ---------- peg-tag slips ---------- */

.slip {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: inset 7px 0 0 var(--strip, var(--teal)), 0 1px 2px rgba(51, 48, 42, 0.06);
  padding: 24px 12px 12px 16px;
  margin-bottom: 12px;
}

.slip[role="button"] { cursor: pointer; }
.slip[role="button"]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.hole {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--wood-dark);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.15);
}

.slip-body {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.slip-text { flex: 1; min-width: 0; }

.slip-text p { margin: 0; }

.service {
  font-weight: 700;
  font-size: 15px;
}

.neighbor {
  font-size: 13px;
  color: var(--muted);
}

.when {
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  margin-top: 2px !important;
}

.note {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px !important;
}

.disc {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--strip, var(--teal));
  color: var(--strip, var(--teal));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  overflow: hidden;
  white-space: nowrap;
  margin-top: 2px;
}

.disc.empty {
  border: 2px dashed var(--line);
  color: transparent;
}

.disc.empty::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}

.row-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.act {
  min-height: 44px;
  min-width: 56px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  border: 1.5px solid var(--teal);
  background: #fff;
  color: var(--teal);
}

.act.danger {
  border-color: var(--coral);
  color: var(--coral);
}

.act:active { transform: translateY(1px); }

/* ---------- hanging tag + rail (Porch Board) ---------- */

.hang { text-align: center; }

.nail {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wood-dark);
  margin: 4px auto 0;
}

.string {
  display: block;
  width: 2px;
  height: 24px;
  background: var(--wood-dark);
  margin: 0 auto;
}

.hang-label {
  margin: 4px 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.hang .slip {
  transform: rotate(-1.5deg);
  max-width: 320px;
  margin: 0 auto 12px;
}

.rail-wrap {
  text-align: center;
  margin: 20px 0 18px;
}

.rail {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(var(--wood), var(--wood-dark));
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 12px;
  max-width: 320px;
  margin: 0 auto;
}

.rail span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.25);
}

.pill {
  position: relative;
  display: inline-block;
  margin-top: -9px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--teal);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.post-strip {
  display: block;
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 12px;
  background: var(--coral);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 0 var(--coral-dark);
  margin: 4px 0 6px;
}

.post-strip:active { transform: translateY(1px); box-shadow: none; }

/* ---------- errands groups ---------- */

.group { margin-bottom: 18px; }

.group-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--teal);
}

.group-count {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

/* ---------- post clipboard ---------- */

.clipboard {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 16px 16px;
  margin-top: 10px;
}

.clipboard::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 18px;
  border-radius: 9px;
  background: var(--wood);
  border: 1px solid var(--wood-dark);
}

.clipboard h2 {
  margin: 0 0 2px;
  font-size: 18px;
  color: var(--teal);
}

.clipboard-sub {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--muted);
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
}

.req { color: var(--coral); }
.opt { font-weight: 400; color: var(--muted); }

.field input,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font-size: 16px; /* prevents iOS zoom on focus */
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

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

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 111, 107, 0.15);
}

.field input.invalid {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(231, 111, 81, 0.15);
}

.err {
  margin: 5px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--coral);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  border: 1.5px solid transparent;
  cursor: pointer;
}

.btn:active { transform: translateY(1px); }

.btn.primary {
  flex-basis: 100%;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 2px 0 #23504d;
}

.btn.ghost {
  flex: 1;
  background: transparent;
  border-color: var(--teal);
  color: var(--teal);
}

.btn.danger {
  flex: 1;
  background: #fff;
  border-color: var(--coral);
  color: var(--coral);
}

.btn.ghost-danger {
  flex-basis: auto;
  margin-top: 12px;
}

.status {
  min-height: 1.2em;
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
}

/* ---------- find ---------- */

.search-wrap {
  position: relative;
  margin: 10px 0 14px;
}

.search-wrap input {
  width: 100%;
  min-height: 48px;
  padding: 10px 44px 10px 14px;
  font-size: 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 111, 107, 0.15);
}

#search-clear {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  border-radius: 50%;
}

.hit-count {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.about {
  margin-top: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.about-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--teal);
}

.about p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- empty states ---------- */

.empty {
  text-align: center;
  padding: 26px 12px 18px;
}

.empty-tag {
  display: block;
  width: 56px;
  height: 70px;
  margin: 0 auto 12px;
  background: var(--card);
  border: 1.5px dashed var(--wood-dark);
  border-radius: 10px;
  position: relative;
  transform: rotate(4deg);
}

.empty-tag::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--wood-dark);
}

.empty-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.empty-line {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- bottom tab bar: house-key silhouettes ---------- */

#tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  border: none;
  background: none;
  color: var(--muted);
  padding: 4px 2px;
}

.tab .key {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
  transition: transform 0.15s ease;
}

.tab span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tab.active {
  color: var(--teal);
}

.tab.active .key {
  fill: var(--teal);
  stroke: var(--teal);
  transform: rotate(-8deg);
  filter: drop-shadow(2px 3px 0 rgba(47, 111, 107, 0.25));
}

.tab:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
