.mother-editor {
  --mother-paper: #fbf7f0;
  --mother-ink: #392628;
  --mother-muted: #645456;
  --mother-accent: #783243;
  --mother-edge: #e0cfc6;
  background: var(--mother-paper);
  color: var(--mother-ink);
  padding-block: clamp(18px, 2vw, 28px) clamp(46px, 6vw, 88px);
}
.mother-editor [hidden] { display: none !important; }
.mother-layout { max-width: 1120px; }
.mother-intro { margin-bottom: clamp(12px, 1.8vw, 22px); }
.mother-date { margin: 0 0 6px; color: var(--mother-accent); font-weight: 750; }
.mother-intro h1 {
  margin: 0;
  font-size: clamp(29px, 4.4vw, 48px);
  letter-spacing: -.046em;
  line-height: 1.04;
}
.mother-intro p:last-child {
  margin: 6px 0 0;
  color: var(--mother-muted);
  font-size: clamp(15px, 1.42vw, 18px);
}
.mother-templates {
  min-inline-size: 0;
  margin: 0 0 clamp(17px, 2vw, 24px);
  border: 1px solid var(--mother-edge);
  border-radius: 19px;
  padding: clamp(8px, 1.15vw, 14px);
  background: #f1e7df;
}
.mother-template-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 10px;
  margin: 0 4px 3px;
}
.mother-template-toolbar strong { font-size: 16px; }
.mother-faith-jump {
  min-height: 44px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--mother-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 720;
  text-decoration: underline;
  text-underline-offset: .18em;
  cursor: pointer;
}
.mother-template-gallery {
  --deck-columns: 8;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(4px, 1vw, 12px);
}
.mother-template-gallery button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #c8aca9;
  border-radius: 10px;
  background: #fff;
  color: var(--mother-accent);
  cursor: pointer;
}
.mother-template-gallery button:disabled { opacity: .47; cursor: default; }
.mother-template-gallery button:not(:disabled):hover { background: #f6e7e7; }
.mother-template-gallery button span {
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}
.mother-template-gallery .mother-template-prev span { transform: rotate(-135deg); }
.mother-template-list {
  position: relative;
  display: grid;
  grid-column: 2;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: max(68px, calc((100% - 56px) / var(--deck-columns)));
  gap: 7px;
  min-inline-size: 0;
  overflow-x: auto;
  padding: 4px 4px 7px;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 4px;
  scrollbar-width: thin;
}
@media (max-width: 750px) {
  .mother-template-gallery { --deck-columns: 5; }
}
.mother-template {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 4px 4px 6px;
  border: 2px solid transparent;
  border-radius: 13px;
  background: #fff;
  text-align: center;
  font-weight: 690;
  font-size: clamp(11px, 1.18vw, 14px);
  line-height: 1.25;
  cursor: pointer;
  scroll-snap-align: start;
}
.mother-template input {
  position: absolute;
  inset-block-start: 7px;
  inset-inline-start: 7px;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}
.mother-template img {
  display: block;
  width: 100%;
  height: clamp(64px, 7vw, 82px);
  border-radius: 8px;
  object-fit: contain;
}
.mother-template span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.mother-template:has(input:checked) { border-color: var(--mother-accent); background: #f6e7e7; }
.mother-template:has(input:focus-visible) { outline: 2px solid var(--mother-accent); outline-offset: 3px; }
.mother-workspace {
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
  grid-template-areas: "preview controls";
  align-items: start;
  gap: clamp(14px, 2.5vw, 32px);
}
.mother-preview, .mother-controls {
  border: 1px solid var(--mother-edge);
  border-radius: 19px;
  padding: clamp(14px, 2vw, 24px);
  min-width: 0;
}
.mother-preview {
  grid-area: preview;
  position: sticky;
  top: 18px;
  background: #eee4db;
  scroll-margin-top: 14px;
}
.mother-preview-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 5px 12px;
  margin-bottom: 10px;
}
.mother-preview-top span { color: var(--mother-muted); font-size: 13px; }
.mother-preview h2, .mother-controls h2 {
  margin: 0;
  font-size: clamp(21px, 2.05vw, 29px);
  line-height: 1.12;
}
.mother-art-frame {
  display: grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  min-height: 40px;
}
.mother-art-frame canvas {
  display: block;
  width: 100%;
  max-width: clamp(240px, 44vh, 380px);
  height: auto;
  border-radius: 8px;
  background: #fff8ee url("botanical.webp") center top / 100% auto no-repeat;
}
.mother-controls { grid-area: controls; display: grid; gap: 15px; background: #fff; margin: 0; }
.mother-field, .mother-pair { display: grid; gap: 6px; min-width: 0; }
.mother-field label, .mother-invite-fields legend { font-size: 14px; font-weight: 760; }
.mother-optional, .mother-count, .mother-help { color: var(--mother-muted); font-size: 12px; font-weight: 450; }
.mother-count { justify-self: end; }
.mother-field :is(input, textarea, select) {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #cbb6b0;
  border-radius: 8px;
  background: #fffdf9;
  color: var(--mother-ink);
  font: inherit;
  font-size: 16px;
}
.mother-field textarea { min-height: 94px; line-height: 1.45; resize: vertical; }
.mother-style { border-bottom: 1px solid var(--mother-edge); padding: 0 0 14px; }
.mother-style summary { color: var(--mother-accent); font-size: 14px; font-weight: 730; cursor: pointer; }
.mother-style .mother-pair { margin-top: 10px; }
.mother-pair { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.mother-options { display: grid; gap: 3px; }
.mother-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 37px;
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
}
.mother-option input { width: 19px; height: 19px; accent-color: var(--mother-accent); }
.mother-invite-fields {
  min-width: 0;
  margin: 0;
  display: grid;
  gap: 11px;
  border: 1px solid var(--mother-edge);
  border-radius: 11px;
  padding: 10px 13px 13px;
  background: #fcf7f2;
}
.mother-invite-fields legend { padding-inline: 4px; }
.mother-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mother-actions :is(button, a) {
  min-height: 44px;
  border: 1px solid var(--mother-accent);
  border-radius: 8px;
  padding: 9px 15px;
  font: inherit;
  font-size: 14px;
  font-weight: 760;
  text-align: center;
}
.mother-actions button:disabled { opacity: .55; cursor: wait; }
.mother-download { background: var(--mother-accent); color: white; }
.mother-share, .mother-jump { background: white; color: var(--mother-accent); }
.mother-jump { display: none; }
.mother-status { margin: 9px 0 0; color: #7a251b; font-size: 14px; }
.mother-help { margin: -6px 0 0; }
.mother-editor :is(a,button,select,input,textarea,summary):focus-visible {
  outline: 2px solid var(--mother-accent);
  outline-offset: 2px;
}
@media (max-width: 750px) {
  .mother-editor { padding-top: 19px; }
  .mother-intro { margin-bottom: 13px; }
  .mother-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "preview" "controls";
  }
  .mother-preview { position: static; }
  .mother-art-frame canvas { max-width: min(52vw, 235px); }
  .mother-jump { display: inline-flex; align-items: center; }
}
@media (max-width: 385px) {
  .mother-pair:not(.mother-when) { grid-template-columns: minmax(0,1fr); }
}

.mother-send-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--mother-edge);
  border-radius: 12px;
  padding: 13px;
  background: #faf3ed;
}
.mother-send-box h3 { margin: 0; font-size: 15px; }
.mother-channels { display: flex; flex-wrap: wrap; gap: 7px; }
.mother-channels a {
  display: inline-flex;
  align-items: center;
  min-height: 43px;
  padding: 8px 10px;
  border: 1px solid #c7a3a6;
  border-radius: 8px;
  background: white;
  color: var(--mother-accent);
  font-size: 14px;
  font-weight: 720;
}
.mother-channels a:hover { background: #fae5e5; }
.mother-send-box p { margin: 0; }
.mother-channels a[aria-disabled="true"] { opacity: .55; cursor: wait; }
.mother-send-box .mother-status:empty { display: none; }
.mother-send-link {
  justify-self: start;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--mother-accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .18em;
}
#mother-app-help { margin-top: 3px; padding-top: 9px; border-top: 1px solid var(--mother-edge); }
#mother-app-help .mother-send-link { display: inline-block; margin: 6px 12px 6px 0; }
#mother-app-message { display: block; width: 100%; min-height: 4.5em; }
.mother-recipient { text-align: center; }
.mother-recipient h1 { margin: 0 0 15px; font-size: clamp(34px, 5vw, 53px); }
.mother-received-art {
  display: block;
  width: min(100%, 490px);
  height: auto;
  border: 1px solid var(--mother-edge);
  border-radius: 10px;
  margin: 0 auto 16px;
}
.mother-recipient .mother-actions { justify-content: center; }
.mother-recipient .mother-actions .mother-download { color: white; }
