:root {
  /* Color palette – warm artisan bakery + rustic lab */
  --bg-body: #faf6f0;           /* Flour dust off-white */
  --bg-card: #fff8f0;           /* Warm card background */
  --bg-card-soft: #f4ebdf;      /* Soft wheat panel */

  --accent: #c76a3a;            /* Burnt orange (primary accent) */
  --accent-soft: rgba(199, 106, 58, 0.18);
  --accent-deep: #8b5e3c;       /* Toasted crust (deep accent) */

  --text-main: #2a1f1a;         /* Dark roast brown (nearly black) */
  --text-muted: #7f6e62;        /* Muted bakery brown */

  --border-soft: rgba(102, 76, 51, 0.12);
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.10);
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --transition-fast: 150ms ease-out;
  --transition-med: 220ms ease;
}

/* ========== GLOBAL RESET / BASE ========== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #fff8f0 0, #f0e2d4 40%, #e4d2c0 65%, #d3bba3 100%);
  color: var(--text-main);
}

a {
  color: var(--accent-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========== APP SHELL ========== */

#app-root {
  max-width: 1160px;
  margin: 0 auto;
  padding: 18px 14px 32px;
}

.app-shell {
  background: rgba(255, 248, 240, 0.97);
  border-radius: 26px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.7);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

/* ========== HEADER ========== */

.app-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.3rem 1.6rem 0.9rem;
  border-bottom: 1px solid rgba(102, 76, 51, 0.12);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(249, 241, 231, 0.98));
}

.app-badge-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 30%, #fff4d7, #f1b45e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.app-title-block {
  flex: 1;
  min-width: 0;
}

.app-title {
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-main);
}

.app-subtitle {
  margin-top: 0.14rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* rotating logo in header */
#rotating-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

/* ========== NAV ========== */

.app-nav {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem 0.85rem;
  border-bottom: 1px solid rgba(102, 76, 51, 0.1);
  overflow-x: auto;
  scrollbar-width: thin;
}

.app-nav-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.app-nav-button .emoji {
  font-size: 1.1rem;
}

.app-nav-button:hover {
  background: rgba(249, 241, 231, 0.9);
  border-color: rgba(102, 76, 51, 0.18);
  transform: translateY(-1px);
}

.app-nav-button.app-nav-active {
  background: radial-gradient(circle at top left, #ffe7c2, #f0c088);
  border-color: rgba(183, 118, 57, 0.7);
  color: #4a2d16;
  box-shadow: 0 12px 30px rgba(217, 139, 74, 0.35);
}

/* ========== MAIN LAYOUT ========== */

.app-main {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr);
  gap: 1.1rem;
  padding: 1rem 1.4rem 1.4rem;
}

.app-section {
  display: none;
}

.app-section.app-section-active {
  display: block;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-main);
}

.section-title .emoji {
  font-size: 1.1rem;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 32rem;
}

.pill-label {
  align-self: center;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-deep);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(217, 139, 74, 0.12);
  border: 1px solid rgba(217, 139, 74, 0.5);
  white-space: nowrap;
}

