.garden-companion {
  overflow: hidden;
  color: #e9eddf;
  background: #19362e;
  border: 1px solid #779481;
  border-radius: 24px;
  padding: 0;
  width: min(540px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  box-shadow: 0 22px 90px #071a17b3;
}
.garden-companion::backdrop {
  background: #071a17ed;
}
.garden-companion[open] {
  display: flex;
  flex-direction: column;
}
.garden-companion header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #4d6c58;
  flex-shrink: 0;
}
.garden-companion .companion-eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c5cf9d;
  margin: 0 0 5px;
}
.garden-companion h2 {
  font:
    500 29px Georgia,
    serif;
  margin: 0;
}
.garden-companion .companion-body {
  overflow: auto;
  padding: 4px 24px 28px;
  min-height: 0;
}
.garden-companion p {
  line-height: 1.55;
  font-size: 14px;
  color: #d3ddcc;
  margin: 9px 0 16px;
}
.garden-companion section {
  padding: 19px 0;
  border-top: 1px solid #4d6c58;
}
.garden-companion section:first-of-type {
  border-top: 0;
  padding-top: 8px;
}
.garden-companion h3 {
  font:
    500 19px Georgia,
    serif;
  margin: 0 0 8px;
}
.garden-companion label {
  display: block;
  font-size: 14px;
  margin-bottom: 7px;
}
.garden-companion input {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: #f5f3e4;
  color: #19362e;
  font: inherit;
  border: 1px solid #bfc8a0;
  border-radius: 10px;
  min-height: 46px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.garden-companion button,
.garden-companion-invite button {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 15px;
  border-radius: 12px;
  border: 1px solid #d1d8ac;
  background: #d1d8ac;
  color: #18372c;
  font:
    600 14px ui-sans-serif,
    system-ui,
    sans-serif;
  white-space: normal;
}
.garden-companion button.companion-secondary,
.garden-companion button[data-close] {
  background: transparent;
  color: #e9eddf;
  border-color: #779481;
}
.garden-companion button.companion-secondary {
  margin: 10px 0 0 10px;
}
.garden-companion button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.garden-companion button:focus-visible,
.garden-companion input:focus-visible,
.garden-companion-invite button:focus-visible {
  outline: 3px solid #f1cd88;
  outline-offset: 3px;
}
.garden-companion [hidden],
.garden-companion-invite[hidden] {
  display: none !important;
}
.garden-companion .companion-footnote {
  font-size: 12px;
  margin-bottom: 0;
}
.garden-companion-invite {
  position: absolute;
  z-index: 20;
  inset: 6px 0;
  box-sizing: border-box;
  padding: 12px 14px;
  display: flex;
  justify-content: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  background: #19362e;
  color: #e9eddf;
  border: 1px solid #779481;
  border-radius: 16px;
  box-shadow: 0 10px 45px #071a1759;
}
.garden-companion-invite div {
  width: 100%;
}
.garden-companion-invite strong {
  font:
    500 19px Georgia,
    serif;
}
.garden-companion-invite p {
  margin: 3px 0;
  font-size: 14px;
}
.garden-companion-invite button[data-later] {
  background: transparent;
  border-color: #779481;
  color: #e9eddf;
}
@media (max-width: 380px) {
  .garden-companion header {
    padding: 18px 16px;
    gap: 8px;
  }
  .garden-companion .companion-body {
    padding: 4px 16px 24px;
  }
  .garden-companion h2 {
    font-size: 25px;
  }
}

.garden-companion [data-state="error"] {
  color: #ffe0d4;
  border-left: 3px solid #dba68e;
  background: #483e32;
  padding: 10px 12px;
  border-radius: 3px 8px 8px 3px;
}

.garden-companion .companion-body {
  scroll-padding-block: 20px;
}
.garden-companion form button {
  margin-bottom: 8px;
}
@media (max-width: 599px) and (orientation: landscape) {
  .garden-companion-invite p {
    display: none;
  }
  .garden-companion-invite strong {
    font-size: 16px;
  }
  .garden-companion-invite button {
    padding: 5px 8px;
    font-size: 12px;
  }
  .garden-companion-invite {
    gap: 3px;
    padding: 4px;
  }
}

footer:has(.garden-companion-invite:not([hidden]))
  > :not(.garden-companion-invite) {
  visibility: hidden;
}

.companion-options {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-block: 8px 16px;
}
.companion-options #sound-toggle {
  background: transparent;
  color: #e9eddf;
  border-color: #779481;
}
.companion-options a {
  color: #d3ddcc;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding-inline: 8px;
}

