#rph-hydratation-tool {
  --rph-olive: #747b2d;
  --rph-olive-dark: #5a6220;
  --rph-olive-soft: #eef0dd;
  --rph-cream: #f8f8f1;
  --rph-paper: #ffffff;
  --rph-ink: #282b17;
  --rph-muted: #686b57;
  --rph-border: #d9dcc1;
  --rph-border-strong: #b6bb86;
  --rph-danger: #9c342d;
  --rph-danger-soft: #fff0ed;
  --rph-shadow: 0 18px 48px rgba(49, 55, 19, 0.11);
  --rph-radius-lg: 22px;
  --rph-radius-md: 14px;
  --rph-radius-sm: 10px;
  --rph-focus: 0 0 0 4px rgba(116, 123, 45, 0.24);
  box-sizing: border-box;
  width: min(100% - 32px, 1180px);
  min-width: 0;
  margin: 0 auto;
  overflow-x: hidden;
  color: var(--rph-ink);
  background:
    radial-gradient(circle at top right, rgba(116, 123, 45, 0.08), transparent 31rem),
    var(--rph-cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

#rph-hydratation-tool,
#rph-hydratation-tool * {
  box-sizing: border-box;
}

#rph-hydratation-tool [hidden] {
  display: none !important;
}

#rph-hydratation-tool button,
#rph-hydratation-tool input,
#rph-hydratation-tool select {
  font: inherit;
}

#rph-hydratation-tool button,
#rph-hydratation-tool select {
  cursor: pointer;
}

#rph-hydratation-tool button:focus-visible,
#rph-hydratation-tool input:focus-visible,
#rph-hydratation-tool select:focus-visible,
#rph-hydratation-tool summary:focus-visible {
  outline: 0;
  box-shadow: var(--rph-focus);
}

#rph-hydratation-tool button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.rph-app {
  width: 100%;
  margin: 0;
  padding: 48px 0 28px;
}

/* Keep the module surface self-contained when embedded in a WordPress page. */
#rph-hydratation-tool {
}

.rph-header {
  max-width: 740px;
  margin-bottom: 30px;
}

.rph-eyebrow,
.rph-step-label {
  margin: 0 0 8px;
  color: var(--rph-olive-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.rph-header .rph-title,
.rph-panel-heading h2,
.rph-flour-guide h2,
.rph-result-card h2 {
  margin: 0;
  color: var(--rph-olive-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.rph-header .rph-title {
  max-width: 700px;
  font-size: clamp(2.15rem, 4.3vw, 3.8rem);
  line-height: 1.03;
}

.rph-intro {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--rph-muted);
  font-size: 1.08rem;
}

.rph-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
  padding: 8px;
  border: 1px solid var(--rph-border);
  border-radius: var(--rph-radius-lg);
  background: rgba(255, 255, 255, 0.7);
}

.rph-tab {
  display: flex;
  min-width: 0;
  min-height: 70px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--rph-radius-md);
  color: var(--rph-muted);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  transition: 160ms ease;
}

.rph-tab:hover {
  color: var(--rph-olive-dark);
  background: var(--rph-olive-soft);
}

.rph-tab.rph-is-active {
  border-color: var(--rph-olive);
  color: #fff;
  background: var(--rph-olive);
  box-shadow: 0 8px 22px rgba(90, 98, 32, 0.18);
}

.rph-tab-number {
  flex: 0 0 auto;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  color: var(--rph-olive-dark);
  background: var(--rph-olive-soft);
  font-size: 0.7rem;
  font-weight: 900;
}

.rph-tab.rph-is-active .rph-tab-number {
  color: var(--rph-olive-dark);
  background: #fff;
}

.rph-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  align-items: start;
  gap: 24px;
}

.rph-form-column {
  min-width: 0;
}

.rph-panel,
.rph-flour-guide,
.rph-result-card {
  border: 1px solid var(--rph-border);
  border-radius: var(--rph-radius-lg);
  background: var(--rph-paper);
}

.rph-panel {
  padding: clamp(22px, 4vw, 36px);
}

.rph-panel-heading {
  margin-bottom: 25px;
}

.rph-panel-heading h2,
.rph-flour-guide h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  line-height: 1.1;
}

.rph-panel-heading p:not(.rph-step-label),
.rph-flour-guide p:not(.rph-step-label) {
  max-width: 660px;
  margin: 10px 0 0;
  color: var(--rph-muted);
}

.rph-form {
  display: grid;
  gap: 18px;
}

.rph-field {
  min-width: 0;
}

.rph-field label,
.rph-choice-fieldset legend {
  display: block;
  margin-bottom: 7px;
  color: var(--rph-ink);
  font-size: 0.92rem;
  font-weight: 750;
}

.rph-input-with-unit {
  display: flex;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--rph-border-strong);
  border-radius: var(--rph-radius-sm);
  background: #fff;
  transition: 160ms ease;
}

.rph-input-with-unit:focus-within {
  border-color: var(--rph-olive);
  box-shadow: var(--rph-focus);
}