.app-secondary-column {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* ========== CARDS ========== */

.card {
  background: linear-gradient(145deg, var(--bg-card), #fffdf7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  padding: 0.75rem 0.85rem 0.8rem;
  margin-bottom: 0.8rem;
}

.card-soft {
  background: linear-gradient(145deg, var(--bg-card-soft), #fffaf3);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.card-header .tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(102, 76, 51, 0.18);
  background: rgba(249, 241, 231, 0.8);
  color: var(--text-muted);
  white-space: nowrap;
}

.card-body {
  font-size: 0.9rem;
  color: var(--text-main);
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.muted-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* nerdy expandable blocks */
.deep-science-block {
  margin-top: 0.6rem;
  border-radius: var(--radius-lg);
  padding: 0.6rem 0.7rem;
  background: radial-gradient(circle at top left, rgba(217, 139, 74, 0.12), rgba(255, 248, 240, 0.9));
  border: 1px dashed rgba(183, 118, 57, 0.55);
}

.deep-science-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  cursor: pointer;
}

.deep-science-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4a2d16;
}

.deep-science-toggle-icon {
  font-size: 1rem;
}

.deep-science-body {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  display: none;
}

.deep-science-body.open {
  display: block;
}

/* ========== FORM ELEMENTS ========== */

.input-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.input-group label,
.field-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.input-group input,
.input-group select,
.input-group textarea {
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  padding: 0.38rem 0.5rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: rgba(255, 252, 246, 0.96);
  color: var(--text-main);
}

.input-group textarea {
  min-height: 70px;
  resize: vertical;
}

.input-group input:focus-visible,
.input-group select:focus-visible,
.input-group textarea:focus-visible {
  outline: 2px solid rgba(217, 139, 74, 0.8);
  outline-offset: 1px;
  border-color: rgba(217, 139, 74, 0.8);
  background: #fffdf8;
}

/* global field text + placeholder styling */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
  color: var(--text-main);
}

input::placeholder,
textarea::placeholder {
  color: #c7b8a9 !important;
}

select:invalid {
  color: #c7b8a9;
}

/* ========== BUTTONS ========== */

.primary-btn,
.soft-btn,
.ghost-btn {
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.85rem;
  font-size: 0.86rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    color var(--transition-fast);
}

.primary-btn {
  background: linear-gradient(135deg, #f3b56d, #d98b4a);
  color: #3b250f;
  box-shadow: 0 14px 34px rgba(217, 139, 74, 0.4);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(217, 139, 74, 0.6);
}

.soft-btn {
  background: rgba(249, 241, 231, 0.96);
  color: var(--text-main);
  border: 1px solid rgba(102, 76, 51, 0.18);
}

.soft-btn:hover {
  background: rgba(249, 241, 231, 1);
}

.ghost-btn {
  background: transparent;
  color: var(--text-muted);
  padding-inline: 0.4rem;
}

.ghost-btn:hover {
  background: rgba(249, 241, 231, 0.8);
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
}

/* Tiny circular "?" hint buttons on labels */
.hint-badge {
  margin-left: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  background: #f9f5ef;
  color: var(--accent-deep);
  font-size: 0.75rem;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.hint-badge:hover {
  background: #fffaf3;
  border-color: #c76a3a;
}

/* ========== LISTS (STARTERS, BAKES, JOURNAL, FAMILY) ========== */

.list-empty {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 0.4rem 0.2rem;
}

.list-items {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.list-item {
  padding: 0.4rem 0.5rem;
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.95);
  border: 1px solid rgba(102, 76, 51, 0.12);
}

.list-item-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.list-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.list-item-body {
  font-size: 0.86rem;
  margin-top: 0.25rem;
}

/* starter feed history */
.feed-history {
  margin-top: 0.35rem;
  font-size: 0.8rem;
}

.feed-history summary {
  cursor: pointer;
  font-weight: 500;
}

.feed-history-list {
  margin-top: 0.25rem;
  border-left: 2px solid rgba(102, 76, 51, 0.25);
  padding-left: 0.5rem;
}

.feed-history-item + .feed-history-item {
  margin-top: 0.3rem;
}

.feed-history-meta {
  color: var(--text-muted);
}

.feed-history-notes {
  margin-top: 0.1rem;
}

.feed-history-empty {
  margin-top: 0.25rem;
}

/* ========== FOOTER ========== */

.app-footer {
  padding: 0.5rem 1.6rem 0.9rem;
  border-top: 1px solid rgba(102, 76, 51, 0.1);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(255, 252, 246, 0.96), rgba(249, 241, 231, 0.96));
}

.app-footer strong {
  font-weight: 700;
  color: var(--accent-deep);
}

.flow-guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(102, 76, 51, 0.25);
  background: #fff8f0;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

.flow-guide-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  background: #fff2e2;
}

/* ===================== BEGIN: FLOW GUIDE MODAL ===================== */

body.flow-modal-open {
  overflow: hidden;
}

/* Backdrop behind the modal */
.flow-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: flex-start; /* anchor a bit toward the top */
  justify-content: center;
  z-index: 200;
  padding: 1.5rem;
}

/* When open, show the flex container */
.flow-modal-backdrop.is-open {
  display: flex;
}

/* The modal itself */
.flow-modal {
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  background: linear-gradient(135deg, #fffaf3, #f4ebdf);
  border-radius: 24px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(102, 76, 51, 0.3);
  position: relative;
  padding: 1.1rem 1.3rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow: hidden;
}

/* Close button (×) */
.flow-modal-close {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: rgba(55, 41, 30, 0.7);
  padding: 0.2rem;
}

.flow-modal-close:hover {
  color: rgba(55, 41, 30, 0.95);
}

/* Header text */
.flow-modal-header {
  padding-right: 2rem;
}

.flow-modal-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  color: var(--text-main);
}

