:root {
  color-scheme: light;
  --bg: #090807;
  --card: #f4d9ba;
  --text: #21140f;
  --muted: #684537;
  --line: #9b5734;
  --soft: #ffe1bd;
  --blue-soft: #271914;
  --primary: #d74b1f;
  --primary-dark: #8d230f;
  --accent: #ffb33f;
  --smoke: #16110f;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.38), 0 5px 14px rgba(82, 33, 14, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 50% 0, rgba(151, 58, 23, 0.38), transparent 34rem),
    linear-gradient(90deg, #090807 0, #1a120f 13%, #241611 50%, #1a120f 87%, #090807 100%);
}

.page-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 24px 10px 30px;
}

.brand-banner {
  margin: 0 0 14px;
  padding: 18px 20px;
  color: #fff4df;
  background:
    linear-gradient(135deg, rgba(255, 179, 63, 0.22), transparent 42%),
    linear-gradient(180deg, #2a1a14, #16110f);
  border: 2px solid rgba(255, 179, 63, 0.45);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-banner h1 {
  margin: 0;
  color: var(--accent);
  font-size: 32px;
  font-weight: 880;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.brand-kicker {
  margin: 7px 0 0;
  color: #ffd5aa;
  font-size: 12px;
  font-weight: 620;
}

.site-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 0 14px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  background: rgba(22, 17, 15, 0.92);
  border: 2px solid rgba(202, 95, 43, 0.68);
  border-radius: 8px;
  box-shadow: 0 9px 22px rgba(64, 35, 20, 0.16);
  backdrop-filter: blur(8px);
}

.site-tab {
  min-height: 34px;
  padding: 0 8px;
  color: #ffd5aa;
  background: #2a1a14;
  border: 2px solid #6b3825;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 620;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.site-tab:hover {
  color: #ffffff;
  border-color: var(--accent);
  background: #4c2418;
}

.site-tab.is-active {
  color: #fff;
  background: linear-gradient(180deg, #ff8a2c, var(--primary));
  border-color: #ffb33f;
}

.site-tab.is-active:hover {
  color: #fff;
  transform: translateY(-1px);
}

.page-section {
  display: none;
}

.page-section.is-active {
  display: block;
}

.card {
  background: var(--card);
  border: 2px solid rgba(226, 126, 63, 0.72);
  box-shadow: var(--shadow);
}

.card {
  margin: 0 0 24px;
  padding: 25px 25px 28px;
  border-radius: 8px;
  border-top: 6px solid var(--primary);
}

h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  color: var(--text);
  font-size: 19px;
  font-weight: 830;
}

h2 span {
  width: 20px;
  display: inline-flex;
  justify-content: center;
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
}

h3 {
  margin: 23px 0 12px;
  font-size: 16px;
  font-weight: 760;
}

p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 520;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  color: #3b2118;
  font-size: 12px;
  font-weight: 650;
}

.field-title {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
}

input,
select,
textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 11px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 440;
  letter-spacing: 0;
  background: #fff2df;
  border: 2px solid #b87750;
  border-radius: 6px;
  box-shadow: inset 0 1px 2px rgba(30, 37, 52, 0.02), 0 2px 8px rgba(60, 70, 92, 0.03);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #8c929b;
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid rgba(179, 61, 24, 0.24);
  outline-offset: 1px;
  border-color: rgba(179, 61, 24, 0.52);
}

input:focus,
select:focus,
textarea:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(179, 61, 24, 0.1);
}

select {
  appearance: auto;
  color: #5b4033;
  background-color: #fff2df;
  border-color: #9b5734;
}

select:hover {
  color: #ffffff;
  background-color: #7e250f;
  border-color: var(--accent);
}

select:focus {
  color: var(--text);
  background-color: #fff2df;
}

textarea {
  min-height: 67px;
  resize: vertical;
}

.result {
  margin-top: 16px;
  padding: 15px 16px;
  color: #352217;
  background: #ffe0b0;
  border: 2px solid #b87750;
  border-radius: 7px;
  font-size: 17px;
  font-weight: 760;
  line-height: 1.35;
  box-shadow: 0 4px 12px rgba(40, 47, 62, 0.06);
}

.result.is-stable {
  color: #0f3f2d;
  background: #dff3c4;
  border-color: #4d9b37;
  box-shadow: 0 5px 16px rgba(15, 63, 45, 0.16);
}

.result.is-refrigerate {
  color: #5a3905;
  background: #ffe08a;
  border-color: #c98300;
  box-shadow: 0 5px 16px rgba(116, 69, 15, 0.16);
}