/* ---------- Daily-garden hour and notices ---------- */
.companion-hour {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 6px;
}
.garden-companion .companion-hour label {
  margin: 0;
}
.garden-companion select {
  min-height: 44px;
  min-width: 112px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #bfc8a0;
  background: #f5f3e4;
  color: #19362e;
  font: inherit;
  font-size: 15px;
}
.garden-companion select:disabled {
  opacity: 0.6;
}
.garden-companion select:focus-visible {
  outline: 3px solid #f1cd88;
  outline-offset: 3px;
}
.garden-companion section > button {
  margin: 10px 10px 0 0;
}
.garden-companion section > button.companion-secondary {
  margin: 10px 10px 0 0;
}
.garden-companion-invite.companion-notice p,
.garden-companion-invite.install-welcome p {
  font-size: 13px;
}
.garden-companion-invite.companion-notice button,
.garden-companion-invite.install-welcome button {
  background: transparent;
  color: #e9eddf;
  border-color: #779481;
}

/* ---------- Install sheet (Android prompt, iPhone guide, other browsers) ---------- */
.install-sheet,
.daily-done {
  color: #e9eddf;
  border: 1px solid #60735a;
  background:
    radial-gradient(ellipse at 50% 0%, #2c4a3a55, transparent 60%), #142b24;
  box-shadow: 0 28px 100px #0008;
  padding: 0;
}
.install-sheet::backdrop,
.daily-done::backdrop {
  background: #061710b0;
  backdrop-filter: blur(6px);
}
.install-sheet {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  border-radius: 24px;
  overflow: auto;
}
.install-body {
  padding: 22px 24px 20px;
}
.install-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #ced8b4;
}
.install-sheet h2 {
  margin: 0 0 10px;
  font:
    normal 25px/1.2 Georgia,
    serif;
  color: #f0eacc;
  text-wrap: balance;
}
.install-sheet p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.5;
  color: #dfe3cf;
  text-wrap: pretty;
}
.install-sheet .install-small {
  font-size: 13px;
  color: #b9c8b3;
}
.install-steps {
  list-style: none;
  margin: 4px 0 16px;
  padding: 0;
  display: grid;
  gap: 10px;
}
.install-steps li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: #0f231d99;
  border: 1px solid #60735a44;
  font-size: 14px;
  line-height: 1.45;
  color: #dfe3cf;
  text-align: left;
}
.install-steps strong {
  color: #f0e3a8;
  font-weight: 600;
}
.install-step-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f5f3e4;
  display: grid;
  place-items: center;
}
.install-step-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #1f6fd6;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.install-step-icon svg circle {
  fill: #1f6fd6;
  stroke: none;
}
.install-step-home {
  background: transparent;
}
.install-step-home img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.install-actions,
.daily-done-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.install-actions button,
.daily-done-actions button,
.daily-done-fallback button,
.daily-done-next button {
  min-height: 46px;
  padding: 8px 18px;
  border-radius: 23px;
  border: 1px solid transparent;
  background: transparent;
  color: #c5d3bf;
  font:
    15px ui-sans-serif,
    system-ui,
    sans-serif;
  cursor: pointer;
}
.install-actions .install-primary,
.daily-done-actions .primary {
  background: #e6d28a;
  color: #233529;
  font-weight: 600;
}
.install-actions button:focus-visible,
.daily-done button:focus-visible {
  outline: 2px solid #f2d88d;
  outline-offset: 3px;
}
.install-actions button:disabled,
.daily-done button:disabled {
  opacity: 0.6;
  cursor: default;
}
@media (max-width: 599px) {
  /* On phones the sheet rises from the bottom edge, close to the thumb. */
  .install-sheet[open] {
    margin: auto 0 0;
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
}
@media (max-width: 380px) {
  .install-body {
    padding: 18px 16px 16px;
  }
  .install-sheet h2 {
    font-size: 22px;
  }
  .install-sheet p {
    font-size: 14px;
  }
  .install-steps {
    gap: 8px;
    margin-bottom: 12px;
  }
  .install-steps li {
    padding: 8px 10px;
    font-size: 13.5px;
  }
}

/* ---------- Daily garden in bloom: share card ---------- */
.daily-done {
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  border-radius: 24px;
  overflow: auto;
  padding: 18px 22px 16px;
  text-align: center;
}
.daily-done-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border: 1px solid #5e725455;
  border-radius: 50%;
  background: #142b24cc;
  color: #b8c7ad;
  font: 27px Georgia;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}