.rph-input-with-unit input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--rph-radius-sm) 0 0 var(--rph-radius-sm);
  color: var(--rph-ink);
  background: transparent;
  font-size: 1.08rem;
}

.rph-input-with-unit input:focus {
  outline: 0;
}

.rph-input-with-unit > span {
  flex: 0 0 auto;
  padding: 0 15px 0 8px;
  color: var(--rph-muted);
  font-weight: 750;
}

.rph-field-help,
.rph-field-error {
  min-height: 1.25em;
  margin: 5px 0 0;
  font-size: 0.78rem;
}

.rph-field-help {
  color: var(--rph-muted);
}

.rph-field-error {
  color: var(--rph-danger);
}

.rph-rate-shortcuts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
}

.rph-rate-shortcuts-label {
  flex: 0 0 100%;
  color: var(--rph-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.rph-rate-shortcut {
  min-width: 48px;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--rph-border-strong);
  border-radius: 999px;
  color: var(--rph-olive-dark);
  background: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  transition: 160ms ease;
}

.rph-rate-shortcut:hover,
.rph-rate-shortcut.rph-is-selected {
  border-color: var(--rph-olive-dark);
  color: #fff;
  background: var(--rph-olive-dark);
}

.rph-field.rph-has-error .rph-input-with-unit,
.rph-field.rph-has-error select {
  border-color: var(--rph-danger);
  background: var(--rph-danger-soft);
}

.rph-primary-button,
.rph-secondary-button,
.rph-text-button {
  min-height: 48px;
  border-radius: var(--rph-radius-sm);
  font-weight: 800;
  transition: 160ms ease;
}

.rph-primary-button {
  width: 100%;
  margin-top: 4px;
  padding: 12px 18px;
  border: 1px solid var(--rph-olive-dark);
  color: #fff;
  background: var(--rph-olive-dark);
}

.rph-primary-button:hover {
  background: var(--rph-olive);
}

.rph-choice-fieldset {
  display: grid;
  gap: 10px;
  margin: 0 0 4px;
  padding: 0;
  border: 0;
}

.rph-choice-fieldset legend {
  padding: 0;
}

.rph-choice,
.rph-toggle-choice {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--rph-border);
  border-radius: var(--rph-radius-sm);
  color: var(--rph-ink);
  background: #fff;
  cursor: pointer;
}

.rph-choice:has(input:checked),
.rph-toggle-choice:has(input:checked) {
  border-color: var(--rph-olive);
  background: var(--rph-olive-soft);
}

.rph-choice input,
.rph-toggle-choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--rph-olive-dark);
}

.rph-subform {
  display: grid;
  gap: 18px;
}

.rph-notice {
  padding: 13px 15px;
  border-left: 4px solid var(--rph-olive);
  border-radius: var(--rph-radius-sm);
  color: var(--rph-olive-dark);
  font-size: 0.9rem;
}

.rph-notice-soft {
  background: var(--rph-olive-soft);
}

.rph-toggle-choice {
  align-items: flex-start;
}

.rph-toggle-choice strong,
.rph-toggle-choice small {
  display: block;
}

.rph-toggle-choice small {
  margin-top: 3px;
  color: var(--rph-muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.rph-starter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 15px;
  border-radius: var(--rph-radius-md);
  background: #fafbf4;
}

.rph-flour-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.55fr);
  gap: 18px 24px;
  margin-top: 24px;
  padding: 24px;
}

.rph-flour-guide > div:first-child {
  min-width: 0;
}

.rph-flour-guide .rph-field {
  align-self: end;
}

.rph-flour-guide select {
  width: 100%;
  min-height: 50px;
  padding: 10px 38px 10px 13px;
  border: 1px solid var(--rph-border-strong);
  border-radius: var(--rph-radius-sm);
  color: var(--rph-ink);
  background: #fff;
}

.rph-guide-result {
  grid-column: 1 / -1;
  min-height: 48px;
  padding: 13px 15px;
  border-radius: var(--rph-radius-sm);
  color: var(--rph-muted);
  background: var(--rph-olive-soft);
  font-size: 0.9rem;
}

.rph-guide-result p {
  margin: 0 !important;
}

.rph-guide-result strong {
  color: var(--rph-olive-dark);
}

.rph-result-card {
  position: sticky;
  top: 18px;
  min-width: 0;
  padding: clamp(22px, 4vw, 34px);
  box-shadow: var(--rph-shadow);
}

.rph-result-card h2 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.rph-result-empty {
  display: grid;
  min-height: 330px;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 30px;
  color: var(--rph-muted);
  text-align: center;
}

.rph-result-empty p {
  max-width: 260px;
  margin: 0;
}

.rph-result-empty-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--rph-olive);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 700;
}

.rph-result-primary-label {
  margin: 28px 0 4px;
  color: var(--rph-muted);
  font-size: 1rem;
  font-weight: 750;
}

