.impact-surface,
.impact-surface *,
.impact-surface *::before,
.impact-surface *::after {
  box-sizing: border-box;
}

body.beta-mvp #impact {
  min-width: 0;
  padding: 0 0 calc(96px + env(safe-area-inset-bottom, 0px));
  background: #fff;
}

.impact-surface {
  width: min(100%, 760px);
  min-width: 0;
  margin: 0 auto;
  padding: 0 clamp(14px, 4vw, 22px) 28px;
  background: #fff;
  color: var(--text, #153529);
}

.reflection-hero {
  padding: clamp(25px, 7vw, 40px) 2px 20px;
}

.reflection-hero > span,
.reflection-performance-heading > span,
.reflection-section-heading > div > span,
.reflection-empty-state > span,
.reflection-editor-intro > span {
  display: block;
  margin-bottom: 6px;
  color: #2c7a4b;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.reflection-hero h1,
.reflection-hero p,
.reflection-performance-heading h2,
.reflection-performance-heading p,
.reflection-page-section h2,
.reflection-page-section h3,
.reflection-page-section p,
.reflection-empty-state h2,
.reflection-empty-state p,
.reflection-editor h2,
.reflection-editor h3,
.reflection-editor p {
  margin-top: 0;
}

.reflection-hero h1 {
  max-width: 620px;
  margin-bottom: 8px;
  color: var(--text, #153529);
  font-size: clamp(1.65rem, 7vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: -.04em;
}

.reflection-hero p,
.reflection-empty-state p,
.reflection-editor-intro p,
.reflection-empty-inline {
  color: #637168;
  line-height: 1.48;
}

.reflection-hero p {
  max-width: 580px;
  margin-bottom: 0;
  font-size: .78rem;
}

.reflection-hero.error {
  padding-left: 14px;
  border-left: 4px solid #b95645;
}

.reflection-performance-shell {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 20px 18px;
  border: 1px solid #dce7df;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(23, 57, 38, .07);
}

.reflection-performance-heading {
  display: grid;
  gap: 4px;
}

.reflection-performance-heading h2,
.reflection-performance-heading p {
  margin-bottom: 0;
}

.reflection-performance-heading h2 {
  color: #17342e;
  font-size: clamp(1.25rem, 5.5vw, 1.7rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.reflection-performance-heading p {
  max-width: 560px;
  color: #637168;
  font-size: .73rem;
  line-height: 1.45;
}

.reflection-page-section,
.reflection-empty-state {
  min-width: 0;
  padding: 17px;
  border: 1px solid #dfe9e2;
  border-radius: 20px;
  background: linear-gradient(145deg, #fbfdfb, #f5faf7);
}

.reflection-empty-state {
  display: grid;
  justify-items: start;
}

.reflection-empty-state h2 {
  max-width: 560px;
  margin-bottom: 7px;
  color: #17342e;
  font-size: clamp(1.16rem, 5vw, 1.45rem);
  line-height: 1.12;
  letter-spacing: -.025em;
}

.reflection-empty-state p {
  max-width: 540px;
  margin-bottom: 16px;
  font-size: .75rem;
}

.reflection-section-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 13px;
}

.reflection-section-heading h2 {
  margin-bottom: 0;
  color: #17342e;
  font-size: clamp(1.08rem, 4.5vw, 1.3rem);
  letter-spacing: -.025em;
}

.reflection-section-heading .text-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 5px 4px;
  border: 0;
  background: transparent;
  color: #21683f;
  font-size: .72rem;
  font-weight: 850;
}

.reflection-section-heading .text-button:disabled {
  display: none;
}

.reflection-area-chips,
.reflection-current-areas,
.reflection-custom-selections {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.reflection-area-chips {
  margin-bottom: 13px;
}

.reflection-area-chips > span,
.reflection-current-areas > strong,
.reflection-custom-selections > span {
  display: inline-flex;
  max-width: 100%;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #cfe0d4;
  border-radius: 999px;
  background: #eff8f2;
  color: #185c35;
  font-size: .7rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.reflection-area-chips i,
.reflection-current-areas i {
  color: #197243;
  font-style: normal;
}

.reflection-review-action {
  width: 100%;
  min-height: 44px;
  margin: 0 0 14px;
  border: 1px solid #c8ddcf;
  border-radius: 15px;
  background: #f2faf5;
  color: #185c35;
  font-weight: 850;
}

.reflection-comparison-grid {
  display: grid;
  gap: 10px;
}

.reflection-comparison-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid #dfe8e1;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(23, 57, 38, .045);
}

.reflection-comparison-card.improved {
  border-color: #c8e1d0;
  background: linear-gradient(145deg, #fff, #f8fcf9);
  box-shadow: 0 10px 24px rgba(25, 114, 67, .08);
}

.reflection-comparison-card > header {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.reflection-comparison-card > header span {
  color: #718078;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.reflection-comparison-card h3 {
  margin: 3px 0 0;
  color: #17342e;
  font-size: .96rem;
}

.reflection-card-menu {
  position: relative;
  flex: 0 0 auto;
}

.reflection-card-menu summary {
  display: grid;
  width: 38px;
  min-height: 38px;
  place-items: center;
  border-radius: 11px;
  color: #617168;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
  list-style: none;
}

.reflection-card-menu summary::-webkit-details-marker { display: none; }
.reflection-card-menu[open] summary { background: #eef3ef; }

.reflection-card-menu > div {
  position: absolute;
  top: 40px;
  right: 0;
  z-index: 35;
  display: grid;
  width: min(220px, calc(100vw - 68px));
  padding: 7px;
  border: 1px solid #d7e2da;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(11, 41, 29, .18);
}

.reflection-card-menu button {
  min-height: 42px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #17342e;
  font-size: .74rem;
  font-weight: 750;
  text-align: left;
}

.reflection-card-menu button:hover,
.reflection-card-menu button:focus-visible { background: #f2f6f3; }
.reflection-card-menu button.danger { color: #9c493d; }

.reflection-before-current {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 17px 0 12px;
}

.reflection-before-current > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.reflection-before-current > div:last-child { text-align: right; }
.reflection-before-current > div > span { color: #718078; font-size: .64rem; font-weight: 750; }
.reflection-before-current strong { color: #17342e; font-size: clamp(1.2rem, 5.5vw, 1.55rem); overflow-wrap: anywhere; }
.reflection-before-current small { color: #7a877f; font-size: .59rem; }
.reflection-before-current > i { color: #6c7e73; font-size: 1.15rem; font-style: normal; text-align: center; }

.reflection-rating-readout {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.reflection-rating-readout b { font-size: 1em; }
.reflection-rating-readout small { color: #748078; font-size: .55em; font-weight: 800; }
.reflection-rating-empty { color: #94a098; font-weight: 700; }

.reflection-change,
.reflection-baseline-status {
  display: inline-flex;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 10px;
  background: #f0f4f1;
  color: #465d50;
  font-size: .74rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.reflection-change.improved {
  background: #eaf7ee;
  color: #17663a;
}

.reflection-change.changed {
  background: #f4f2ed;
  color: #665b49;
}

.reflection-comparison-card > p {
  margin: 9px 0 0;
  color: #718078;
  font-size: .67rem;
  line-height: 1.4;
}

.reflection-comparison-card > button.compact {
  min-height: 40px;
  margin-top: 11px;
  padding: 8px 12px;
}

.reflection-journey {
  background: #fff;
}

.reflection-journey-list {
  display: grid;
  gap: 8px;
}

.reflection-journey-list article {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 13px;
  border: 1px solid #e0e8e2;
  border-radius: 15px;
  background: #fff;
}

.reflection-journey-list article > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.reflection-journey-list h3 {
  min-width: 0;
  margin-bottom: 0;
  font-size: .76rem;
  overflow-wrap: anywhere;
}

.reflection-journey-list strong {
  flex: 0 0 auto;
  color: #17342e;
  font-size: 1rem;
  white-space: nowrap;
}

.reflection-journey-list strong i {
  color: #7b8980;
  font-style: normal;
  font-weight: 500;
}

.reflection-journey-list p {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 0;
  color: #718078;
  font-size: .63rem;
}

.reflection-journey-list small {
  color: #607067;
  font-size: .64rem;
}

.reflection-journey-list article.improved small { color: #17663a; font-weight: 750; }

.reflection-empty-inline {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px dashed #d4e0d7;
  border-radius: 13px;
  font-size: .72rem;
}

.impact-status-message {
  position: sticky;
  top: calc(68px + env(safe-area-inset-top, 0px));
  z-index: 45;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #c8e1d0;
  border-radius: 13px;
  background: rgba(255, 255, 255, .98);
  color: #17342e;
  font-size: .74rem;
  box-shadow: 0 9px 22px rgba(23, 57, 38, .1);
}

.reflection-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: grid;
  align-items: end;
  padding: max(12px, env(safe-area-inset-top, 0px)) 10px max(10px, env(safe-area-inset-bottom, 0px));
  background: rgba(4, 20, 14, .54);
  backdrop-filter: blur(5px);
}

.reflection-editor {
  position: relative;
  width: min(100%, 620px);
  max-height: min(90vh, 780px);
  margin: 0 auto;
  padding: 24px 18px 20px;
  overflow: auto;
  border: 1px solid #dce5de;
  border-radius: 26px 26px 18px 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(2, 18, 11, .3);
  animation: reflection-editor-arrive .3s cubic-bezier(.16, 1, .3, 1) both;
}

.reflection-editor-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 40px;
  min-height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #eef3ef;
  color: #294735;
  font-size: 1.25rem;
}

.reflection-editor-intro { padding-right: 38px; }
.reflection-editor-intro h2 { margin-bottom: 6px; color: #17342e; font-size: clamp(1.3rem, 6vw, 1.8rem); letter-spacing: -.035em; }
.reflection-editor-intro p { margin-bottom: 17px; font-size: .79rem; }

.reflection-current-areas {
  align-items: center;
  margin: -3px 0 15px;
}

.reflection-current-areas > span {
  width: 100%;
  color: #718078;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.reflection-choice-group > div:first-child h3 {
  margin-bottom: 4px;
  color: #17342e;
  font-size: .9rem;
}

.reflection-choice-group > div:first-child p {
  margin-bottom: 10px;
  color: #637168;
  font-size: .69rem;
}

.reflection-choice-group > div:last-child {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reflection-choice-group button {
  display: flex;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid #d6e1d9;
  border-radius: 14px;
  background: #f8faf8;
  color: #294735;
  text-align: left;
}

.reflection-choice-group button strong {
  min-width: 0;
  font-size: .72rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.reflection-choice-group button i {
  flex: 0 0 auto;
  color: #6f7d74;
  font-size: 1rem;
  font-style: normal;
}

.reflection-choice-group button.selected {
  border-color: #197243;
  background: #197243;
  color: #fff;
  box-shadow: 0 6px 14px rgba(25, 114, 67, .17);
}

.reflection-choice-group button.selected i { color: #fff; }
.reflection-choice-group button:disabled:not(.selected) { opacity: .38; }

.reflection-custom-selections {
  margin-top: 11px;
}

.reflection-custom-selections > span button {
  display: grid;
  width: 24px;
  min-height: 24px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #dfece3;
  color: #31533e;
}

.reflection-custom-action,
.reflection-continue-action {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
}

.reflection-editor-note {
  margin: 10px 0 0;
  color: #637168;
  font-size: .69rem;
  text-align: center;
}

.reflection-editor-form {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.reflection-editor-form.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reflection-editor-form label { display: grid; min-width: 0; gap: 6px; color: #637168; font-size: .72rem; font-weight: 750; }

.reflection-editor-form input,
.reflection-editor-form select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 11px;
  border: 1px solid #d2dfd6;
  border-radius: 12px;
  background: #fff;
  color: #17342e;
  font: inherit;
}

.reflection-rating-scale {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.reflection-rating-scale legend {
  margin-bottom: 11px;
  color: #17342e;
  font-size: .8rem;
  font-weight: 850;
  line-height: 1.4;
}

.reflection-rating-scale > div {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.reflection-rating-scale button {
  display: grid;
  min-width: 0;
  min-height: 58px;
  padding: 6px 2px;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 1px solid #d6e1d9;
  border-radius: 11px;
  background: #f8faf8;
  color: #496052;
}

.reflection-rating-scale button strong { font-size: .95rem; }
.reflection-rating-scale button small { min-height: 1.8em; color: inherit; font-size: clamp(.46rem, 2vw, .56rem); font-weight: 750; line-height: 1.05; }

.reflection-rating-scale button.selected {
  border-color: #197243;
  background: #197243;
  color: #fff;
  box-shadow: 0 5px 12px rgba(25, 114, 67, .18);
}

.reflection-editor > .primary {
  width: 100%;
  min-height: 46px;
}

@keyframes reflection-editor-arrive {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (min-width: 700px) {
  .reflection-comparison-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reflection-comparison-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .reflection-editor-backdrop { align-items: center; }
  .reflection-editor { border-radius: 26px; }
}

@media (max-width: 390px) {
  .impact-surface { padding-inline: 12px; }
  .reflection-performance-shell { padding-inline: 14px; border-radius: 22px; }
  .reflection-page-section,
  .reflection-empty-state { padding: 14px; }
  .reflection-before-current { gap: 5px; }
  .reflection-before-current strong { font-size: 1.1rem; }
  .reflection-editor { padding-inline: 14px; }
}

@media (max-width: 340px) {
  .reflection-choice-group > div:last-child,
  .reflection-editor-form.two-column { grid-template-columns: 1fr; }
  .reflection-rating-scale button { min-height: 54px; }
  .reflection-rating-scale button small { font-size: .47rem; }
  .reflection-journey-list article > div { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .reflection-editor { animation: none; }
}
