.results-gallery {
  position: relative;
  grid-template-rows: auto auto;
  align-content: start;
  padding-block: clamp(1.5rem, 4svh, 2.55rem) 1.65rem;
  padding-inline: clamp(1rem, 3vw, 3.5rem);
}
.results-gallery [hidden] { display: none !important; }

.scene-frame {
  position: absolute;
  z-index: 250;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.results-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 37rem) minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  padding: 0 0 .8rem;
  border-bottom: 1px solid var(--line);
}
.results-wordmark {
  grid-column: 1;
  justify-self: start;
  color: #19362e;
  font-size: 1.24rem;
  font-weight: 780;
  letter-spacing: -.055em;
  line-height: 1;
  text-decoration: none;
}
.results-header .search-form { grid-column: 2; width: min(100%, 37rem); min-height: 3.38rem; }
.results-header .search-form button { min-height: 2.45rem; }

@media (max-width: 840px) {
  .results-header { grid-template-columns: minmax(0, 1fr); gap: .48rem; }
  .results-wordmark { justify-self: center; font-size: 1rem; }
  .results-header .search-form { grid-column: 1; }
}

.proposal-workbench {
  display: grid;
  grid-template-columns: clamp(15rem, 21.5vw, 19rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(.85rem, 2.7vw, 2.75rem);
  padding: clamp(1.15rem, 3.1svh, 2.1rem) 0 0;
}
.proposal-compose { align-self: center; justify-self: center; width: min(100%, 18rem); min-width: 0; }
.book-toolbar, .mirror-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .45rem .7rem; min-height: 2.2rem; }
.book-toolbar { margin: 0 0 .78rem; }
.book-toolbar h2 { margin: 0; font-size: 1rem; }
.book-pagination, .mirror-actions { display: flex; align-items: center; gap: .35rem; }
.book-pagination span { color: #50685e; font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.book-pagination button, .mirror-actions button {
  min-height: 2rem;
  padding: .3rem .56rem;
  border: 1px solid #aabfb2;
  border-radius: .32rem;
  background: #fffdf6;
  color: #24554a;
  font-size: .85rem;
  font-weight: 660;
  cursor: pointer;
  white-space: nowrap;
}
.book-pagination button:hover:not(:disabled), .mirror-actions button:hover { background: #e7eee6; }
.book-pagination button:disabled { border-color: #dbded4; color: #707a73; cursor: default; }
.proposal-book { position: relative; perspective: 950px; }
.proposal-book::before, .proposal-book::after {
  position: absolute;
  inset: .32rem -.33rem -.32rem .33rem;
  z-index: -1;
  border: 1px solid #9aafa1;
  border-radius: .48rem;
  background: #f5f2e6;
  content: '';
}
.proposal-book::before { inset: .58rem -.6rem -.58rem .6rem; background: #eee8d9; }
.recipient-options label { position: relative; cursor: pointer; }
.recipient-options input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: inherit; }
.recipient-options input:focus-visible + span,
.results-gallery button:focus-visible, .results-gallery a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
.proposal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 27rem;
  padding: clamp(.9rem, 2vw, 1.55rem);
  border: 1.5px solid #2b6c60;
  border-radius: .55rem;
  background: #fffdf5;
  box-shadow: 0 .5rem 1.8rem #3c514611;
}
.proposal-card header { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.proposal-card h3 { margin: 0; font-size: clamp(1.22rem, 2.1vw, 1.72rem); }
.proposal-context { color: #50685e; font-size: .78rem; white-space: nowrap; }
.plan-price { display: flex; align-items: baseline; gap: .5rem; margin: .52rem 0 .8rem; color: #155c52; }
.plan-price strong { font-size: clamp(3.15rem, 5vw, 5.25rem); line-height: 1; font-variant-numeric: tabular-nums; }
.plan-price span { font-size: .99rem; font-weight: 700; }
.plan-highlights {
  display: grid;
  flex: 1;
  align-content: center;
  gap: .58rem;
  margin: 0 0 1rem;
  padding: .85rem 0 .95rem;
  border-block: 1px solid var(--line);
  list-style: none;
  line-height: 1.4;
}
.plan-highlights li { display: flex; align-items: center; gap: .52rem; font-size: .91rem; }
.plan-highlights li::before { flex: 0 0 .47rem; height: .47rem; border-radius: 50%; background: #3d8773; content: ''; }
.plan-highlights .limited { color: #904e3b; }
.plan-highlights .limited::before { background: #a35e48; }
.send-proposal {
  width: 100%;
  min-height: 2.72rem;
  padding: .58rem .75rem;
  border: 1px solid #154d43;
  border-radius: .32rem;
  background: #155c52;
  color: #fffdf1;
  font-weight: 700;
  cursor: pointer;
}
.send-proposal:hover { background: #124e46; }
.send-proposal:disabled { background: #e4ebe3; color: #4a5d54; border-color: #acbcb1; cursor: default; }
.proposal-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem; margin-top: .55rem; font-size: .85rem; }
.proposal-meta span { color: #50685e; }
.open-plan-details, .show-record {
  padding: .4rem .24rem;
  border: 0;
  border-radius: .14rem;
  background: transparent;
  color: var(--teal);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .18em;
  cursor: pointer;
  white-space: nowrap;
}

.mirror-workspace { min-width: 0; }
.mirror-toolbar { flex-wrap: wrap; }
.mirror-footer { position: relative; }
.open-finale {
  position: absolute;
  inset: 50% 0 auto auto;
  translate: 0 -50%;
  padding: .38rem .68rem;
  border: 1px solid #91aa9e;
  border-radius: .3rem;
  background: #fffdf6;
  color: #24554a;
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
}
.open-finale:hover { background: #e7eee6; }
.mirror-workspace .pagination button { width: clamp(1.35rem, 2.6vw, 2.3rem); }
.mirror-actions { margin-inline-start: auto; }
.mirror-actions span { display: inline-block; min-width: 1.2em; margin-inline-start: .34rem; border-radius: 99px; background: #e2ece2; text-align: center; font-variant-numeric: tabular-nums; }
.mirror-workspace .stage { height: clamp(21rem, calc(100svh - 15.5rem), 48rem); }
.mirror-workspace .observer { left: clamp(.1rem, 1.5vw, 2.75rem); }
.mirror-workspace .front-caption { gap: .28rem; }
.mirror-workspace .front-title { font-size: clamp(1.4rem, 2vw, 1.62rem); }
.mirror-workspace .back-content { line-height: 1.42; }
.mirror[data-trial="limited"] .mirror-trial-label { color: #934b36; }
.mirror[data-trial="fit"] .mirror-trial-label { color: #185b4b; }
.mirror[data-trial="pending"] .mirror-trial-label { color: #795127; }
.recipient-options { display: flex; flex-wrap: wrap; gap: .38rem .45rem; }
.recipient-options span {
  display: block;
  padding: .42rem .67rem;
  border: 1px solid #c2cfbf;
  border-radius: 999px;
  background: #fffdf6;
  color: #314e43;
  font-size: .84rem;
  line-height: 1.25;
}
.recipient-options span::before {
  display: inline-grid;
  place-items: center;
  width: .86rem;
  height: .86rem;
  margin-inline-end: .32rem;
  vertical-align: -.07rem;
  border: 1px solid #6c8a7d;
  border-radius: .19rem;
  content: '';
}
.recipient-options input:checked + span { color: #18473e; background: #e4efe6; border-color: #83a195; }
.recipient-options input:checked + span::before { background: #226b5d; color: #fff; content: '✓'; font-size: .67rem; line-height: 1; }

.dispatch-status { margin: .2rem 0; color: #50685e; font-size: .89rem; }
.dispatch-dialog .show-record { margin-top: .55rem; }
.dispatch-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); gap: .48rem; margin-top: .65rem; }
.trial-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: .45rem;
  row-gap: .15rem;
  padding: .57rem .72rem;
  border: 1px solid #c4cbbe;
  border-inline-start: 3px solid #a48956;
  border-radius: .26rem;
  background: #fffdf5;
  text-align: left;
  cursor: pointer;
}
.trial-card:hover { background: #f0f3ea; }
.trial-card[data-tone="fit"] { border-inline-start-color: #4d8c77; }
.trial-card[data-tone="limited"] { border-inline-start-color: #a9624d; }
.trial-card span { grid-column: 1; color: #50685e; font-size: .84rem; }
.trial-card .trial-card-more { grid-area: 1 / 2 / 3; align-self: center; color: var(--teal); text-decoration: underline; text-underline-offset: .15em; white-space: nowrap; }

.result-record {
  width: min(90vw, 37rem);
  max-height: calc(100svh - 2rem);
  overflow: auto;
  padding: clamp(.8rem, 3vw, 1.5rem);
  border: 1px solid #2f5149;
  border-radius: .25rem;
  background: #fffaf0;
  color: #253b32;
}
.result-record::backdrop { background: #172e2be0; }
.result-record header { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.result-record header span, .record-meta { color: #586e64; font-size: .9rem; }
.result-record h2 { margin: .25em 0 .5em; font-size: clamp(1.15rem, 4vw, 1.5rem); }
.result-record header button {
  padding: .05rem .5rem;
  border: 0;
  border-radius: .15rem;
  background: #ece7d9;
  font-size: 1.4rem;
  cursor: pointer;
}
.dialog-actions { display: flex; justify-content: flex-end; margin-top: .9rem; }
.dialog-actions button {
  padding: .44rem .9rem;
  border: 1px solid #154d43;
  border-radius: .28rem;
  background: #155c52;
  color: #fffdf1;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
}
.result-record p, .result-record dd { line-height: 1.55; }
.result-record dl { display: grid; gap: 1rem; }
.result-record dl div { border-top: 1px solid var(--line); padding-top: .65rem; }
.result-record dt { font-weight: 700; color: var(--teal); }
.result-record dd { margin: .25rem 0 0; }
.result-record a { color: var(--teal); text-underline-offset: .2em; }
.plan-details { width: min(93vw, 43rem); }
.plan-details .plan-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem .85rem; }
.plan-facts dd { margin-top: .12rem; overflow-wrap: anywhere; }
.trial-assumption { margin: .15rem 0 .85rem; }
.trial-detail { padding-block: .85rem .25rem; border-top: 1px solid var(--line); }
.trial-detail h3 { margin: 0 0 .28rem; font-size: 1.02rem; }
.trial-reason { margin: 0; }

@media (min-width: 761px) {
  .proposal-compose.is-scene-aligned {
    align-self: start;
    margin-block-start: var(--proposal-scene-offset);
  }
  .is-scene-aligned .proposal-card { min-height: var(--proposal-scene-height); }
  .is-scene-aligned .proposal-book::before, .is-scene-aligned .proposal-book::after { bottom: 0; }
  .mirror-workspace .stage { min-height: 27.5rem; }
}

@media (min-width: 761px) and (max-height: 720px) {
  .is-scene-aligned .proposal-card { padding-block: 1rem; }
  .is-scene-aligned .plan-price { margin-block: .36rem .58rem; }
  .is-scene-aligned .plan-price strong { font-size: clamp(3.15rem, 5vw, 4.4rem); }
}

@media (max-width: 760px) {
  .proposal-workbench { grid-template-columns: 1fr; gap: 1.6rem; }
  .proposal-card { min-height: 23.75rem; }
  .mirror-workspace .stage { height: clamp(18.25rem, 89vw, 32rem); }
  .mirror-workspace .back-content { font-size: 1.35rem; }
  .mirror-workspace .observer { left: -.7rem; }
}

@media (max-width: 520px) {
  .mirror-footer { display: grid; justify-items: center; gap: .3rem; }
  .open-finale { position: static; translate: none; }
  .recipient-options { gap: .35rem; }
  .recipient-options span { padding: .38rem .52rem; }
}

@media (max-width: 370px) {
  .plan-details .plan-facts, .dispatch-results { grid-template-columns: 1fr; }
}