.result.is-too-moist {
  color: #651313;
  background: #ffd2c4;
  border-color: #c83224;
  box-shadow: 0 5px 16px rgba(129, 37, 31, 0.17);
}

.is-hidden {
  display: none;
}

.home-card h1 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 26px;
  font-weight: 850;
  line-height: 1.12;
  text-align: center;
}

.home-card h2 {
  display: block;
  margin: 0 auto 18px;
  color: #8d230f;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.3;
  text-align: center;
}

.home-card h3 {
  margin: 22px 0 12px;
  color: #2d1d16;
  font-size: 15px;
  font-weight: 760;
  text-align: center;
}

.home-card h2 + h3 {
  margin-top: 0;
}

.home-card p {
  max-width: 66ch;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 14px;
  color: #513629;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.home-card p:last-child {
  margin-bottom: 0;
}

.tool-list {
  max-width: 54ch;
  margin: 0 auto;
}

.tool-list p {
  margin-bottom: 8px;
}

.tool-list strong {
  color: #8d230f;
  font-weight: 740;
}

.home-sources {
  max-width: 66ch;
  margin: 18px auto 0;
  padding-top: 13px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: #5d3f30;
  border-top: 1px solid rgba(155, 87, 52, 0.46);
  font-size: 12px;
  font-weight: 560;
  text-align: center;
}

.home-sources span {
  color: #3a2419;
  font-weight: 680;
}

.home-sources a {
  color: #8d230f;
  font-weight: 650;
}

.contact-section {
  width: min(100%, 430px);
  margin: 18px auto 0;
  padding: 16px;
  display: block;
  text-align: center;
  background: #fff2df;
  border: 2px solid rgba(155, 87, 52, 0.58);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(64, 35, 20, 0.08);
}

.contact-section h3 {
  margin: 0 0 8px;
}

.contact-section p {
  max-width: none;
  margin: 0 0 10px;
}

.contact-section a {
  max-width: 100%;
  display: inline-block;
  padding: 7px 11px;
  color: #fff2df;
  background: #8d230f;
  border: 2px solid #b87750;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 740;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.contact-section a:hover {
  color: #ffffff;
  background: #7e250f;
  border-color: #ffb33f;
}

.reference-card {
  padding-top: 23px;
  padding-bottom: 25px;
}

.reference-card h2 {
  margin: 0;
  font-size: 15px;
}

.reference-rows {
  margin-top: 14px;
  display: grid;
  overflow: hidden;
  color: #6a4b3d;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: #fff2df;
}

.reference-head,
.reference-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.35fr;
  gap: 10px;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
}

.reference-head {
  color: #4f3224;
  font-weight: 620;
  background: #3a1f16;
  color: #ffd5aa;
  border-bottom: 1px solid var(--line);
}

.reference-row + .reference-row {
  border-top: 1px solid #ead2b7;
}

.reference-row strong {
  color: var(--primary-dark);
  font-weight: 680;
}

.journal-card {
  padding-top: 25px;
}

.profile-controls {
  margin-bottom: 5px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 31px;
  color: #634638;
  font-size: 13px;
}

.inline-select {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: #3f2a20;
}

.inline-select select {
  width: 190px;
  min-height: 29px;
  padding: 4px 28px 4px 10px;
  font-size: 12px;
}

