:root {
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
  color: #203126;
  background: #f7f7f1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
header {
  background: #182a22;
  color: white;
  padding: 22px max(20px, calc((100vw - 1150px) / 2));
}
header h1 {
  margin: 0;
  font-size: 1.65rem;
}
header p {
  margin: 6px 0 0;
  color: #c9dacd;
}
.wrap {
  max-width: 1150px;
  margin: auto;
  padding: 20px;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar input {
  flex: 2;
  min-width: 180px;
}
.toolbar select {
  flex: 1;
  min-width: 130px;
}
input,
select,
textarea {
  border: 1px solid #cbd5cc;
  border-radius: 10px;
  padding: 11px;
  background: white;
  color: #24392c;
}
button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: #dce9dd;
  color: #1c3b2a;
  font-weight: 650;
}
button.primary {
  background: #276b48;
  color: white;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #88b9a0;
}
.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
}
.list {
  display: grid;
  gap: 10px;
  align-content: start;
}
.tile {
  background: white;
  border: 1px solid #dce3dc;
  border-radius: 14px;
  padding: 15px;
  text-align: left;
  width: 100%;
}
.tile.active {
  border: 2px solid #276b48;
}
.tile strong {
  display: block;
  font-size: 1.03rem;
}
.muted {
  color: #607264;
  font-size: 0.9rem;
}
.pill {
  display: inline-block;
  background: #e7eee8;
  border-radius: 20px;
  padding: 4px 9px;
  font-size: 0.75rem;
  margin: 6px 5px 0 0;
}
.pill.tested {
  background: #d7eddb;
  color: #15512b;
}
.detail {
  background: white;
  border: 1px solid #e0e7df;
  border-radius: 18px;
  padding: 24px;
  min-height: 420px;
}
.detail h2 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}
.section {
  margin-top: 24px;
}
.section h3 {
  border-bottom: 1px solid #e5eae5;
  padding-bottom: 8px;
}
.ingredient {
  display: flex;
  align-items: start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f0f2ee;
}
.ingredient input {
  margin-top: 5px;
}
.ingredient.done span {
  text-decoration: line-through;
  color: #839287;
}
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.controls input {
  width: 85px;
}
.step {
  padding: 12px 14px;
  margin: 10px 0;
  background: #f5f7f3;
  border-radius: 12px;
}
.step.current {
  background: #e3f1e5;
  border: 2px solid #44845c;
}
.step .number {
  font-weight: 800;
  color: #316447;
  margin-right: 8px;
}
.stars {
  display: flex;
  gap: 4px;
}
.stars button {
  padding: 5px 7px;
  background: transparent;
  color: #a4aea3;
  font-size: 1.7rem;
}
.stars button.selected {
  color: #c08a17;
}
.rating {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 330px;
}
.note {
  width: 100%;
  min-height: 100px;
  resize: vertical;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.small {
  font-size: 0.82rem;
}
.empty {
  padding: 30px;
  text-align: center;
  color: #647466;
}
.cooking {
  position: fixed;
  inset: 0;
  background: #15271e;
  color: white;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 22px;
  overflow: auto;
}
.cooking .inner {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
.cooking-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}
.cooking-top h2 {
  margin: 0;
}
.cooking-top .step-counter {
  margin: 0 0 4px;
}
.cooking-sheet-launchers {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cooking-sheet-launchers details {
  flex: 1 1 220px;
}
.cooking-sheet-body {
  padding: 0 12px 12px;
}
.wake-status {
  margin: 8px 0 0;
}
.recipe-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}
.recipe-cook-dock {
  display: none;
}
.recipe-more {
  margin-top: 12px;
}
.recipe-more summary {
  cursor: pointer;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #e7eee8;
  font-weight: 650;
}
.recipe-more .actions {
  margin-top: 10px;
}
.cooking h2 {
  font-size: clamp(1.6rem, 5vw, 2.6rem);
}
.cooking .bigstep {
  font-size: clamp(1.5rem, 4.5vw, 2.5rem);
  line-height: 1.4;
  min-height: 190px;
}
.cooking .actions button {
  flex: 1;
  padding: 17px;
}
.cooking button {
  background: #d5e7d7;
}
.cooking .primary {
  background: #83c69b;
  color: #10271b;
}
.cooking .muted {
  color: #b3c6b7;
}
.source {
  overflow-wrap: anywhere;
}
a {
  color: #226a47;
}
@media (max-width: 750px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .list {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
  .detail {
    padding: 17px;
  }
  .wrap {
    padding: 14px;
  }
  header {
    padding: 20px 14px;
  }
  .toolbar input {
    flex-basis: 100%;
  }
}
@media print {
  header,
  .toolbar,
  .list,
  .actions,
  .controls button {
    display: none !important;
  }
  .layout {
    display: block;
  }
  .detail {
    border: 0;
    padding: 0;
  }
  .wrap {
    padding: 0;
  }
}
/* Management screens and narrow-device safety. */
body {
  overflow-wrap: anywhere;
}
.layout > * {
  min-width: 0;
}
.personal-note {
  display: block;
  margin-top: 18px;
}
.editor {
  width: min(700px, calc(100% - 24px));
  max-height: 92dvh;
  border: 1px solid #cbd5cc;
  border-radius: 18px;
  padding: 24px;
  color: #203126;
  background: #fff;
}
.editor::backdrop {
  background: #10271bbb;
}
.editor form > label {
  display: block;
  margin: 14px 0;
}
.editor label > input:not([type="checkbox"]):not([type="radio"]),
.editor label > textarea,
.editor label > select {
  display: block;
  width: 100%;
  margin-top: 6px;
}
.editor textarea {
  width: 100%;
  resize: vertical;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid label input {
  width: 100%;
}
fieldset {
  border: 1px solid #cbd5cc;
  border-radius: 10px;
  margin: 18px 0;
  min-width: 0;
}
.ingredient-row {
  display: grid;
  grid-template-columns: 85px 85px minmax(0, 1fr);
  gap: 6px;
  margin: 12px 0;
}
.ingredient-row input {
  min-width: 0;
  width: 100%;
}
.ingredient-row button {
  grid-column: 3;
  justify-self: end;
}
.editor p {
  font-size: 0.9rem;
  line-height: 1.5;
}
#editor-error {
  color: #9d2525;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}
.cooking details {
  margin: 20px 0;
}
.cooking summary {
  cursor: pointer;
  padding: 12px;
  border: 1px solid #83c69b;
  border-radius: 10px;
}
.cooking .ingredient.done span {
  color: #bdcbbf;
}
.cooking .ingredient input {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
button {
  min-height: 44px;
}
.stars button {
  color: #687464;
}
.stars button.selected {
  color: #8b6008;
}
.muted,
.small {
  color: #516455;
}
.cooking .muted {
  color: #bdcdbf;
}
@media (max-width: 420px) {
  .editor {
    padding: 16px;
  }
  .ingredient-row {
    grid-template-columns: 70px 65px minmax(0, 1fr);
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .toolbar > * {
    max-width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
dialog.cooking {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
}
dialog.cooking:not([open]) {
  display: none;
}
.cooking::backdrop {
  background: #15271e;
}
.back-to-list {
  display: none;
}
.ingredient.done span {
  color: #526858;
}
@media (max-width: 750px) {
  .back-to-list {
    display: block;
    margin-bottom: 12px;
  }
}
@media print {
  .back-to-list,
  .detail > .actions,
  .personal-note {
    display: none !important;
  }
}
.sync-controls {
  background: #e7eee8;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.sync-controls p {
  margin: 4px 0 10px;
}
.login {
  max-width: 440px;
}
.login label {
  display: block;
  margin: 16px 0;
}
.login input,
.login select {
  display: block;
  width: 100%;
  margin-top: 8px;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
textarea[readonly] {
  background: #f5f7f3;
}
.sync-controls summary {
  cursor: pointer;
  min-height: 44px;
  font-weight: 650;
}
.sync-controls summary #sync-status {
  display: block;
  font-size: 0.82rem;
  font-weight: 400;
  margin-top: 6px;
}
.sync-controls .actions {
  margin-top: 12px;
}
.recovery label {
  display: block;
  margin: 12px 0;
}
.recovery-value {
  white-space: pre-wrap;
  background: #f5f7f3;
  padding: 12px;
  border-radius: 10px;
}
.recovery fieldset legend {
  font-weight: 650;
}
#recovery-error {
  color: #9d2525;
}
.mobile-navigation {
  display: none;
}
#library-tools {
  position: relative;
}
#library-tools summary {
  cursor: pointer;
  border-radius: 10px;
  background: #e7eee8;
  padding: 11px 14px;
  min-height: 44px;
  font-weight: 650;
}
#library-tools[open] {
  flex-basis: 100%;
  order: 2;
}
#library-tools .actions {
  margin-top: 10px;
}
.detail h2:focus {
  outline: none;
}
.detail h2:focus-visible {
  outline: 3px solid #88b9a0;
  outline-offset: 4px;
}
@media (max-width: 750px) {
  .mobile-navigation {
    display: flex;
    gap: 8px;
    margin: 12px 0;
  }
  .mobile-navigation button {
    flex: 1;
  }
  .mobile-navigation button[aria-pressed="true"] {
    background: #276b48;
    color: white;
  }
  .wrap[data-view="library"] .detail {
    display: none;
  }
  .wrap[data-view="recipe"] .list,
  .wrap[data-view="recipe"] > .toolbar {
    display: none;
  }
  .wrap[data-view="recipe"] .detail {
    display: block;
  }
  .wrap[data-view="library"] .list {
    display: grid;
  }
}
@media print {
  .mobile-navigation,
  .sync-controls {
    display: none !important;
  }
  .wrap .detail {
    display: block !important;
  }
}

.recovery fieldset label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
}
.recovery input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex-shrink: 0;
}
@media (max-width: 750px) {
  .mobile-navigation {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f7f7f1;
    padding: 8px 0;
  }
  .detail {
    scroll-margin-top: 76px;
  }
}
.timer-panel {
  border: 1px solid #cbd5cc;
  border-radius: 12px;
  padding: 14px;
  margin-top: 16px;
  background: #f7f9f5;
  color: #203126;
}
.timer-panel label {
  display: block;
  margin: 10px 0;
}
.timer-panel label input {
  display: block;
  width: 100%;
  margin-top: 6px;
}
.timer-row {
  border-top: 1px solid #cbd5cc;
  margin-top: 16px;
  padding-top: 12px;
}
.timer-row h4 {
  margin: 0;
}
.timer-clock {
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.timer-strip {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 10px 14px;
  border: 1px solid #83c69b;
  border-radius: 12px;
  background: #10271b;
  color: white;
}
.timer-strip[hidden],
.timer-announcement[hidden] {
  display: none;
}
.timer-strip-label {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.timer-strip-clock {
  font-size: clamp(3rem, 13vw, 4.5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}
.timer-finished {
  border: 2px solid #896016;
  border-radius: 10px;
  padding: 12px;
  background: #fff4db;
}
.timer-dock {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  box-shadow: 0 2px 10px #182a2240;
  background: #276b48;
  color: white;
  max-width: calc(100vw - 32px);
}
.timer-announcement:not(:empty) {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 8;
  background: #fff4db;
  border: 1px solid #896016;
  padding: 12px max(16px, env(safe-area-inset-left));
  min-height: 44px;
  text-align: center;
  color: #203126;
}
.timer-announcement .dismiss-timer-alert {
  margin-left: 12px;
}
.cooking .timer-announcement:not(:empty) {
  position: static;
  padding: 8px;
  min-height: 44px;
}
.timer-error,
.session-error {
  color: #9d2525;
}
.session-record {
  border: 1px solid #dce3dc;
  border-radius: 12px;
  margin: 12px 0;
  padding: 14px;
}
.session-note {
  white-space: pre-wrap;
}
.session-editor label {
  display: block;
  margin: 16px 0;
}
.session-editor textarea {
  width: 100%;
}
.cooking .timer-panel .small {
  color: #516455;
}
.cooking-timers .timer-panel {
  font-size: 1rem;
}
@media (max-width: 750px) {
  dialog.cooking {
    padding: 14px;
    overflow: hidden;
  }
  .cooking .inner {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .cooking-top {
    align-items: center;
  }
  .cooking-top h2 {
    font-size: 1.3rem;
  }
  .cooking-top #close-cook {
    flex: 0 0 auto;
  }
  .cooking .timer-strip {
    margin: 0;
  }
  .timer-strip-clock {
    font-size: 3rem;
  }
  .cooking .bigstep {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    align-content: center;
    display: grid;
    padding: 8px 0;
  }
  .cooking-sheet-launchers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .cooking-sheet-launchers details {
    min-width: 0;
    margin: 0;
  }
  .cooking-sheet-launchers summary {
    height: 44px;
    padding: 11px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cooking-sheet-launchers details[open] {
    position: fixed;
    z-index: 7;
    inset: 32dvh 0 0;
    overflow: auto;
    margin: 0;
    padding: 14px;
    border-radius: 18px 18px 0 0;
    background: #15271e;
    box-shadow: 0 -4px 20px #0008;
  }
  .cooking-sheet-launchers details[open] summary {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #15271e;
  }
  .cooking-sheet-launchers details[open] .cooking-sheet-body {
    padding: 0;
  }
  .cooking-navigation {
    margin: 0;
  }
  .cooking .wake-status {
    margin: 0;
    text-align: center;
  }
  .detail {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }
  .recipe-cook-dock:not([hidden]) {
    position: fixed;
    z-index: 4;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    padding: 8px max(14px, env(safe-area-inset-left))
      calc(8px + env(safe-area-inset-bottom));
    background: white;
    box-shadow: 0 -2px 10px #182a2240;
  }
  .recipe-cook-dock button {
    width: 100%;
  }
  body.recipe-cook-dock-visible .timer-dock {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}
@media print {
  .timer-dock,
  .timer-announcement,
  [data-open-timers] {
    display: none !important;
  }
}