.daily-done-preview {
  position: relative;
  height: clamp(150px, 34svh, 340px);
  aspect-ratio: 4 / 5;
  margin: 4px auto 12px;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, #2c4a3a, transparent 70%), #0f231d;
  box-shadow:
    0 0 0 1px #60735a88,
    0 18px 50px #0007;
}
.daily-done-preview img {
  display: block;
  width: 100%;
  height: 100%;
}
.daily-done-preview img[hidden] {
  display: none;
}
.daily-done-preview img:not([hidden]) + .daily-done-placeholder {
  display: none;
}
.daily-done-placeholder {
  position: absolute;
  inset: 30% 20%;
  border-radius: 12px;
  background: #213a31;
  opacity: 0.6;
}
.daily-done .eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #ced8b4;
}
#daily-done-title {
  margin: 6px 0 4px;
  font:
    normal 25px/1.2 Georgia,
    serif;
  color: #f0eacc;
  text-wrap: balance;
}
.daily-done-line {
  margin: 0 0 10px;
  font-size: 14px;
  color: #cfdac6;
}
/* Your place among everyone today: arrives quietly, a little light for #1. */
.daily-done-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 2px auto 8px;
  max-width: 340px;
  text-align: left;
}
.daily-done-rank[hidden] {
  display: none;
}
.daily-done-rank .rank-badge {
  flex: none;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  border-radius: 20px;
  border: 1px solid #e6d28a77;
  color: #f0e3a8;
  font:
    600 14px ui-sans-serif,
    system-ui,
    sans-serif;
  font-variant-numeric: tabular-nums;
  background: #0f231d99;
}
.daily-done-rank .rank-words {
  font-size: 14px;
  line-height: 1.35;
  color: #e9e4c8;
}
.daily-done-rank small {
  display: block;
  margin-top: 1px;
  font-size: 12.5px;
  color: #b9c8b3;
}
.daily-done-rank[data-tier="first"] .rank-badge {
  border-color: #f4df95;
  color: #233529;
  background: radial-gradient(circle at 50% 40%, #fff2c2, #e6d28a 70%);
  box-shadow: 0 0 18px #f4df9577;
}
.daily-done-rank[data-tier="early"] .rank-badge {
  border-color: #e6d28acc;
  box-shadow: 0 0 10px #e6d28a33;
}
.daily-done-rank.arrived {
  animation: rank-arrive 0.6s ease-out both;
}
.daily-done-rank.arrived[data-tier="first"] .rank-badge {
  animation: first-light 2.4s ease-out 0.2s both;
}
@keyframes rank-arrive {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
@keyframes first-light {
  0% {
    box-shadow: 0 0 0 #f4df9500;
  }
  35% {
    box-shadow: 0 0 30px 6px #f4df95aa;
  }
  100% {
    box-shadow: 0 0 18px #f4df9577;
  }
}

/* A run of days: a lantern per day along a little path. */
.daily-done-streak {
  margin: 0 auto 8px;
  max-width: 320px;
}
.daily-done-streak[hidden] {
  display: none;
}
.daily-done-streak p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: #cfdac6;
}
.daily-done-streak strong {
  display: block;
  font:
    normal 17px Georgia,
    serif;
  color: #f0e3a8;
}
.lantern-path svg {
  display: block;
  width: 100%;
  height: 64px;
  overflow: visible;
}
.lantern-path .ground {
  fill: none;
  stroke: #60735a;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 1 5;
}
.lantern-path .post {
  stroke: #6d7f63;
  stroke-width: 1.4;
}
.lantern-path .cap {
  stroke: #9aa98a;
  stroke-width: 1.4;
  stroke-linecap: round;
}
.lantern-path .shade {
  fill: #f4df9555;
  stroke: #e6d28a;
  stroke-width: 1;
}
.lantern-path .flame {
  fill: #fff2c2;
}
.lantern-path .glow {
  opacity: 0.55;
}
.lantern-path .newest .glow {
  opacity: 0.8;
}
.lantern-path .garland {
  fill: none;
  stroke: #9dbb8a88;
  stroke-width: 1;
}
.lantern-path .bead {
  fill: #f4df95;
  opacity: 0.8;
}
.lantern-path .firefly {
  fill: #e9f5a8;
  opacity: 0.7;
}
.lantern-path .moon-halo {
  fill: #f3efdc;
  opacity: 0.1;
}
.lantern-path .moon-disc {
  fill: #f3efdc;
  opacity: 0.9;
}
/* Lighting: each lantern kindles in turn, the newest last and warmest; the
   fireflies drift in and the moon rises. Transform/opacity only. */
.daily-done-streak.lighting .lantern :is(.shade, .flame, .glow) {
  animation: lantern-kindle 0.7s ease-out both;
  animation-delay: calc(450ms + var(--i) * 260ms);
  transform-box: fill-box;
  transform-origin: center;
}
.daily-done-streak.lighting .lantern.newest .glow {
  animation-name: lantern-kindle-newest;
  animation-duration: 1.4s;
}
.daily-done-streak.lighting .firefly {
  animation:
    firefly-in 1.2s ease-out both,
    firefly-drift 5.5s ease-in-out infinite alternate;
  animation-delay: calc(900ms + var(--i) * 170ms), calc(var(--i) * -700ms);
  transform-box: fill-box;
}
.daily-done-streak.lighting .moon {
  animation: moon-rise 2.2s ease-out 0.3s both;
}
.daily-done-streak.lighting .garland,
.daily-done-streak.lighting .bead {
  animation: firefly-in 1s ease-out 1.8s both;
}
@keyframes lantern-kindle {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}
@keyframes lantern-kindle-newest {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  45% {
    opacity: 1;
    transform: scale(1.5);
  }
  100% {
    opacity: 0.8;
    transform: scale(1);
  }
}
@keyframes firefly-in {
  from {
    opacity: 0;
  }
}
@keyframes firefly-drift {
  to {
    transform: translate(4px, -3px);
  }
}
@keyframes moon-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .daily-done-streak.lighting *,
  .daily-done-rank.arrived,
  .daily-done-rank.arrived .rank-badge {
    animation: none !important;
  }
}
/* Room for the lanterns and the place on short screens. */
@media (max-height: 700px) {
  .daily-done:has(.daily-done-streak:not([hidden])) .daily-done-preview {
    height: clamp(120px, 26svh, 300px);
  }
}
.daily-done-fallback {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.daily-done-fallback[hidden],
.daily-done-next[hidden],
.daily-done-fallback button[hidden] {
  display: none;
}
.daily-done-fallback button {
  border-color: #779481;
  color: #e9eddf;
}
.daily-done-status {
  margin: 6px 0 0;
  font-size: 13px;
  color: #e6d28a;
  overflow-wrap: anywhere;
}
.daily-done-status:empty {
  display: none;
}
.daily-done-next {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #0f231d99;
  border: 1px solid #60735a44;
}
.daily-done-next p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #cfdac6;
}
.daily-done-next button {
  width: 100%;
  border-color: #e6d28a88;
  color: #f0e3a8;
}
@media (max-width: 380px), (max-height: 640px) {
  .daily-done {
    padding: 14px 16px 12px;
  }
  #daily-done-title {
    font-size: 21px;
  }
  .daily-done-line {
    font-size: 13px;
    margin-bottom: 6px;
  }
  .daily-done-next {
    margin-top: 8px;
    padding: 8px 10px;
  }
}
@media (max-height: 640px) {
  .daily-done-next p {
    display: none;
  }
}
@media (min-width: 560px) and (max-height: 560px) {
  /* Short landscape screens: picture beside the words. */
  .daily-done {
    width: min(640px, calc(100vw - 24px));
    text-align: left;
  }
  .daily-done[open] {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 20px;
    align-items: start;
  }
  .daily-done-card {
    display: contents;
  }
  .daily-done-preview {
    grid-row: 1 / span 6;
    height: min(62svh, 300px);
    margin: 0;
  }
  .daily-done-copy,
  .daily-done-actions,
  .daily-done-fallback,
  .daily-done-status,
  .daily-done-next {
    grid-column: 2;
  }
}
@media (prefers-reduced-motion: reduce) {
  .install-sheet::backdrop,
  .daily-done::backdrop {
    backdrop-filter: none;
  }
}

