/* ============================================================
   Spoonproof — Recipe Lab Test-Card Pinboard
   warm flour screen · paprika accents · cream index cards
   ============================================================ */

:root {
  --flour: #f6ebdd;      /* screen background */
  --card: #fffaf1;       /* index-card surface */
  --card-line: #e7d8c3;  /* ruled card line */
  --paprika: #d95d39;
  --paprika-deep: #b8462a;
  --sage: #2f6b5e;
  --honey: #e0a458;
  --ink: #3a2e28;
  --ink-soft: #7a6a5d;
  --pin-red: #c23b22;
  --shadow: 0 3px 10px rgba(58, 46, 40, .14);
  --shadow-lift: 0 5px 14px rgba(58, 46, 40, .2);
  --radius: 18px;
  --tabbar-h: 74px;
}

* { box-sizing: border-box; }

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

body {
  background: var(--flour);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(224, 164, 88, .1) 0, transparent 34%),
    radial-gradient(circle at 88% 92%, rgba(47, 107, 94, .08) 0, transparent 38%);
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", Verdana, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}

button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: var(--ink); }

/* ---------- top bar: pinned note strip ---------- */
.topbar {
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 22px 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-pin {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--pin-red);
  box-shadow: inset -2px -2px 0 rgba(0,0,0,.22), 0 2px 4px rgba(58,46,40,.3);
  flex: none;
}
.topbar-text h1 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: .02em;
}
.topbar-sub {
  margin: 0;
  font-size: .74rem;
  color: var(--ink-soft);
  letter-spacing: .12em;
  text-transform: uppercase;
}

main {
  padding: 8px 22px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 22px);
  max-width: 520px;
  margin: 0 auto;
}
.view { animation: rise .22s ease-out; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- shared index-card surfaces ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(58, 46, 40, .06);
  padding: 16px;
}
.section-label {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 20px 2px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--card-line);
}

/* dots — filled/hollow, never check marks */
.dot {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 50%;
  flex: none;
}
.dot.filled { background: var(--paprika); box-shadow: inset -1px -2px 0 rgba(0,0,0,.15); }
.dot.hollow { background: transparent; border: 2px solid var(--ink-soft); }

