/* SimmerVerdict — Skillet Dial Focus Strip */

:root {
  --saffron: #f2d06b;
  --teal: #2f6f6b;
  --tomato: #d95d39;
  --ink: #2b2a26;
  --muted: #6f6a5c;
  --paper: #f8efdb;
  --paper-deep: #eadfc0;
  --card: #fdf6e4;
  --line: rgba(43, 42, 38, 0.16);
}

* { box-sizing: border-box; }

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

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

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  box-shadow: 0 0 24px rgba(43, 42, 38, 0.12);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(47, 111, 107, 0.6);
  outline-offset: 2px;
  border-radius: 6px;
}

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

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

.screen {
  padding: 18px 16px calc(118px + env(safe-area-inset-bottom));
}

.screen-title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.screen-sub {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.app-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.quiet {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 10px 2px;
}

.flash {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  background: rgba(47, 111, 107, 0.12);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
}

/* ---------- dots (Keep filled / Retry hollow) ---------- */

.dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--teal);
  background: var(--teal);
  flex: none;
}

.dot.hollow {
  border-color: var(--tomato);
  background: transparent;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex: none;
}

.state.keep { color: var(--teal); }
.state.retry { color: var(--tomato); }

/* ---------- Bench: dial header ---------- */

.bench-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 0 16px;
}

.dial {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, #4a463f, #2b2a26 72%);
  color: var(--saffron);
  box-shadow: inset 0 0 0 4px #232219, 0 4px 10px rgba(43, 42, 38, 0.28);
}

.dial::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    rgba(242, 208, 107, 0.4) 0deg 2deg,
    transparent 2deg 15deg
  );
  -webkit-mask: radial-gradient(circle, transparent 0 57%, #000 58%);
  mask: radial-gradient(circle, transparent 0 57%, #000 58%);
}

.dial-total {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
}

.dial-cap {
  margin-top: 3px;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  opacity: 0.85;
}

.bench-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------- chips ---------- */

.chips {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  min-height: 40px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 0.85rem;
  font-weight: 700;
}

.chip b { font-weight: 800; }

.chip.keep { border-color: rgba(47, 111, 107, 0.5); }
.chip.retry { border-color: rgba(217, 93, 57, 0.5); }

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

.chip.on .dot.filled { border-color: var(--saffron); background: var(--saffron); }
.chip.on .dot.hollow { border-color: var(--saffron); }

/* ---------- saffron add strip ---------- */

.add-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  padding: 15px 16px;
  border: 0;
  border-radius: 16px;
  background: var(--saffron);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 2px 0 rgba(43, 42, 38, 0.22);
  margin-bottom: 20px;
}

.add-strip:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(43, 42, 38, 0.22);
}

