/* RPM System — front-end styles
   RTL-first. Brand: forest green (#375a4d) as the anchor, warm amber (#e0872f)
   for the "why/purpose" accent, quiet sand background. Kept disciplined so the
   step transitions and the progress ring are the only expressive moments. */

.rpm-app {
  --rpm-green: #375a4d;
  --rpm-green-soft: #eef4f1;
  --rpm-amber: #e0872f;
  --rpm-ink: #2a2f2c;
  --rpm-muted: #6b746f;
  --rpm-line: #e3e6e4;
  --rpm-bg: #fbfaf7;
  --rpm-radius: 12px;

  direction: rtl;
  text-align: right;
  max-width: 640px;
  margin-inline: auto;
  color: var(--rpm-ink);
  font-family: inherit;
  line-height: 1.6;
}

/* Progress bar across the top of the morning wizard */
.rpm-progressbar {
  height: 4px;
  background: var(--rpm-line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 28px;
}
.rpm-progressbar > span {
  display: block;
  height: 100%;
  width: 33%;
  background: var(--rpm-green);
  border-radius: 999px;
  transition: width .35s ease;
}

.rpm-step__title {
  font-size: 1.5rem;
  color: var(--rpm-green);
  margin: 0 0 20px;
  line-height: 1.3;
}

/* Step transition — the one bit of motion */
.rpm-step {
  animation: rpm-in .35s ease both;
}
@keyframes rpm-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Numbered textareas */
.rpm-field {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.rpm-field__num {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rpm-green-soft);
  color: var(--rpm-green);
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-top: 6px;
}
.rpm-field textarea {
  flex: 1;
  border: 1px solid var(--rpm-line);
  border-radius: var(--rpm-radius);
  padding: 12px 14px;
  font: inherit;
  color: var(--rpm-ink);
  background: #fff;
  resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.rpm-field textarea:focus {
  outline: none;
  border-color: var(--rpm-green);
  box-shadow: 0 0 0 3px var(--rpm-green-soft);
}

/* Recap of earlier steps, shown read-only on later steps */
.rpm-recap {
  background: var(--rpm-bg);
  border: 1px solid var(--rpm-line);
  border-radius: var(--rpm-radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.rpm-recap__group + .rpm-recap__group { margin-top: 12px; }
.rpm-recap__label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--rpm-muted);
  margin-bottom: 6px;
}
.rpm-recap__item {
  padding: 6px 10px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 6px;
}
.rpm-recap--purpose .rpm-recap__label { color: var(--rpm-amber); }

/* Nav buttons */
.rpm-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.rpm-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: var(--rpm-green);
  background-color: var(--rpm-green);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--rpm-radius);
  cursor: pointer;
  transition: background .2s, transform .05s;
}
.rpm-app .rpm-btn,
.rpm-gate .rpm-btn {
  background: var(--rpm-green);
  color: #fff;
}
.rpm-btn:hover { background: #2c4a3f; }
.rpm-btn:active { transform: translateY(1px); }
.rpm-btn:disabled { opacity: .55; cursor: default; }
.rpm-btn--ghost {
  background: transparent;
  color: var(--rpm-green);
  border: 1px solid var(--rpm-line);
}
.rpm-btn--ghost:hover { background: var(--rpm-green-soft); }

/* Done / empty panels */
.rpm-done, .rpm-empty {
  text-align: center;
  padding: 40px 20px;
}
.rpm-done h2 { color: var(--rpm-green); font-size: 2rem; margin: 0 0 10px; }

/* Evening report rows */
.rpm-evening__row {
  border: 1px solid var(--rpm-line);
  border-radius: var(--rpm-radius);
  padding: 16px;
  margin-bottom: 16px;
  background: #fff;
}
.rpm-evening__action {
  font-weight: 600;
  margin-bottom: 12px;
}
.rpm-toggle {
  display: inline-flex;
  border: 1px solid var(--rpm-line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}
.rpm-toggle button {
  appearance: none;
  border: 0;
  background: #fff;
  font: inherit;
  padding: 6px 18px;
  cursor: pointer;
  color: var(--rpm-muted);
}
.rpm-toggle button[aria-pressed="true"] {
  background: var(--rpm-green);
  color: #fff;
}
.rpm-toggle button.is-no[aria-pressed="true"] {
  background: #b4544a;
}
.rpm-rate { display: flex; gap: 6px; flex-wrap: wrap; }
.rpm-rate button {
  width: 34px; height: 34px;
  border: 1px solid var(--rpm-line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  color: var(--rpm-muted);
}
.rpm-rate button[aria-pressed="true"] {
  background: var(--rpm-amber);
  border-color: var(--rpm-amber);
  color: #fff;
}

/* Progress screen */
.rpm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.rpm-stat {
  background: var(--rpm-green-soft);
  border-radius: var(--rpm-radius);
  padding: 18px;
  text-align: center;
}
.rpm-stat__value { font-size: 1.8rem; font-weight: 700; color: var(--rpm-green); }
.rpm-stat__label { font-size: .85rem; color: var(--rpm-muted); }

.rpm-history__day {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--rpm-line);
  border-radius: var(--rpm-radius);
  margin-bottom: 10px;
}
.rpm-history__date { font-weight: 600; }
.rpm-badge {
  font-size: .8rem;
  padding: 3px 10px;
  border-radius: 999px;
}
.rpm-badge--closed { background: var(--rpm-green-soft); color: var(--rpm-green); }
.rpm-badge--open { background: #fbf0e2; color: var(--rpm-amber); }

/* Gate messages */
.rpm-gate {
  max-width: 480px;
  margin-inline: auto;
  text-align: center;
  padding: 32px;
  border: 1px solid var(--rpm-line);
  border-radius: var(--rpm-radius);
  background: var(--rpm-bg);
  direction: rtl;
}

/* Accessibility: honour reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .rpm-step { animation: none; }
  .rpm-progressbar > span { transition: none; }
}

/* Tabs for the single smart shell */
.rpm-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--rpm-line);
  margin-bottom: 24px;
}
.rpm-tab {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--rpm-muted);
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.rpm-tab.is-active {
  color: var(--rpm-green);
  border-bottom-color: var(--rpm-green);
}
.rpm-loading {
  text-align: center;
  color: var(--rpm-muted);
  padding: 40px 0;
}

/* Settings panel */
.rpm-settings__intro { color: var(--rpm-muted); margin-bottom: 20px; }
.rpm-settings__block {
  border: 1px solid var(--rpm-line);
  border-radius: var(--rpm-radius);
  padding: 18px;
  margin-bottom: 16px;
  background: #fff;
}
.rpm-settings__h {
  font-weight: 700;
  color: var(--rpm-green);
  margin-bottom: 12px;
}
.rpm-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  cursor: pointer;
}
.rpm-check input { width: 18px; height: 18px; accent-color: var(--rpm-green); }
.rpm-timerow {
  display: flex;
  justify-content: flex-end;
  margin: -4px 28px 14px;
}
.rpm-timerow input[type="time"] {
  border: 1px solid var(--rpm-line);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
}
.rpm-saved {
  align-self: center;
  color: var(--rpm-green);
  font-weight: 600;
}