#daily-done-title:focus,
#install-title:focus {
  outline: none;
}

/* ---------- Shared game dialog shell for Garden settings and Feedback ----------
 * Matches the story, map and daily cards: serif titles, an outlined 44px ×,
 * a blurred backdrop and dark, garden-toned fields. (Loaded before style.css,
 * so feedback overrides carry :root for precedence.) */
.garden-companion,
:root #feedback-dialog {
  color: #e9eddf;
  border: 1px solid #60735a;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 50% 0%, #2c4a3a55, transparent 60%), #142b24;
  box-shadow: 0 28px 100px #0008;
}
.garden-companion::backdrop,
:root #feedback-dialog::backdrop {
  background: #061710b0;
  backdrop-filter: blur(6px);
}
.garden-companion header {
  border-bottom-color: #60735a55;
  padding: 18px 22px 14px;
}
.garden-companion .companion-eyebrow {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #ced8b4;
}
.garden-companion h2,
:root #feedback-dialog h2 {
  font:
    normal 26px/1.2 Georgia,
    serif;
  color: #f0eacc;
  letter-spacing: -0.3px;
}
.garden-companion h3 {
  color: #f0e3a8;
}
.garden-companion button[data-close],
:root #feedback-dismiss {
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #5e725488;
  border-radius: 50%;
  background: transparent;
  color: #b8c7ad;
  font:
    27px/1 Georgia,
    serif;
  display: grid;
  place-items: center;
}
.garden-companion button[data-close]:hover,
:root #feedback-dismiss:hover {
  border-color: #b8c7ad;
}
/* Buttons: one quiet filled style for actions, outlined for secondary ones. */
.garden-companion button {
  border-radius: 23px;
  background: #e6d28a;
  border-color: #e6d28a;
  color: #233529;
}
.garden-companion button.companion-secondary {
  background: transparent;
  color: #e9eddf;
  border-color: #779481;
}
/* Fields in the garden palette instead of glaring cream. */
.garden-companion input,
.garden-companion select,
:root #feedback-dialog select,
:root #feedback-dialog textarea {
  background: #0f231d;
  color: #eef1e2;
  border: 1px solid #60735a;
  border-radius: 12px;
  font:
    16px ui-sans-serif,
    system-ui,
    sans-serif;
}
.garden-companion input::placeholder,
:root #feedback-dialog textarea::placeholder {
  color: #93a893;
}
.garden-companion select,
:root #feedback-dialog select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23e6d28a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
.garden-companion input:focus-visible,
.garden-companion select:focus-visible,
:root #feedback-dialog select:focus-visible,
:root #feedback-dialog textarea:focus-visible,
:root #feedback-dialog input:focus-visible {
  outline: 2px solid #f2d88d;
  outline-offset: 2px;
}
:root #feedback-dialog input[type="file"] {
  font:
    13px ui-sans-serif,
    system-ui,
    sans-serif;
  color: #c9d6c3;
  max-width: 100%;
}
:root #feedback-dialog input[type="file"]::file-selector-button {
  min-height: 44px;
  margin-right: 12px;
  padding: 8px 18px;
  border-radius: 23px;
  border: 1px solid #779481;
  background: transparent;
  color: #e9eddf;
  font:
    14px ui-sans-serif,
    system-ui,
    sans-serif;
  cursor: pointer;
}
:root #feedback-dialog .feedback-heading {
  background: #142b24;
  align-items: center;
}
:root #feedback-dialog label {
  color: #dfe3cf;
}
:root #feedback-dialog p,
:root #feedback-dialog small {
  color: #cfdac6;
}