/* buttons */
.btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  font-weight: 700;
  font-size: .95rem;
  transition: transform .08s ease, box-shadow .12s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--sage);
  color: #fdf8ef;
  box-shadow: var(--shadow);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--card-line);
}
.btn-danger {
  background: transparent;
  color: var(--paprika-deep);
  border: 1.5px solid rgba(217, 93, 57, .45);
  padding: 9px 14px;
  font-size: .85rem;
}
.btn-danger.arm { background: var(--paprika-deep); color: #fff; border-color: var(--paprika-deep); }

/* ---------- Bench ---------- */
.counters {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}
.counter {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
}
.counter.untried { background: var(--card); box-shadow: var(--shadow); }
.counter.tried   { background: var(--sage); color: #f3eee3; }

.mini-spoon { position: relative; width: 30px; height: 40px; flex: none; }
.mini-spoon .mbowl {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 18px; height: 20px;
  border-radius: 50% 50% 46% 46%;
  background: currentColor;
}
.mini-spoon .mhandle {
  position: absolute; top: 17px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 22px;
  border-radius: 4px;
  background: currentColor;
}
.counter.untried .mini-spoon { color: var(--paprika); }
.counter.tried .mini-spoon { color: #f3eee3; }
.counter-num {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
}
.counter-word {
  display: block;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .8;
}

.add-strip {
  display: block;
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-radius: 16px;
  background: var(--paprika);
  color: #fff7ef;
  padding: 17px 20px;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-align: left;
  position: relative;
  box-shadow: 0 4px 12px rgba(217, 93, 57, .35);
}
.add-strip .plus {
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 400;
}

.pinned-card {
  position: relative;
  margin-top: 20px;
  padding: 22px 18px 18px;
  background: var(--card);
  border-radius: 6px 22px 22px 22px;
  box-shadow: var(--shadow-lift);
  transform: rotate(-.6deg);
}
.pinned-card::before {
  content: "";
  position: absolute;
  top: -9px; left: 50%;
  transform: translateX(-50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--pin-red);
  box-shadow: inset -2px -2px 0 rgba(0,0,0,.25), 0 3px 5px rgba(58,46,40,.35);
}
.pinned-tag {
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--paprika-deep);
  font-weight: 800;
}
.pinned-dish {
  margin: 8px 0 2px;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
}
.pinned-var {
  margin: 0 0 4px;
  color: var(--sage);
  font-weight: 600;
}
.pinned-note {
  margin: 8px 0 0;
  font-size: .9rem;
  color: var(--ink-soft);
  font-style: italic;
}
.pinned-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.pinned-actions .btn { flex: 1; padding: 11px 10px; font-size: .88rem; }

/* ---------- empty state: mixing bowl ---------- */
.empty {
  text-align: center;
  padding: 30px 12px 12px;
}
.bowl-art {
  position: relative;
  width: 110px; height: 88px;
  margin: 0 auto 6px;
}
.bowl-body {
  position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 96px; height: 56px;
  background: var(--sage);
  border-radius: 8px 8px 48px 48px;
}
.bowl-rim {
  position: absolute;
  bottom: 44px; left: 50%; transform: translateX(-50%);
  width: 104px; height: 26px;
  background: #3e7d6e;
  border-radius: 50%;
}
.bowl-rim::after {
  content: "";
  position: absolute;
  inset: 5px 10px;
  border-radius: 50%;
  background: #f8f2e6;
}
.bowl-spoon {
  position: absolute;
  top: -8px; left: 6px;
  width: 66px;
  height: 10px;
  transform: rotate(-24deg);
  transform-origin: right center;
}
.bowl-spoon::before { /* spoon handle */
  content: "";
  position: absolute;
  left: 0; top: 2px;
  width: 44px; height: 6px;
  border-radius: 4px;
  background: #a9754f;
}
.bowl-spoon::after { /* spoon bowl over the rim */
  content: "";
  position: absolute;
  right: -2px; top: -3px;
  width: 18px; height: 15px;
  border-radius: 50%;
  background: #a9754f;
}
.bowl-dot {
  position: absolute;
  top: 34px; left: 30px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--paprika);
}
.empty-title { font-weight: 800; margin: 10px 0 4px; }
.empty-sub { color: var(--ink-soft); font-size: .9rem; margin: 0 0 16px; }

/* ---------- Trials: grouped index-card strips ---------- */
.group-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 20px 4px 8px;
}
.group-head:first-child { margin-top: 12px; }
.group-name {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
}
.group-count {
  font-size: .72rem;
  color: var(--ink-soft);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.strip {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 10px;
}
.strip + .strip { margin-top: 0; }
.row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 13px 14px;
  text-align: left;
}
.row .edge {
  align-self: stretch;
  width: 5px;
  border-radius: 3px;
  flex: none;
  margin-left: -14px;
}
.edge-paprika { background: var(--paprika); }
.edge-sage    { background: var(--sage); }
.edge-honey   { background: var(--honey); }
.edge-ink     { background: var(--ink); }
.row-main { flex: 1; min-width: 0; }
.row-var {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-meta {
  font-size: .76rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.row-state {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  flex: none;
}
.row-state.tried { color: var(--sage); }

.detail {
  border-top: 1px dashed var(--card-line);
  padding: 14px 16px 16px;
  animation: rise .18s ease-out;
}
.detail-note {
  font-size: .92rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 12px;
}
.detail-note.muted::before { content: "no result note yet"; opacity: .6; }
.detail-actions { display: flex; gap: 8px; }
.detail-actions .btn {
  flex: 1;
  padding: 10px 8px;
  font-size: .84rem;
  border-radius: 12px;
}
.btn-toggle-tried { background: var(--sage); color: #fdf8ef; }
.btn-toggle-untried { background: transparent; border: 1.5px solid var(--sage); color: var(--sage); }
.btn-edit { background: var(--honey); color: #4a3208; }
.btn-del { background: transparent; border: 1.5px solid rgba(217,93,57,.45); color: var(--paprika-deep); }
.btn-del.arm { background: var(--paprika-deep); color: #fff; border-color: var(--paprika-deep); }

/* ---------- Record form ---------- */
.record-title { margin: 14px 2px 2px; font-size: 1.3rem; }
.record-hint { margin: 0 2px 16px; color: var(--ink-soft); font-size: .9rem; }
.field { margin-bottom: 16px; }
.field label, .field-label {
  display: block;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.req { color: var(--paprika); }
.opt {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: .7;
}
.field input, .field textarea {
  width: 100%;
  border: 1.5px solid var(--card-line);
  background: #fffdf8;
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(47, 107, 94, .15);
}
.field.error input { border-color: var(--paprika); background: #fdf1ec; }
.field-error {
  color: var(--paprika-deep);
  font-size: .8rem;
  font-weight: 700;
  margin: 6px 2px 0;
}
.seg {
  display: flex;
  background: #efe3d0;
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}
.seg-btn {
  flex: 1;
  border: 0;
  border-radius: 11px;
  background: transparent;
  padding: 11px 8px;
  font-weight: 700;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.seg-btn[aria-pressed="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.record-actions { display: flex; gap: 10px; margin-top: 22px; }
.record-actions .btn-primary { flex: 1.4; }
.record-actions .btn-ghost { flex: 1; }
.form-msg { text-align: center; font-size: .85rem; color: var(--sage); font-weight: 700; }

/* ---------- Find ---------- */
.find-search {
  margin: 14px 0 6px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(var(--flour) 78%, transparent);
  padding: 6px 0 12px;
}
.find-label {
  display: block;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 800;
  margin: 0 2px 6px;
}
#find-input {
  width: 100%;
  border: 1.5px solid var(--card-line);
  background: var(--card);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 1.02rem;
  outline: none;
  box-shadow: var(--shadow);
}
#find-input:focus { border-color: var(--paprika); }
.find-count {
  font-size: .78rem;
  color: var(--ink-soft);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 4px 4px 10px;
}
.find-results .strip { margin-bottom: 8px; }

/* about / settings panel */
.about-card {
  margin-top: 28px;
  background: var(--card);
  border-radius: 6px 20px 20px 20px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.about-card h3 {
  margin: 0 0 8px;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sage);
}
.about-card p { font-size: .9rem; color: var(--ink-soft); margin: 0 0 14px; }
.about-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.about-count { font-size: .8rem; color: var(--ink-soft); font-weight: 700; }

/* ---------- bottom tab bar with wooden spoons ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 6px 8px env(safe-area-inset-bottom, 0px);
  background: linear-gradient(#5a4634, #4a3827);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 20;
  box-shadow: 0 -4px 14px rgba(58, 46, 40, .25);
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: #cbb99f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}
.tab-label {
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
}
.spoon {
  position: relative;
  width: 34px; height: 42px;
  display: block;
  color: #cbb99f;
  transition: transform .18s ease;
}
.spoon .bowl {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 20px; height: 23px;
  border-radius: 50% 50% 46% 46%;
  background: currentColor;
}
.spoon .handle {
  position: absolute; top: 19px; left: 50%; transform: translateX(-50%);
  width: 7px; height: 21px;
  border-radius: 4px;
  background: currentColor;
}
.tab.is-active { color: var(--honey); }
.tab.is-active .spoon {
  transform: rotate(-32deg) translateY(-3px);
}
.tab.is-active .spoon::after { /* short shadow under the angled spoon */
  content: "";
  position: absolute;
  bottom: -4px; left: 50%;
  transform: translateX(-50%) rotate(32deg);
  width: 26px; height: 5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .35);
}

/* small screens */
@media (max-width: 350px) {
  main { padding-left: 14px; padding-right: 14px; }
  .pinned-dish { font-size: 1.2rem; }
}