.rph-result-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0 0;
  color: var(--rph-olive-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.6rem, 7.5vw, 5.8rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.rph-result-primary > span:last-child {
  max-width: 170px;
  font-family: inherit;
  font-size: 0.35em;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.rph-result-primary-note {
  margin: 8px 0 0;
  color: var(--rph-danger);
  font-size: 0.87rem;
  font-weight: 700;
}

.rph-result-range-note {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-left: 3px solid var(--rph-border-strong);
  color: var(--rph-muted);
  background: #fafbf4;
  font-size: 0.78rem;
}

.rph-starter-breakdown {
  display: grid;
  gap: 3px;
  margin-top: 18px;
  padding: 14px 15px;
  border-left: 4px solid var(--rph-olive);
  border-radius: var(--rph-radius-sm);
  color: var(--rph-olive-dark);
  background: var(--rph-olive-soft);
  font-size: 0.88rem;
}

.rph-starter-breakdown strong {
  font-size: 0.98rem;
}

.rph-starter-breakdown span {
  color: var(--rph-muted);
}

.rph-result-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 28px 0 0;
}

.rph-result-summary-heading {
  margin: 26px 0 8px;
  color: var(--rph-olive-dark);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rph-result-summary > div {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--rph-border);
  border-radius: var(--rph-radius-sm);
  background: #fcfcf8;
}

.rph-result-summary dt {
  color: var(--rph-muted);
  font-size: 0.75rem;
}

.rph-result-summary dd {
  margin: 4px 0 0;
  color: var(--rph-olive-dark);
  font-size: 1.15rem;
  font-weight: 850;
}

.rph-result-section {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--rph-border);
}

.rph-result-section h3 {
  margin: 0 0 10px;
  color: var(--rph-olive-dark);
  font-size: 1rem;
}

.rph-result-section p {
  margin: 0;
  color: var(--rph-muted);
  font-size: 0.95rem;
}

.rph-result-badge {
  display: inline-block;
  margin-bottom: 8px !important;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--rph-olive-dark) !important;
  background: var(--rph-olive-soft);
  font-size: 0.8rem !important;
  font-weight: 850;
}

.rph-result-action {
  padding: 16px;
  border: 1px solid var(--rph-border);
  border-radius: var(--rph-radius-md);
  background: #fafbf4;
}

.rph-calculation-details {
  margin-top: 18px;
  border-top: 1px solid var(--rph-border);
}

.rph-calculation-toggle {
  width: 100%;
  min-height: 48px;
  padding: 14px 0;
  border: 0;
  color: var(--rph-olive-dark);
  background: transparent;
  font-weight: 850;
  cursor: pointer;
  text-align: left;
}

.rph-calculation-toggle::after {
  float: right;
  content: "+";
  color: var(--rph-olive);
  font-size: 1.2rem;
  line-height: 1;
}

.rph-calculation-toggle[aria-expanded="true"]::after {
  content: "−";
}

.rph-detail-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px solid var(--rph-border);
  font-size: 0.85rem;
}

.rph-detail-line span:first-child {
  color: var(--rph-muted);
}

.rph-detail-line span:last-child {
  color: var(--rph-ink);
  font-weight: 750;
  text-align: right;
}

.rph-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.rph-secondary-button {
  flex: 1 1 180px;
  padding: 11px 15px;
  border: 1px solid var(--rph-olive-dark);
  color: #fff;
  background: var(--rph-olive-dark);
}

.rph-secondary-button:hover {
  background: var(--rph-olive);
}

.rph-text-button {
  flex: 0 0 auto;
  padding: 11px 12px;
  border: 0;
  color: var(--rph-olive-dark);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rph-status {
  min-height: 1.3em;
  margin: 10px 0 0;
  color: var(--rph-olive-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.rph-footer {
  max-width: 760px;
  margin: 26px auto 0;
  color: var(--rph-muted);
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 850px) {
  .rph-layout {
    grid-template-columns: 1fr;
  }

  .rph-result-card {
    position: static;
  }
}

@media (max-width: 640px) {
  .rph-app {
    width: min(100% - 20px, 1180px);
    padding-top: 28px;
  }

  .rph-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 6px;
  }

  .rph-tab {
    min-height: 62px;
    align-items: flex-start;
    padding: 10px;
    font-size: 0.79rem;
  }

  .rph-tab-number {
    width: 25px;
    height: 25px;
  }

  .rph-panel,
  .rph-result-card,
  .rph-flour-guide {
    border-radius: 17px;
  }

  .rph-panel,
  .rph-result-card {
    padding: 20px;
  }

  .rph-flour-guide {
    display: block;
    padding: 20px;
  }

  .rph-flour-guide .rph-field {
    margin-top: 18px;
  }

  .rph-guide-result {
    margin-top: 14px;
  }

  .rph-starter-fields {
    grid-template-columns: 1fr;
  }

  .rph-result-summary {
    grid-template-columns: 1fr 1fr;
  }

  .rph-detail-line {
    display: block;
  }

  .rph-detail-line span:last-child {
    display: block;
    margin-top: 3px;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  #rph-hydratation-tool,
  #rph-hydratation-tool *,
  #rph-hydratation-tool *::before,
  #rph-hydratation-tool *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
