/* Levain Master — © 2026 Alexandre da Silva
   SPDX-License-Identifier: LGPL-3.0-or-later */
@font-face {
  font-family: Outfit;
  src: url("vendor/outfit-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #f3efe6;
  --sheet: #fffdfb;
  --ink: #2c241c;
  --muted: #8d7f70;
  --line: #efe6da;
  --line-strong: #e4d8c8;
  --brown: #7d6244;
  --brown-soft: #a68462;
  --green: #2f7a45;
  --green-bg: #e7f3df;
  --sand-bg: #f4ecdf;
  --sand: #7a6244;
  --amber-bg: #f8ecd4;
  --amber: #8a5a20;
  --wet-bg: #f6e0d4;
  --wet: #8a3e28;
  --water: #6e9eb4;
  /* Composição da massa. Validadas com o validador de paleta (dataviz).
     As versões -text são o mesmo matiz escurecido para 4,5:1 no texto. */
  --comp-flour: #b8792e;
  --comp-water: #2f80c0;
  --comp-other: #6e9a35;
  --comp-flour-text: #9e6828;
  --comp-water-text: #2c78b4;
  --comp-other-text: #5a7e2b;
  --shadow: 0 12px 32px rgba(70, 48, 24, 0.06);
  --pico-font-family: Outfit, "Segoe UI", sans-serif;
  --pico-background-color: var(--paper);
  --pico-color: var(--ink);
  --pico-border-radius: 16px;
  --pico-primary: var(--brown);
  --pico-form-element-spacing-vertical: 0.35rem;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(880px 380px at 50% -12%, rgba(196, 154, 106, 0.2), transparent 62%),
    var(--paper);
  color: var(--ink);
  font-family: Outfit, "Segoe UI", sans-serif;
}

button, input, select { font-family: inherit; }

h2 { margin: 0; }

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.app {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 0 8px calc(36px + env(safe-area-inset-bottom));
}

/* Barra do topo fixa: ícone, nome, Receitas e Instalar ficam visíveis ao rolar.
   Ela ocupa a largura toda da coluna (sangra os 8 px do .app) e cobre a área do relógio. */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -8px 8px;
  padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
  background: rgba(243, 239, 230, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(80, 55, 30, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 2px 6px 2px 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  width: auto;
}

.brand img { width: 34px; height: 34px; border-radius: 7px; flex: none; }
.brand { min-width: 0; }
.brand span { text-align: left; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { flex: none; }
.top-actions .install { margin: 0; padding: 7px 14px; }

.storage-warning {
  margin: 4px 0 10px;
  padding: 9px 12px;
  border: 1px solid #dfb7a8;
  border-radius: 12px;
  background: var(--wet-bg);
  color: var(--wet);
  font-size: 0.86rem;
  line-height: 1.35;
}
.storage-inline {
  margin: 8px 0 0;
  color: var(--wet);
  font-size: 0.86rem;
  line-height: 1.35;
}
.brand:hover { background: #f6f1e8; }
.brand:focus-visible { outline: 2px solid var(--brown-soft); outline-offset: 2px; }

.install, .text-btn, .spin, .add-btn, .menu button, .del {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.install {
  border: 1px solid var(--line-strong);
  background: var(--sheet);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.sheet {
  background: var(--sheet);
  border: 1px solid rgba(80, 55, 30, 0.06);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 8px;
}
.screen-name {
  width: 0;
  min-width: 100%;
  max-width: 100%;
  margin: 0 0 10px;
}
.screen-name-display {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.screen-name-display span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.screen-name-display svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--brown-soft); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.screen-name-display:focus-visible { outline: 2px solid var(--brown-soft); outline-offset: 2px; }
.screen-recipe-name {
  display: block;
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  margin: 0 !important;
}

.field-head, .ing-top, .final-head, .total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-head { margin-bottom: 2px; }
.flour-side .field-head { justify-content: flex-start; gap: 8px; }

label.kicker, .kicker, .section-label, .final-head span, .total-row span, .crumb, .part label, .menu small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pill {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

/* A coluna da farinha fica com o espaço que sobrar (em tela larga não abre vão no meio);
   nunca menor que o próprio conteúdo. A da foto vai até 236 px. */
.deck-row {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) minmax(0, 236px);
  column-gap: 22px;
  align-items: center;
}

.flour-side { min-width: 0; }

.crumb-side { min-width: 0; }

.crumb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.crumb-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
  margin: 0;
  background: #f6f1e8;
}

.side-kicker {
  margin: 0 0 2px;
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  line-height: 1.15;
}


.side-hyd {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.side-hyd small {
  margin-left: 1px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 650;
}

.side-feel, .side-bread {
  margin: 2px 0 0;
  font-size: 0.78rem;
  line-height: 1.25;
}

.side-feel { color: var(--muted); }

/* Textura e pão reservam 2 linhas cada: quando o texto quebra, a foto não se mexe. */
.side-feel, .side-bread {
  min-height: calc(2 * 1.25em);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.side-feel[data-feel="firme"] { color: var(--sand); }
.side-feel[data-feel="macia"] { color: var(--green); }
.side-feel[data-feel="pegajosa"] { color: var(--amber); }
.side-feel[data-feel="umida"] { color: var(--wet); }

.side-bread {
  color: var(--ink);
  font-weight: 640;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


.mega {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0;
}

.mega input {
  flex: 0 0 auto;
  width: calc((var(--flour-ch, 3) * 1ch) + 0.15ch) !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: auto !important;
  min-width: 0;
  font-size: 2.7rem;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
  color: var(--ink);
}

.unit { color: var(--muted); font-size: 1rem; font-weight: 600; }

.spins { display: flex; flex-direction: column; }

.spin {
  width: 34px;
  height: 22px;
  padding: 0;
  margin: 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1;
}

.spin:hover, .del:hover, .menu button:hover { background: #f6f1e8; }

.hyd-head { margin-top: 10px; }

.hyd-num {
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1;
}

.hyd-num small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.slider input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, #c8b59a 0%, #8ea36a 40%, #d0a15c 70%, #b65c3c 100%);
}

.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -10px;
  border-radius: 50%;
  background: #fffdfb;
  border: 3px solid #7d6244;
  box-shadow: 0 2px 6px rgba(60, 40, 20, 0.18);
}

.slider input[type="range"]::-moz-range-track {
  height: 6px;
  border: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #c8b59a 0%, #8ea36a 40%, #d0a15c 70%, #b65c3c 100%);
}

.slider input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fffdfb;
  border: 3px solid #7d6244;
}

.slider-labels {
  position: relative;
  height: 1.1rem;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
}

/* Atalhos: centrados sobre a posição do valor no trilho (o polegar tem 26 px) */
.slider-labels button {
  position: absolute;
  left: calc(13px + (100% - 26px) * var(--f));
  transform: translateX(-50%);
  margin: 0;
  padding: 2px 4px;
  width: auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
}
.slider-labels button:hover { color: var(--ink); background: #f6f1e8; }
.slider-labels button.on { color: var(--ink); font-weight: 700; }

.feel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.92rem;
}

.feel-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 620;
  font-size: 0.86rem;
}

.feel[data-feel="firme"] .feel-badge { background: var(--sand-bg); color: var(--sand); }
.feel[data-feel="macia"] .feel-badge { background: var(--green-bg); color: var(--green); }
.feel[data-feel="pegajosa"] .feel-badge { background: var(--amber-bg); color: var(--amber); }
.feel[data-feel="umida"] .feel-badge { background: var(--wet-bg); color: var(--wet); }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.feel-bread { color: var(--ink); font-weight: 560; }

.feel-note, .hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 450;
}

.section-label {
  text-align: center;
  margin: 0 0 10px;
}

.ing-block + .ing-block { margin-top: 8px; }

.ing {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f6f1e8;
  color: var(--brown);
  display: grid;
  place-items: center;
}

.icon--liquid {
  background: radial-gradient(ellipse at 50% 48%, #fff 38%, #d9f0f8 100%);
  box-shadow: 0 0 0 1px rgba(62, 151, 190, 0.34), 0 0 10px 1px rgba(62, 151, 190, 0.2);
}

.icon--solid {
  background: radial-gradient(ellipse at 50% 48%, #fff 38%, #e5e8eb 100%);
  box-shadow: 0 0 0 1px rgba(112, 124, 136, 0.3), 0 0 10px 1px rgba(112, 124, 136, 0.17);
}

.icon--intermediate {
  background: radial-gradient(ellipse at 50% 48%, #fff 38%, #e9def3 100%);
  box-shadow: 0 0 0 1px rgba(139, 103, 175, 0.32), 0 0 10px 1px rgba(139, 103, 175, 0.19);
}

.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.ing-name, .ferment-select, .liquid-select, .name-input {
  font-size: 0.98rem;
  font-weight: 620;
}

.ferment-select, .liquid-select, .ratio-select, .pct input, .part input, .name-input, .water-edit input, .sim-gram {
  border: 1px solid var(--line-strong) !important;
  background: #fff !important;
  box-shadow: none !important;
  margin: 0 !important;
  border-radius: 10px !important;
  color: var(--ink);
}

.ferment-select, .liquid-select {
  width: auto;
  max-width: 100%;
  padding: 4px 28px 4px 8px !important;
  height: auto !important;
  font-weight: 620;
}

.pct {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.pct input, .part input, .water-edit input {
  width: 72px;
  padding: 6px 8px !important;
  height: auto !important;
  font-weight: 650;
}

.pct span { color: var(--muted); font-size: 0.85rem; }

.bar {
  height: 3px;
  margin-top: 8px;
  border-radius: 99px;
  background: #f0e8dc;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--brown-soft);
  border-radius: inherit;
}

.moisture {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.grams {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.grams small { color: var(--muted); font-size: 0.85rem; font-weight: 600; margin-left: 2px; }

.del {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border-radius: 10px;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
}

.icon-order {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.move-ing {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 26px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.move-ing:hover:not(:disabled) { background: #f6f1e8; color: var(--brown); }
.move-ing:disabled { cursor: default; opacity: 0.3; }
.move-ing:focus-visible { outline: 2px solid var(--brown-soft); outline-offset: 1px; }
.move-ing svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.levain {
  margin-top: 8px;
  padding: 14px;
  border-radius: 14px;
  background: #faf6f0;
  border: 1px solid var(--line);
}

.levain h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 670;
}

.levain-grams {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 680;
  letter-spacing: -0.03em;
}

.levain-grams small { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.levain-grams { display: flex; align-items: center; gap: 8px; }
.levain-grams-main { display: flex; align-items: baseline; gap: 2px; min-width: 0; flex: 1 1 auto; }
.levain-grams-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.temp-open {
  margin: 0 0 0 auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  height: 34px;
  padding: 0 8px 0 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--brown);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  cursor: pointer;
}
.temp-open svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.levain-grams .grams-input {
  width: 5.2ch;
  padding: 0 6px !important;
  height: auto !important;
  margin: 0 !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: none !important;
  font-size: 1.35rem;
  font-weight: 680;
  letter-spacing: -0.03em;
  text-align: right;
}

.ratio-select { width: 100%; margin-bottom: 12px !important; padding: 8px 10px !important; height: auto !important; }

/* Proporção ao lado das partes; gramas e hidratação na linha de baixo */
.parts {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
  align-items: end;
  margin-bottom: 10px;
}

.parts .part input { width: 100%; text-align: center; }
.parts .ratio-select { margin: 0 !important; padding: 6px 24px 6px 8px !important; background-position: right 6px center !important; }

.part { display: flex; flex-direction: column; gap: 4px; }
.part label { letter-spacing: 0.08em; white-space: nowrap; }
.colon { color: var(--muted); padding-bottom: 8px; font-weight: 700; }

.split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.25fr);
  gap: 6px;
  margin: 0 0 12px;
}

.split div {
  background: #fff;
  border-radius: 10px;
  padding: 5px 8px;
  border: 1px solid var(--line);
}

.split dt { margin: 0; color: var(--muted); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.split dd { margin: 1px 0 0; font-size: 0.95rem; font-weight: 680; white-space: nowrap; }
.split .split-hyd { grid-column: 4; background: var(--sand-bg); border-color: var(--line-strong); }
.split .split-hyd dd { font-size: 1.05rem; }
.split .sim-gram {
  width: 100%;
  padding: 2px 4px !important;
  height: auto !important;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 680;
}

.add-wrap { position: relative; margin-top: 12px; }

.add-btn {
  width: 100%;
  border: 1px dashed #e0d3c2 !important;
  border-radius: 10px;
  padding: 12px;
  color: var(--brown);
  font-weight: 650;
  background: transparent;
}

.notes-wrap { margin-top: 8px; }
.notes-toggle { color: var(--brown); }
.notes-editor { display: grid; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 0.72rem; font-weight: 650; }
.notes-editor textarea { min-height: 8rem; resize: vertical; white-space: pre-wrap; font-family: monospace; font-size: 0.82rem; }
.file-input-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.recipe-import-row { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 12px 0 0; }
.recipe-import-row.two { grid-template-columns: 1fr 1fr; }
.recipe-import-row .install { margin: 0; }
.import-status { margin: 8px 0 0; color: var(--muted); font-size: 0.82rem; }
.share-dialog article { width: min(760px, calc(100vw - 28px)); }
.share-preview-image { display: block; width: min(100%, 540px); max-height: 58vh; margin: 12px auto; object-fit: contain; border-radius: 12px; background: var(--sand-bg); }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.share-actions button { width: 100%; margin: 0; }
@media (max-width: 420px) { .share-actions { grid-template-columns: 1fr; } }

.menu {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 6px;
  max-height: min(420px, 62vh);
  overflow: auto;
}

.menu-label {
  margin: 8px 10px 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.menu button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  border-radius: 10px;
  padding: 10px;
  font-weight: 600;
}

.menu small { letter-spacing: 0.04em; }

.crumb-photo {
  display: block;
  width: 100%;
  height: 230px;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 12px;
  background: #f6f1e8;
}

.crumb { margin: 0 0 14px; letter-spacing: 0.04em; }

.final-num {
  margin: 0;
  font-size: 3rem;
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.ideal { margin: 8px 0 0; font-size: 0.95rem; }

.bits { list-style: none; margin: 14px 0 0; padding: 0; }
.bits li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}

.total-row {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
}

.total-num {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}


.water-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}

.name-input { width: 100%; padding: 6px 8px !important; height: auto !important; }

@media (max-width: 380px) {
  .deck-row { column-gap: 16px; }
  .mega input { font-size: 2.35rem; }
  .final-num { font-size: 2.5rem; }
  .split div { padding: 5px 6px; }
  .split dt { font-size: 0.6rem; letter-spacing: 0.02em; }
  .part label { letter-spacing: 0.03em; }
}

/* Percentual e gramas do ingrediente: texto que vira campo ao clicar */
.pct-value, .grams-value {
  border: 0;
  border-bottom: 1px dashed var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  padding: 0 2px;
  margin: 0;
  width: auto;
  cursor: text;
}

.pct-value { font-weight: 650; }

.pct-value:hover, .grams-value:hover { border-bottom-color: var(--brown-soft); }

.grams-value:disabled { cursor: default; border-bottom-color: transparent; opacity: 1; }

.pct-value:focus-visible, .grams-value:focus-visible {
  outline: 2px solid var(--brown-soft);
  outline-offset: 2px;
  border-radius: 4px;
}

.grams { display: flex; align-items: baseline; }

.grams .grams-input {
  width: 6.2ch;
  padding: 2px 6px !important;
  height: auto !important;
  margin: 0 !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-align: right;
}

/* Levain: lápis e resumo na linha do fermento, ativação no modal */
.ferment-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ferment-wrap .ferment-select, .ferment-wrap .liquid-select { min-width: 0; flex: 0 1 auto; }
.ferment-wrap .ferment-select.is-levain { width: 6.6em; }
.ferment-wrap .grams-col { display: flex; flex-direction: column; align-items: flex-end; }
.ing-note-btn {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0 0 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--line-strong);
  cursor: pointer;
}
.ing-note-btn.filled { color: var(--brown); }
.ing-note-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ing-note { margin: 6px 0 0; color: var(--brown); font-size: 0.8rem; overflow-wrap: anywhere; }
.ing-note-input { width: 100%; margin: 6px 0 0; padding: 6px 10px; font-size: 0.85rem; }

.levain-info { flex: none; }

.edit-levain {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--brown);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.edit-levain:hover { background: #f6f1e8; }

.edit-levain svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.levain-info {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 620;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.pct .levain-info { margin-left: 8px; }

.levain-dialog {
  padding: 16px;
  border: 0;
  background: transparent;
  max-width: none;
  max-height: none;
  align-items: flex-start; /* todos abrem a partir do topo, curtos ou longos */
}

.levain-dialog::backdrop { background: rgba(44, 36, 28, 0.42); }

.levain-dialog > .levain {
  width: min(528px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  margin: 0;
  padding: 16px;
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.levain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 4px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.levain-head h2 { margin: 0; }

.levain-dialog > .levain:focus { outline: none; }

.levain-done {
  width: 100%;
  margin-top: 14px;
  border: 0;
  border-radius: 12px;
  padding: 12px;
  background: var(--brown);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
}

/* Composição da massa: barra empilhada logo abaixo dos gramas de farinha */
.flour-side { min-width: 150px; }

.comp-bar {
  display: flex;
  gap: 2px;
  height: 10px;
  margin-top: 8px;
}
.comp-bar span { min-width: 2px; border-radius: 2px; }
.comp-bar span:first-child { border-radius: 4px 2px 2px 4px; }
.comp-bar span:last-child { border-radius: 2px 4px 4px 2px; }
.comp-bar span:only-child { border-radius: 4px; }
.comp-bar .flour { background: var(--comp-flour); }
.comp-bar .water { background: var(--comp-water); }
.comp-bar .other { background: var(--comp-other); }

.comp-legend {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.2;
}
.comp-legend span { display: flex; flex-direction: column; }
.comp-legend b { color: var(--ink); font-size: 0.82rem; font-weight: 680; }
.comp-legend .flour { color: var(--comp-flour-text); }
.comp-legend .water { color: var(--comp-water-text); }
.comp-legend .other { color: var(--comp-other-text); }

/* Peso da massa em destaque, abaixo da barra */
.mass {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  margin: 8px 0 0;
}
.mass b { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.mass span { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.mass .portion-label {
  padding: 2px 5px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--brown);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 620;
  text-align: left;
  cursor: pointer;
}
.mass .portion-label:hover { background: #f6f1e8; }
.mass .portion-label:focus-visible { outline: 2px solid var(--brown-soft); outline-offset: 1px; }
.mass .portion-input {
  width: 4.5ch;
  padding: 2px 5px !important;
  margin: 0 !important;
  height: auto !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 7px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
}

.mass .portion-target {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--brown);
  cursor: pointer;
}
.mass .portion-target svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mass .portion-target:focus-visible { outline: 2px solid var(--brown-soft); outline-offset: 1px; }
.portion-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 4px; }
.portion-fields label { font-size: 0.8rem; font-weight: 620; color: var(--brown); }
.portion-fields input { margin: 4px 0 0; }
.portion-fields ~ .confirm-actions { margin-top: 18px; }

/* Perfil da ativação do levain: textura, pico e sabor */
.profile {
  margin: 14px 0 4px;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

/* Textura fica com o espaço que sobrar; o pico vai para a ponta direita. */
.profile-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin: 0 0 12px;
}
.profile-facts > div:last-child { text-align: right; }

.profile-facts dt { margin: 0; color: var(--muted); font-size: 0.72rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.profile-facts dd { margin: 2px 0 0; font-size: 0.92rem; font-weight: 620; line-height: 1.25; }
.profile-facts dd small { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 500; overflow-wrap: anywhere; max-width: 11rem; }

.flavor-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}

.flavor-scale span {
  height: 8px;
  border-radius: 4px;
  background: #efe6da;
}

.flavor-scale span.on { background: var(--brown); }

.flavor-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.flavor-name { margin: 6px 0 0; font-weight: 650; font-size: 0.95rem; }

.profile-tip { margin-top: 8px; }

/* Receitas salvas */
.top-actions { display: flex; gap: 8px; }
@media (max-width: 430px) {
  .top { gap: 8px; }
  .top-actions { gap: 6px; }
  .top-actions .install { padding: 7px 10px; }
}

.recipes .recipe-save { margin: 10px 0 16px; }
.recipe-save-row { display: flex; gap: 8px; margin-top: 8px; }
.recipe-save-row .name-input { flex: 1 1 auto; width: auto; min-width: 0; }
.recipe-save-row .recipe-save-btn { flex: none; width: auto; margin: 0; padding: 8px 18px; }
.recipe-save-btn:disabled { opacity: 0.45; cursor: default; }

.recipes-label { margin: 0 0 8px; }
.recipe-tabs { display: flex; gap: 8px; margin: 0 0 12px; }
.recipe-tabs .install.on { background: var(--ink); color: #fff; }

.recipe-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.recipe-item {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.recipe-text { min-width: 0; }
.recipe-name { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.recipe-meta { margin: 2px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.3; }
.recipe-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.recipe-actions .install { padding: 6px 12px; box-shadow: none; }
.recipe-del { color: var(--wet); }
.backup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.backup-actions button { margin: 0; }

@media (max-width: 340px) {
  .parts { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); }
  .parts .part-ratio { grid-column: 1 / -1; }
}

/* Sobre */
.about-id { display: flex; align-items: center; gap: 16px; }
.about-id img { width: 128px; height: 128px; border-radius: 16px; flex: none; }
.about-version { margin: 4px 0 0; color: var(--muted); font-size: 1.05rem; font-weight: 600; }
.about-text { margin: 12px 0; font-size: 0.92rem; line-height: 1.4; }
.about-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 8px; }
.about-facts div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.about-facts dt { margin: 0; color: var(--muted); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; }
.about-facts dd { margin: 1px 0 0; font-weight: 650; }
.about .levain-done:disabled { opacity: 0.6; cursor: default; }
.about-cal { margin: 12px 0 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.about-cal h3 { margin: 0 0 6px; }
.about-cal-use { margin: 0 0 8px; font-size: 0.92rem; }
.cal-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.cal-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cal-list label { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; font-weight: 620; }
.cal-list label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-list .install { padding: 4px 10px; box-shadow: none; }
.cal-actions { display: flex; gap: 4px; flex: none; }
.about-cal-add { box-shadow: none; }
.cal-view-facts { display: grid; gap: 6px; margin: 10px 0; }
.cal-view-facts div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.cal-view-facts dt { margin: 0; color: var(--muted); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; }
.cal-view-facts dd { margin: 2px 0 0; font-weight: 620; line-height: 1.35; }
.about-status { margin: 10px 0 0; min-height: 1.3em; font-size: 0.88rem; line-height: 1.35; }
.temp-origin { margin: 8px 0 4px; font-weight: 700; }
.temp-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.temp-shortcuts button {
  width: auto;
  margin: 0;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 650;
  cursor: pointer;
}
.temp-shortcuts button.on { background: var(--brown); color: #fff; border-color: var(--brown); }
.temp-fields, .jar-weights { display: grid; gap: 8px; margin: 8px 0; }
.temp-fields { grid-template-columns: 1fr 1fr; }
.jar-weights { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.temp-fields label, .jar-weights label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.temp-sheet input, .cal-form input { margin-bottom: 0; }
.temp-result { margin: 8px 0 0; font-weight: 700; }
.cal-form fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 12px 0;
  padding: 8px 10px 10px;
  background: #fff;
}
.cal-form legend { font-weight: 700; padding: 0 4px; }
.cal-form .kicker { display: block; margin-top: 8px; }
.hint.bad { color: var(--wet); }
.cal-errors { margin: 8px 0 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.85rem; }
.cal-form .sheet-foot { position: static; }
.cal-guide-open {
  display: block;
  width: 100%;
  margin: 8px 0 0;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--brown);
  font-weight: 650;
  font-size: 0.9rem;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.cal-guide p { margin: 8px 0; font-size: 0.92rem; line-height: 1.45; }
.cal-guide .levain-head h2 { font-size: 1.15rem; line-height: 1.25; min-width: 0; }
.guide-jars { display: grid; gap: 8px; margin: 10px 0; }
.guide-jars > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
}
.guide-jars p { margin: 0; }
.guide-jars .kicker { margin: 0 0 4px; }
.guide-steps { margin: 6px 0 10px; padding-left: 1.2rem; font-size: 0.92rem; line-height: 1.45; }
.guide-steps li { margin: 0 0 8px; }
.guide-steps li:last-child { margin-bottom: 0; }
.cal-form .levain-done:disabled { opacity: 0.45; cursor: default; }
.about-reload { margin-top: 8px; }

/* Modais: cabeçalho e rodapé fixos enquanto o conteúdo rola.
   O padding de cima e de baixo fica no cabeçalho e no rodapé para eles colarem nas bordas. */
.levain-dialog > .levain { padding-top: 0; padding-bottom: 0; }
.levain-dialog > .levain::after { content: ""; display: block; height: 16px; }
.levain-dialog .levain-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 16px !important;
  padding-bottom: 8px !important;
  margin-bottom: 0 !important;
  background: var(--sheet) !important;
}
.sheet-foot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 6px;
  padding: 8px 0 16px;
  background: var(--sheet);
}
.sheet-foot .levain-done { margin-top: 0; }
.levain-dialog > .levain:has(.sheet-foot)::after { display: none; }

/* No celular, o modal ocupa a altura toda da tela, com uma margem de 8 px. */
@media (max-width: 640px) {
  .levain-dialog {
    padding: calc(8px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
  }
  .levain-dialog > .levain {
    width: 100%;
    height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: none;
    display: flex;
    flex-direction: column;
  }
  .levain-dialog .sheet-foot { margin-top: auto; }
}

/* Botão Salvar do card principal e o modal curto que ele abre */
.save-quick {
  margin: 8px 0 0;
  padding: 5px 12px;
  width: auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.save-quick:hover { background: #f6f1e8; }
.save-quick.done { border-color: var(--green); color: var(--green); }

.recipe-card-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.recipe-card-actions .save-quick { margin: 0; }
.share-card,
.clear-recipe {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--sheet);
  color: var(--brown);
  cursor: pointer;
}
.share-card:hover,
.clear-recipe:hover { background: #f6f1e8; }
.share-card:disabled { opacity: 0.55; cursor: progress; }
.share-card svg,
.clear-recipe svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.share-card:focus-visible,
.clear-recipe:focus-visible { outline: 2px solid var(--brown-soft); outline-offset: 2px; }
.share-status { margin: 0; color: var(--muted); font-size: 0.66rem; line-height: 1.25; }
.share-status:empty { display: none; }

.card-preview-img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
  border-radius: 12px;
  background: #fff;
}
.card-preview-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 10px 0 0;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .levain-dialog > .levain.compact { height: auto; }
}

/* Confirmação genérica */
.confirm-dialog { align-items: center; } /* confirmação é curta: fica no meio da tela */
.confirm-dialog > .levain { width: min(420px, 100%); }
.confirm-text { margin: 4px 0 16px; font-size: 0.95rem; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-line; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.confirm-actions button { min-height: 46px; margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 0.95rem; font-weight: 650; }
.confirm-actions .install { box-shadow: none; }
.duplicate-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.duplicate-actions button { min-height: 46px; margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 0.95rem; font-weight: 650; }
.duplicate-actions .install { box-shadow: none; }
.duplicate-actions .duplicate-cancel { grid-column: 1 / -1; box-shadow: none; background: transparent; border: 1px solid var(--line); }
.levain-done.danger { background: var(--wet); }
.confirm-dialog > .levain.compact { height: auto; }

.about-config-box { margin: 12px 0 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.about-config-btn { width: 100%; margin: 0 0 8px; padding: 12px; box-shadow: none; font-size: 0.95rem; }
.about-install { width: 100%; margin: 0 0 8px; padding: 12px; box-shadow: none; font-size: 0.95rem; }

/* Pão típico: nome clicável no card e modal com as faixas */
.bread-pre { color: var(--muted); font-weight: 500; }
.bread-link {
  display: inline;
  margin: 0;
  padding: 0;
  width: auto;
  border: 0;
  border-bottom: 1px dashed var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.bread-link:hover { border-bottom-color: var(--brown-soft); }
.bread-range { margin: 8px 0 4px; font-size: 0.95rem; }
.bread-where { margin: 0 0 8px; font-size: 0.9rem; color: var(--muted); }
.bread-where b { color: var(--ink); }
.bread-text { margin: 8px 0; font-size: 0.92rem; line-height: 1.45; }
.bread-list-label { margin: 14px 0 6px; }
.bread-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; margin: 0; }
.bread-table th { text-align: left; color: var(--muted); font-size: 0.66rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 4px; border-bottom: 1px solid var(--line); background: transparent; }
.bread-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); background: transparent; vertical-align: top; }
.bread-table td:not(:first-child), .bread-table th:not(:first-child) { white-space: nowrap; text-align: right; }
.bread-table tr.on td { background: var(--sand-bg); font-weight: 650; }

/* Sobre: autoria e licença */
.about-credits {
  text-align: left;
  margin: 16px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  background: transparent;
}
.about-credits p { margin: 0 0 4px; }
.about-credits p:first-child { color: var(--ink); font-weight: 650; }
.about-credits a { color: var(--brown); }

.about-id h2 { font-size: 1.4rem; line-height: 1.15; }
.about .levain-head { align-items: flex-start; }