/* Login box (gate) */
.rpm-gate--login h3 { color: var(--rpm-green); margin: 0 0 8px; }
.rpm-loginbox {
  display: flex;
  gap: 8px;
  margin: 16px auto 0;
  max-width: 380px;
}
.rpm-loginbox input {
  flex: 1;
  border: 1px solid var(--rpm-line);
  border-radius: var(--rpm-radius);
  padding: 10px 14px;
  font: inherit;
  direction: rtl;
}
.rpm-login-msg { margin-top: 12px; color: var(--rpm-green); }

/* Danger / cancel */
.rpm-cancel {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--rpm-line);
}
.rpm-btn--danger { background: #b4544a; }
.rpm-btn--danger:hover { background: #9a4740; }

/* Labelled time row (Friday block) */
.rpm-timerow--labeled {
  justify-content: space-between;
  align-items: center;
  margin: 8px 28px 14px;
}
.rpm-timerow--labeled span { color: var(--rpm-ink); }
.rpm-note {
  color: var(--rpm-muted);
  font-size: .85rem;
  margin: 8px 0 0;
}

/* Clickable open day in progress (still closable — today/yesterday) */
.rpm-history__day--open {
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.rpm-history__day--open:hover {
  background: #fbf0e2;
  border-color: var(--rpm-amber);
}
.rpm-history__day--open .rpm-badge--open {
  text-decoration: underline;
}