/* Sound and ambience: labelled on/off switches. */
.companion-switches {
  display: grid;
  gap: 2px;
  margin: 4px 0 8px;
}
.garden-companion button.companion-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 6px 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #e9eddf;
  font:
    15px ui-sans-serif,
    system-ui,
    sans-serif;
  text-align: left;
}
.switch-track {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  border-radius: 14px;
  background: #0f231d;
  border: 1px solid #60735a;
  transition: background 0.2s;
}
.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #93a893;
  transition: transform 0.2s;
}
.companion-switch[aria-checked="true"] .switch-track {
  background: #e6d28a;
  border-color: #e6d28a;
}
.companion-switch[aria-checked="true"] .switch-thumb {
  transform: translateX(18px);
  background: #233529;
}
.companion-switch:focus-visible {
  outline: 2px solid #f2d88d;
  outline-offset: 2px;
}
.garden-companion .companion-privacy {
  margin: 4px 0 0;
}
.garden-companion .companion-privacy a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  color: #e6d28a;
  font-size: 14px;
}
@media (prefers-reduced-motion: reduce) {
  .switch-track,
  .switch-thumb {
    transition: none;
  }
}

/* The ten-garden invitation inside the valley map: quiet, secondary. */
.garden-companion-invite.map-invite {
  position: static;
  inset: auto;
  z-index: auto;
  margin: 16px 0 0;
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  text-align: left;
  background: #0f231d99;
  border: 1px solid #60735a66;
  border-radius: 16px;
  box-shadow: none;
}
.map-invite strong {
  color: #f0e3a8;
  font-size: 17px;
}
.map-invite p {
  color: #cfdac6;
}
.map-invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.garden-companion-invite.map-invite button {
  min-height: 44px;
  border-radius: 23px;
  background: transparent;
  color: #f0e3a8;
  border: 1px solid #e6d28a88;
}
.garden-companion-invite.map-invite button[data-later] {
  border-color: transparent;
  color: #c5d3bf;
}