.flow-modal-header p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Tabs row */
.flow-modal-tabs {
  margin-top: 0.5rem;
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 248, 240, 0.9);
  border: 1px solid rgba(102, 76, 51, 0.18);
}

/* Individual tab button */
.flow-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    transform 0.08s ease;
}

/* Number bubble in each tab */
.flow-tab-step {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  background: rgba(199, 106, 58, 0.12);
  color: var(--accent-deep);
}

/* Active tab state */
.flow-tab.is-active {
  background: #c76a3a;
  color: #fff8f0;
}

.flow-tab.is-active .flow-tab-step {
  background: rgba(255, 252, 246, 0.95);
  color: #c76a3a;
}

/* Body grid inside modal: left panel / right log timeline */
.flow-modal-body {
  margin-top: 0.5rem;
  padding: 0.7rem 0.1rem 0.4rem;
  flex: 1 1 auto;
  overflow-y: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr);
  gap: 0.9rem;
}

/* Panels (Starter / Bulk / Bake) */
.flow-panel {
  display: none;
}

.flow-panel.is-active {
  display: block;
}

/* Panel text helpers */
.flow-panel-intro {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}

.flow-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.1rem 0 0.3rem;
}

/* Forms & radio chips */
.flow-form {
  margin-top: 0.4rem;
}

.flow-fieldset {
  border: 1px solid rgba(102, 76, 51, 0.18);
  border-radius: 14px;
  padding: 0.6rem 0.7rem 0.7rem;
  margin: 0 0 0.6rem;
}

.flow-fieldset legend {
  padding: 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-deep);
}

.flow-radio-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.flow-radio-chip {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.4rem 0.45rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #f9f5ef;
  cursor: pointer;
  font-size: 0.8rem;
  transition:
    border-color 0.12s ease,
    background 0.12s ease,
    transform 0.08s ease;
}

.flow-radio-chip:hover {
  border-color: #c76a3a;
  background: #fffaf3;
}

.flow-radio-chip input[type="radio"] {
  margin-top: 0.1rem;
}

.flow-radio-chip span {
  display: block;
}

.flow-radio-chip strong {
  font-weight: 700;
}

/* Tiny text snippets / prompts */
.flow-small-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Right-hand timeline box in modal */
.flow-timeline-shell {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.96);
  color: #e5e7eb;
  padding: 0.6rem 0.7rem 0.7rem;
  font-size: 0.78rem;
}

.flow-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.flow-timeline-header span {
  font-weight: 600;
}

.flow-timeline-clear {
  border: none;
  background: transparent;
  color: #a5b4fc;
  font-size: 0.75rem;
  cursor: pointer;
}

.flow-timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}

.flow-timeline-item {
  padding: 0.3rem 0.3rem 0.35rem;
  border-radius: 10px;
}

.flow-timeline-item + .flow-timeline-item {
  margin-top: 0.2rem;
}

.flow-timeline-item:hover {
  background: rgba(59, 130, 246, 0.18);
}

/* Responsive: stack modal body on small screens */
@media (max-width: 900px) {
  .flow-modal-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow-modal-tabs {
    width: 100%;
    justify-content: space-between;
  }
}

/* ===================== END: FLOW GUIDE MODAL ===================== */


/* ===================== PRINT LAYOUT FOR STARTER LOG – FINAL VERSION ===================== */

@media print {
  body {
    background: #ffffff;
  }

  #app-root {
    padding: 0;
  }

  .app-shell {
    box-shadow: none;
    border-radius: 0;
    border: none;
  }

  /* Hide normal chrome + main app layout on print */
  .app-header,
  .app-nav,
  .app-main,
  .app-footer {
    display: none !important;
  }

  /* Show ONLY the dedicated printable starter log (and starter header if you want it) */
  #printStarterLog {
    display: block !important;
  }
}

/* On-screen: printable log is always hidden */
#printStarterLog {
  display: none;
  padding: 0.4in 0.6in 0.6in;
  font-family: "Georgia", "Times New Roman", serif;
  color: #333;
}


  /* You can narrow print to starter or planner by setting a print-only class if needed later */
}

/* ========== RESPONSIVE ========== */

@media (max-width: 900px) {
  .app-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow-modal-body {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .section-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .pill-label {
    align-self: flex-start;
  }

  .input-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-header {
    flex-wrap: wrap;
  }

  .app-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