.step {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #fff2df;
  color: #573b2d;
  font-size: 14px;
  font-weight: 620;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(41, 48, 63, 0.04);
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.step:hover,
.secondary:hover {
  color: #ffffff;
  background: #7e250f;
  border-color: var(--accent);
}

.profile-row strong {
  min-width: 30px;
  text-align: center;
  color: #2d1d16;
  font-size: 13px;
}

.composition {
  margin: 3px 0 9px 14px;
  color: #735443;
  font-size: 12px;
}

.segmented {
  margin-bottom: 5px;
}

.segment {
  min-width: 54px;
  height: 27px;
  padding: 0 11px;
  color: #5b4033;
  background: #fff2df;
  border: 2px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 560;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(41, 48, 63, 0.03);
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.segment:hover {
  color: #ffffff;
  background: #7e250f;
  border-color: var(--accent);
}

.segment.is-active {
  background: #ffb33f;
  color: #23130d;
  border-color: #8d230f;
}

hr {
  margin: 18px 0 17px;
  border: 0;
  border-top: 2px solid var(--line);
}

.journal-fields {
  grid-template-columns: 1fr;
  row-gap: 13px;
  max-width: none;
}

#aw {
  background: #fff0d1;
}

.notes-label {
  margin-top: 13px;
}

.ratings {
  margin-top: 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 22px;
  color: #6a4b3d;
  font-size: 13px;
}

.ratings > span {
  flex-basis: 100%;
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rating span {
  min-width: 43px;
  color: #5a3c2f;
}

.rating button {
  width: 15px;
  height: 20px;
  padding: 0;
  color: #d9dde5;
  background: transparent;
  border: 0;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.rating button.is-active {
  color: #ffb33f;
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 12px;
}

.primary,
.secondary {
  min-height: 32px;
  padding: 0 16px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 620;
  cursor: pointer;
}

.primary {
  color: #fff;
  background: linear-gradient(180deg, #ff8a2c, var(--primary));
  border: 2px solid var(--primary-dark);
  box-shadow: 0 2px 7px rgba(179, 61, 24, 0.28);
  transition: filter 140ms ease, transform 140ms ease;
}

.primary:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.secondary {
  color: #644538;
  background: #fff2df;
  border: 2px solid var(--line);
  box-shadow: 0 1px 4px rgba(40, 47, 62, 0.04);
}

.danger {
  min-height: 32px;
  padding: 0 16px;
  color: #8f1d13;
  background: #ffe3d4;
  border: 2px solid #eb8a6a;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 620;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.danger:hover {
  background: #ffd2c4;
  border-color: #d75232;
}

.entry-panel {
  margin-top: 23px;
  border: 2px solid var(--line);
  border-radius: 5px;
  background: #fff2df;
  overflow: hidden;
}

.entry-panel summary {
  min-height: 42px;
  padding: 11px 12px;
  color: #2d1d16;
  font-size: 15px;
  font-weight: 620;
  cursor: pointer;
  background: #3a1f16;
  color: #ffd5aa;
}

.entry-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.entry-panel-body {
  padding: 14px 12px 12px;
}

.saved-makes {
  min-height: 78px;
  display: grid;
  place-items: center;
}

.save-status {
  min-height: 18px;
  margin: 0 0 10px;
  color: #31481f;
  font-size: 12px;
  font-weight: 560;
}

.save-status.is-error {
  color: #8f1d13;
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.saved-makes p {
  margin: 0;
  color: #9a7b64;
  font-size: 13px;
}

.saved-list {
  width: 100%;
  display: grid;
  place-items: stretch;
  gap: 9px;
}

.saved-entry {
  padding: 0;
  background: #fff2df;
  border: 2px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.saved-summary {
  width: 100%;
  padding: 11px 12px;
  display: grid;
  gap: 3px;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.saved-summary:hover {
  background: #ffe0b0;
}

.saved-summary strong {
  display: block;
  margin-bottom: 3px;
  color: #2d1d16;
}

.saved-summary span {
  color: #765644;
  font-size: 12px;
}

.saved-detail {
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff2df;
}

.saved-detail dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 14px;
}

.saved-detail div {
  min-width: 0;
}

.saved-detail dt {
  margin-bottom: 2px;
  color: #7b5b48;
  font-size: 11px;
  font-weight: 620;
}

.saved-detail dd {
  margin: 0;
  color: #302017;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.saved-detail .saved-notes {
  grid-column: 1 / -1;
}

.saved-actions {
  margin-top: 13px;
  display: flex;
  gap: 10px;
}

a {
  color: #ffb33f;
}

@media (max-width: 560px) {
  body {
    background:
      radial-gradient(circle at 50% 0, rgba(151, 58, 23, 0.38), transparent 26rem),
      linear-gradient(90deg, #090807 0, #1a120f 12%, #241611 88%, #090807 100%);
  }

  .page-shell {
    padding: 0 8px 26px;
  }

  .card {
    margin-bottom: 24px;
    padding: 24px 25px 27px;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .site-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .measure-card .grid.two,
  .plan-card .grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  input,
  select,
  textarea {
    min-width: 0;
  }

  .ratings {
    gap: 8px 15px;
  }
}

@media (max-width: 430px) {
  .page-shell {
    padding-left: 7px;
    padding-right: 7px;
  }

  .card {
    padding-left: 19px;
    padding-right: 19px;
  }

  .measure-card .grid.two,
  .plan-card .grid.two {
    gap: 12px;
  }

  input,
  select,
  textarea {
    padding-left: 9px;
    padding-right: 9px;
    font-size: 13px;
  }

  .inline-select select {
    width: min(190px, 100%);
  }

  .ratings {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ratings > span {
    flex-basis: auto;
  }
}
