/* ============================================================
   Review view (log + flow)
   ============================================================ */

.review-view {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  color: var(--ink);
}

.review-view .back-btn { margin-bottom: 14px; }

.review-header {
  text-align: center;
  margin-bottom: 22px;
}
.review-header-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 4px;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.15));
}
.review-header h1 {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 1.6rem;
  margin: 0 0 4px;
  color: var(--ink);
}
.review-header-subtitle {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
}

.review-section {
  background: var(--bg-page);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.18);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.review-section h2 {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 1.05rem;
  margin: 0 0 10px;
  color: var(--ink);
}

/* --- Pending "waiting for you" rows --- */
.review-pending-list { display: flex; flex-direction: column; gap: 8px; }
.review-pending-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff8e4;
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  text-align: left;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.review-pending-row:hover {
  transform: translateY(-1px);
  background: #fff1c8;
  box-shadow: 2px 4px 0 rgba(0,0,0,0.18);
}
.review-pending-label {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}
.review-pending-range {
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.review-pending-arrow {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 1.1rem;
  color: var(--accent);
}

/* --- Season glance compartment --- */
.review-glance {
  border-color: var(--ink);
}
.review-glance-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.review-glance-header h2 {
  margin: 0;
  flex: 1 1 auto;
}
.review-glance-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 12px;
  background: var(--season-accent, #e8d8f0);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
}
.review-glance-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.review-glance-stat-num {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 1.15rem;
  color: var(--ink);
}
.review-glance-stat-label {
  font-size: 0.7rem;
  color: var(--ink-soft);
  text-transform: lowercase;
  letter-spacing: 0.04em;
}
.review-glance-stat-divider {
  width: 1px;
  height: 24px;
  background: rgba(0,0,0,0.25);
}

.review-weeks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}
.week-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 6px;
  background: var(--bg-page);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
  font-family: inherit;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s ease-out, background 0.15s;
}
.week-cell:hover:not([aria-disabled]) {
  transform: translateY(-2px);
  background: #fdf6dc;
}
.week-cell-num {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 0.9rem;
}
.week-cell-range {
  font-size: 0.7rem;
  color: var(--ink-soft);
}
.week-cell-hint {
  font-size: 0.7rem;
  color: var(--ink);
  margin-top: 2px;
}

.week-cell.is-reviewed {
  background: #e8f4e0;
}
.week-cell.is-pending {
  background: #fff8e4;
}
.week-cell.is-current {
  background: var(--cell-accent, #e8d8f0);
  border-width: 3px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}
.week-cell.is-future {
  background: #f3f0ea;
  color: var(--ink-soft);
  cursor: default;
  opacity: 0.7;
}
.week-cell.is-future .week-cell-hint { color: var(--ink-soft); }

/* --- Retroactive add-aim button inside the review flow --- */
.review-add-aim {
  /* Dashed border is intentional here — marks this button as a
     "come back and add something later" invite, distinct from the
     solid-bordered action buttons elsewhere. */
  display: block;
  width: 100%;
  margin: 10px 0 18px;
  padding: 10px 14px;
  background: #fff8e4;
  border: 2px dashed var(--ink);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s;
}
.review-add-aim:hover { background: #fff1c8; }

/* --- Kind chip (week / season) --- */
.review-kind-chip {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  background: var(--bg-page);
  color: var(--ink);
  white-space: nowrap;
}
.review-kind-weekly   { background: #d6e9f4; }
.review-kind-seasonal { background: #e8d8f0; }

/* --- Review log rows --- */
.review-log-list { display: flex; flex-direction: column; gap: 8px; }
.review-log-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--bg-page);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  text-align: left;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.review-log-row:hover {
  background: #fdf6dc;
  transform: translateY(-1px);
  box-shadow: 2px 4px 0 rgba(0,0,0,0.18);
}
.review-log-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.review-log-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}
.review-log-date {
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.review-log-row-body {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.review-log-total { margin-left: auto; font-size: 0.8rem; }
.review-log-stat { display: inline-flex; align-items: center; gap: 4px; }

/* --- Status dots: done / skipped / keep --- */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  flex-shrink: 0;
}
.status-done    { background: #9ecb8a; }   /* soft green  */
.status-skipped { background: #d6cfc4; }   /* muted stone */
.status-keep    { background: #f4b878; }   /* soft amber  */

/* Hide the colored status dots while filling out a review — the button
   labels ("done" / "skipped" / "keep") read clearly on their own and
   the dots added visual noise without adding information. Kept in the
   review log/history where they aid at-a-glance counting. */
.review-flow .status-dot { display: none; }

/* --- Review flow summary stats (at the top of the flow) ---------- */
.review-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--bg-page);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.18);
}
.review-stats-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.review-stats-caption {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 0.82rem;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}
.review-stats-pill {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 0.72rem;
  color: var(--ink);
  background: var(--bg-page);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  letter-spacing: 0.04em;
  box-shadow: 2px 2px 0 var(--ink);
}
.review-stats-pill.is-on {
  background: var(--highlight);
}
.review-stats-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Running log of past weeks this season — each week gets its own small
   stats box, stacked newest-first under the season summary. */
.review-past-weeks {
  margin: 18px 0 6px;
}
.review-past-weeks-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: 0.03em;
  display: inline-block;
  background: var(--highlight);
  border: 2px solid var(--ink);
  border-radius: 3px;
  padding: 3px 10px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}
.review-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 88px;
}
.review-stat-num {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 1.3rem;
  color: var(--ink);
  line-height: 1.1;
}
.review-stat-label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
  text-align: center;
}