:root .feedback-actions button {
  min-height: 46px;
  padding: 8px 20px;
  border-radius: 23px;
  border: 1px solid #779481;
  background: transparent;
  color: #e9eddf;
  font:
    15px ui-sans-serif,
    system-ui,
    sans-serif;
}
:root .feedback-actions #feedback-submit {
  background: #e6d28a;
  border-color: #e6d28a;
  color: #233529;
  font-weight: 600;
}
.garden-companion button[data-install] {
  background: transparent;
  color: #f0e3a8;
  border-color: #e6d28a88;
}

#companion-title:focus {
  outline: none;
}
.garden-companion-invite.companion-notice strong,
.garden-companion-invite.install-welcome strong {
  font-size: 17px;
}
.garden-companion-invite.companion-notice,
.garden-companion-invite.install-welcome {
  gap: 2px 10px;
  padding: 8px 12px;
}

/* ---------- Install: home-screen art, sheet details, the quiet banner ----------
 * Owned by install.ts (2026-09-28 install-flow pass). A tiny phone home screen
 * with the garden's icon among the others makes "installing" tangible: it is
 * an icon, not an app-store download. */
.install-home {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.install-home-grid {
  display: grid;
  border: 2px solid #60735a;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background:
    radial-gradient(ellipse at 50% 120%, #2e4d3b, transparent 70%), #0f231d;
}
.install-home-grid i,
.install-home-grid b {
  display: block;
  border-radius: 28%;
}
.install-home-grid i {
  background: #2a4438;
}
.install-home-grid b img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 28%;
  box-shadow:
    0 0 0 2px #f1dc9a,
    0 0 18px #f1dc9a88;
}
.install-home-large .install-home-grid {
  grid-template-columns: repeat(4, 28px);
  grid-auto-rows: 28px;
  gap: 12px 14px;
  padding: 16px 18px 12px;
}
.install-home-label {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #f0e3a8;
}
.install-home-small .install-home-grid {
  grid-template-columns: repeat(3, 10px);
  grid-auto-rows: 10px;
  gap: 3px;
  padding: 7px 6px 6px;
  border-width: 1.5px;
  border-radius: 10px 10px 0 0;
}
.install-home-small .install-home-grid b {
  grid-column: 2 / 4;
  grid-row: 2 / 4;
}
.install-home-small .install-home-grid b img {
  box-shadow:
    0 0 0 1.5px #f1dc9a,
    0 0 10px #f1dc9a88;
}
.install-art {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
}
.install-intro {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.install-intro-text {
  flex: 1;
  min-width: 0;
}
.install-intro .install-home {
  margin-top: 4px;
}
.install-points {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.install-points li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.4;
  color: #dfe3cf;
}
.install-points svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  fill: none;
  stroke: #e6d28a;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.install-sheet .install-carry {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #e6d28a55;
  background: #e6d28a14;
  font-size: 14px;
}
.install-carry-action {
  margin: 0 0 12px;
}
.install-carry-action button {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 22px;
  border: 1px solid #e6d28a88;
  background: transparent;
  color: #f0e3a8;
  font:
    15px ui-sans-serif,
    system-ui,
    sans-serif;
  cursor: pointer;
}
.install-carry-action button:focus-visible {
  outline: 2px solid #f2d88d;
  outline-offset: 3px;
}
.install-sheet .install-confirm {
  margin: 8px 0 0;
  text-align: center;
}

/* The quiet banner: appears as a fresh garden starts, leaves on the first turn.
 * Compact, above the board; if a layout leaves no room there it sits at the
 * bottom instead (install-nudge-bottom) so it never covers a tile. */
.install-nudge {
  position: fixed;
  z-index: 40;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100vw - 16px));
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "art title title close"
    "art line go close";
  gap: 2px 10px;
  align-items: center;
  padding: 6px 4px 6px 10px;
  color: #e9eddf;
  background: #19362e;
  border: 1px solid #779481;
  border-radius: 16px;
  box-shadow: 0 12px 36px #071a17a6;
  font:
    13px/1.35 ui-sans-serif,
    system-ui,
    sans-serif;
  animation: install-nudge-in 320ms ease-out both;
}
.install-nudge.install-nudge-bottom {
  top: auto;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
}
.install-nudge.install-nudge-docked {
  position: static;
  transform: none;
  width: 100%;
  animation-name: install-nudge-fade;
}
.install-nudge > .install-home {
  grid-area: art;
}
.install-nudge-text {
  display: contents;
}
.install-nudge-text strong {
  grid-area: title;
  font:
    normal 16px/1.25 Georgia,
    serif;
  color: #f0eacc;
  text-wrap: balance;
}
.install-nudge-text span {
  grid-area: line;
  color: #c9d3bf;
  text-wrap: pretty;
}
.install-nudge-actions {
  display: contents;
}
.install-nudge-go {
  grid-area: go;
  min-height: 40px;
  min-width: 56px;
  padding: 4px 16px;
  border: 0;
  border-radius: 20px;
  background: #e6d28a;
  color: #233529;
  font:
    600 14px ui-sans-serif,
    system-ui,
    sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
.install-nudge-close {
  grid-area: close;
  align-self: start;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: #c5d3bf;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.install-nudge button:focus-visible {
  outline: 2px solid #f2d88d;
  outline-offset: 2px;
}
@keyframes install-nudge-in {
  from {
    opacity: 0;
    translate: 0 -6px;
  }
}
@keyframes install-nudge-fade {
  from {
    opacity: 0;
  }
}
@media (max-width: 380px) {
  .install-nudge-text strong {
    font-size: 15px;
  }
  .install-home-large .install-home-grid {
    grid-template-columns: repeat(4, 24px);
    grid-auto-rows: 24px;
    gap: 10px 12px;
  }
  .install-intro .install-home {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .install-nudge {
    animation: none;
  }
}
.install-home-small .install-home-grid i:nth-of-type(n + 6) {
  display: none;
}

/* ---- Feedback: thumbs up/down and one note. ---- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
:root #feedback-dialog form {
  display: grid;
  gap: 14px;
}
:root #feedback-dialog .feedback-rating {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}
:root #feedback-dialog .feedback-thumb {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 96px;
  padding: 14px 8px 12px;
  border: 1px solid #60735a;
  border-radius: 18px;
  background: #0f231d;
  color: #dfe3cf;
  font:
    15px ui-sans-serif,
    system-ui,
    sans-serif;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.15s;
}
:root #feedback-dialog .feedback-thumb input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
:root #feedback-dialog .feedback-thumb svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: #b8c7ad;
  stroke-width: 1.8;
  stroke-linejoin: round;
  transition:
    stroke 0.15s,
    fill 0.15s;
}
:root #feedback-dialog .feedback-thumb:hover {
  border-color: #9fb495;
}
:root #feedback-dialog .feedback-thumb:has(input:focus-visible) {
  outline: 2px solid #f2d88d;
  outline-offset: 2px;
}
:root #feedback-dialog .feedback-thumb[data-rating="up"]:has(input:checked) {
  border-color: #e6d28a;
  background: #34472a;
  color: #f4e7b3;
  box-shadow: inset 0 0 0 1px #e6d28a;
  transform: translateY(-1px);
}
:root
  #feedback-dialog
  .feedback-thumb[data-rating="up"]:has(input:checked)
  svg {
  stroke: #f2d88d;
  fill: #e6d28a55;
}
:root #feedback-dialog .feedback-thumb[data-rating="down"]:has(input:checked) {
  border-color: #b9c9e2;
  background: #223843;
  color: #dde8f5;
  box-shadow: inset 0 0 0 1px #b9c9e2;
  transform: translateY(-1px);
}
:root
  #feedback-dialog
  .feedback-thumb[data-rating="down"]:has(input:checked)
  svg {
  stroke: #c5d8ee;
  fill: #b9c9e244;
}
:root #feedback-dialog textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 84px;
  padding: 12px 14px;
  resize: vertical;
}
:root #feedback-dialog .feedback-context {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #aebfa9;
}
:root #feedback-dialog #feedback-status:empty {
  display: none;
}
:root #feedback-dialog .feedback-actions {
  display: flex;
  justify-content: flex-end;
}
:root #feedback-dialog #feedback-submit {
  min-width: 120px;
}
@media (prefers-reduced-motion: reduce) {
  :root #feedback-dialog .feedback-thumb,
  :root #feedback-dialog .feedback-thumb svg {
    transition: none;
  }
}