.add-sub {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

/* ---------- next-retry slip ---------- */

.slip-label {
  margin: 0 2px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.slip {
  background: var(--card);
  border: 1.5px dashed rgba(217, 93, 57, 0.55);
  border-radius: 14px;
  padding: 16px;
}

.slip-tag { margin-bottom: 8px; }

.slip-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
}

.slip-change {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.slip-change span {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--tomato);
  margin-right: 8px;
}

.slip-taste {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: transparent;
  font-size: 0.95rem;
  font-weight: 700;
}

.btn.primary {
  background: var(--tomato);
  border-color: var(--tomato);
  color: #fff8ec;
}

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

.btn.ghost { border-color: rgba(43, 42, 38, 0.35); }

.btn.danger {
  background: #b23a1c;
  border-color: #b23a1c;
  color: #fff8ec;
}

.btn.small {
  min-height: 38px;
  padding: 7px 12px;
  font-size: 0.8rem;
  border-width: 1.5px;
}

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

.form-actions .btn { flex: 1; }

/* ---------- Runs: measuring-tape rows ---------- */

.rows { margin-top: 4px; }

.group-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 2px 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.group-label:first-child { margin-top: 4px; }

.group-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.row {
  margin: 0 0 8px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
}

.row-main {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 0;
  background: none;
  text-align: left;
}

.row-main:active { background: rgba(43, 42, 38, 0.04); }

.band {
  align-self: stretch;
  width: 6px;
  min-height: 38px;
  border-radius: 3px;
  flex: none;
}

.band.keep { background: var(--teal); }
.band.retry { background: var(--tomato); }

.row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.row-title {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-change {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row::after {
  content: "";
  display: block;
  height: 5px;
  margin: 0 12px 7px 19px;
  background: repeating-linear-gradient(
    90deg,
    rgba(43, 42, 38, 0.22) 0 1px,
    transparent 1px 9px
  );
}

.row.open { border-color: rgba(43, 42, 38, 0.3); }

.row-actions {
  padding: 4px 14px 14px 19px;
  border-top: 1px dashed var(--line);
}

.row-taste {
  margin: 10px 0 2px;
  font-size: 0.88rem;
  font-style: italic;
}

.taste-label {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--teal);
  margin-right: 8px;
}

.row-date {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.72rem;
}

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

/* ---------- Record: recipe-note panel ---------- */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.note-panel {
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0 30px,
      rgba(43, 42, 38, 0.05) 30px 31px
    ),
    var(--card);
}

.field { margin-bottom: 14px; }

.field label,
.field .label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.field input,
.field textarea,
.search input {
  width: 100%;
  padding: 12px 12px;
  font: inherit;
  font-size: 16px; /* prevent iOS zoom-on-focus */
  color: var(--ink);
  background: #fffdf6;
  border: 2px solid rgba(43, 42, 38, 0.25);
  border-radius: 10px;
  appearance: none;
  -webkit-appearance: none;
}

.field textarea {
  resize: vertical;
  line-height: 31px;
  background-image: repeating-linear-gradient(
    180deg,
    transparent 0 30px,
    rgba(43, 42, 38, 0.08) 30px 31px
  );
  background-attachment: local;
}

.field input:focus,
.field textarea:focus,
.search input:focus {
  border-color: var(--teal);
  outline: none;
}

.field input.invalid,
.field textarea.invalid {
  border-color: var(--tomato);
}

.err {
  margin: 6px 2px 0;
  color: var(--tomato);
  font-size: 0.78rem;
  font-weight: 600;
}

.seg {
  display: flex;
  gap: 8px;
}

.seg-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: #fffdf6;
  font-size: 0.95rem;
  font-weight: 700;
}

.seg-btn.keep.on {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff8ec;
}

.seg-btn.retry.on {
  background: var(--tomato);
  border-color: var(--tomato);
  color: #fff8ec;
}

.seg-btn.on .dot.filled { border-color: #fff8ec; background: #fff8ec; }
.seg-btn.on .dot.hollow { border-color: #fff8ec; }

/* ---------- Find ---------- */

.search { margin-bottom: 12px; }

.about {
  margin-top: 22px;
}

.panel-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.about p {
  margin: 0 0 8px;
  font-size: 0.88rem;
}

.confirm {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(217, 93, 57, 0.1);
  border: 1px dashed rgba(217, 93, 57, 0.55);
}

.confirm p {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ---------- empty state: stovetop ring ---------- */

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

.ring {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 4px auto 12px;
  border-radius: 50%;
  border: 2px solid rgba(43, 42, 38, 0.18);
}

.ring i {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(43, 42, 38, 0.14);
}

.ring i:nth-child(1) { inset: 11px; }
.ring i:nth-child(2) { inset: 22px; }
.ring i:nth-child(3) { inset: 33px; border-color: rgba(217, 93, 57, 0.3); }

.empty p {
  margin: 0 auto;
  max-width: 260px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------- bottom tab bar: pot-lid silhouettes ---------- */

#tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 2px;
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: var(--paper-deep);
  border-top: 1px solid var(--line);
}

.tab {
  flex: 1;
  max-width: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px 5px;
  border: 0;
  background: none;
  color: var(--muted);
}

.lid {
  position: relative;
  display: block;
  width: 30px;
  height: 17px;
}

.lid::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 13px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 15px 15px 0 0;
}

.lid::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.tab-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

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

.tab.active .lid {
  transform: translateY(-3px);
  filter: drop-shadow(0 4px 3px rgba(43, 42, 38, 0.3));
}

.tab.active .lid::before {
  background: var(--saffron);
}

.tab.active .tab-label {
  font-weight: 800;
}

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