/* --- Review flow rows --- */
.review-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.review-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.review-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.review-row {
  background: var(--bg-page);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.review-row.is-picked {
  background: #fdf6dc;
}
.review-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.review-row-text {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}
.review-keep-badge {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 0.7rem;
  background: #f4e2c8;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  padding: 1px 7px;
  color: var(--ink);
  white-space: nowrap;
}
.review-row-choices {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.review-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 0.8rem;
  background: var(--bg-page);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 1px 1px 0 var(--ink);
}
.review-choice:hover { background: #fdf6dc; }
.review-choice.is-active {
  background: var(--highlight);
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 var(--ink);
}

.review-flow-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.review-flow-actions .primary-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Reflection note: free-text journal entry on each review. */
.review-reflection {
  margin: 20px 0 16px;
}
.review-reflection-label {
  display: block;
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 6px;
}
.review-reflection-hint {
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-style: italic;
  margin-left: 4px;
}
.review-reflection-input {
  width: 100%;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  padding: 12px 14px;
  line-height: 1.6;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #fdf6e3;
  color: var(--ink);
  resize: vertical;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

/* In the review log, the saved reflection appears beneath the stats —
   italicized and indented so it reads as a journal quote rather than a
   caption. Clamp to a few lines so long reflections don't crowd the list. */
.review-log-reflection {
  margin: 6px 0 0;
  padding: 4px 0 0;
  border-top: 1px dashed var(--ink-soft, var(--ink));
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* --- Review detail modal (read-only list) --- */
.review-detail-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 50vh;
  overflow-y: auto;
}
.review-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bg-page);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  font-size: 0.9rem;
}
.review-item-text { flex: 1; color: var(--ink); }
.status-row-skipped .review-item-text { text-decoration: line-through; opacity: 0.75; }
.status-row-keep .review-item-text { font-style: italic; }


/* ==========================================================
   Mobile — review flow at ≤480px.
   ========================================================== */
@media (max-width: 480px) {
  .review-row {
    flex-wrap: wrap;
    row-gap: 6px;
    padding: 8px 10px;
  }
  .review-row .pill-group {
    flex-basis: 100%;
    justify-content: flex-start;
  }
  .review-item {
    flex-wrap: wrap;
    row-gap: 4px;
    padding: 6px 8px;
  }
  .review-header-subtitle { font-size: 0.85rem; }
}
