.toast {
  position: fixed;
  inset: max(12px, env(safe-area-inset-top)) auto auto 50%;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  width: max-content;
  max-width: min(420px, calc(100vw - 24px));
  min-height: 52px;
  margin: 0;
  padding: 7px 20px 7px 7px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--night);
  box-shadow: var(--shadow-night);
  color: var(--on-ink);
  font: 500 14px/1.25 var(--font-body);
  opacity: 0;
  transform: translateX(-50%) translateY(-6px) scale(0.72, 0.62);
  filter: blur(6px);
  pointer-events: none;
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  transition: opacity 0.2s ease, transform 0.26s var(--ease-swap), filter 0.2s ease;
}

.toast[data-open="true"] {
  opacity: 1;
  transform: translateX(-50%);
  filter: none;
  pointer-events: auto;
  transition: opacity 0.24s ease, transform 0.5s var(--ease-expo), filter 0.32s ease;
}

.toast-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.14);
}

a.toast { text-decoration: none; cursor: pointer; }
a.toast:focus-visible { outline: 2px solid #d1baff; outline-offset: 3px; }

.toast-mark:empty { display: none; }

.toast-mark .icon {
  width: 18px;
  height: 18px;
}

.toast-mark .orb { --orb-size: 30px; }

.toast[data-tone="good"] .toast-mark {
  background: rgba(47, 167, 116, 0.22);
  color: #7FE0B4;
}

.toast[data-tone="bad"] .toast-mark {
  background: rgba(255, 15, 57, 0.2);
  color: #FF8FA3;
}

.toast[data-tone="light"] .toast-mark { background: #FFFFFF; }

.toast-text {
  display: grid;
  min-width: 0;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.toast[data-open="true"] .toast-text {
  opacity: 1;
  transition: opacity 0.3s ease 0.12s;
}

.toast-label {
  overflow: hidden;
  color: var(--on-night);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.toast-label:empty { display: none; }

.toast-message {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast[data-open="true"] {
    transform: translateX(-50%);
    filter: none;
    transition: opacity 0.2s ease;
  }
}

.toast.toast-capsule {
  min-height: var(--toast-height);
  max-width: min(396px, calc(100vw - 48px));
  padding: 8px 22px 8px 8px;
  gap: 12px;
  overflow: visible;
  isolation: isolate;
  background: none;
  box-shadow: none;
  color: #f4f3f7;
  letter-spacing: -.01em;
  filter: drop-shadow(0 10px 12px #0c0e1e38) drop-shadow(0 2px 3px #0c0e1e20);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transform: translateX(-50%) translateY(-4px) scale(.96);
  transition: opacity 120ms ease 160ms, transform var(--toast-exit) var(--ease-quint);
}

.toast-capsule[data-tone="good"] { --toast-accent: var(--toast-success); }
.toast-capsule[data-tone="warm"] { --toast-accent: var(--toast-warning); }
.toast-capsule[data-tone="bad"] { --toast-accent: var(--toast-error); }

.toast.toast-capsule[data-open="true"] {
  transform: translateX(-50%) translateY(0) scale(1);
  transition: opacity 120ms ease, transform var(--toast-enter) var(--ease-quint);
}

.toast-surface {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: 999px;
  background: var(--glass-dock);
  clip-path: inset(0 calc(50% - var(--toast-height) / 2) round 999px);
  transition: clip-path var(--toast-exit) var(--ease-quint);
  pointer-events: none;
}

.toast-capsule[data-open="true"] .toast-surface {
  clip-path: inset(0 0 round 999px);
  transition: clip-path var(--toast-enter) var(--ease-quint) var(--toast-seed);
}

.toast-surface::before,
.toast-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.toast-surface::before {
  background: radial-gradient(ellipse at 30% 120%, rgb(var(--toast-accent) / .3), transparent 65%);
}

.toast-surface::after {
  z-index: 1;
  padding: 1px;
  background: linear-gradient(165deg, #ffffff45, #ffffff0b 44%, rgb(var(--toast-accent) / .42));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.toast-glow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 160ms ease;
}

.toast-capsule[data-glow="true"] .toast-glow { opacity: 1; }

.toast.toast-capsule .toast-mark {
  width: 40px;
  height: 40px;
  color: rgb(var(--toast-accent));
  background: radial-gradient(ellipse at 50% 0, #ffffff1f, #ffffff06 72%);
  box-shadow: inset 0 1px 0 #ffffff24, inset 0 0 0 1px #ffffff0a;
  transform: translateX(var(--toast-mark-offset, 0px));
  transition: transform var(--toast-exit) var(--ease-quint);
}

.toast-capsule[data-open="true"] .toast-mark {
  transform: translateX(0);
  transition: transform var(--toast-enter) var(--ease-quint) var(--toast-seed);
}

.toast-capsule .toast-mark .icon { filter: var(--dock-icon-shadow); }

.toast-comment-shell {
  position: fixed;
  inset: max(12px, env(safe-area-inset-top)) auto auto 50%;
  z-index: var(--z-toast);
  width: calc(var(--toast-comment-width) + 2 * var(--toast-control-size) + 2 * var(--toast-comment-gap));
  max-width: calc(100vw - 48px);
  transform: translateX(-50%);
  font: 500 14px/1.4 var(--font-body);
}

.toast-comment-row {
  display: flex;
  align-items: center;
  gap: var(--toast-comment-gap);
}

.toast.toast-comment {
  position: relative;
  inset: auto;
  flex: 1;
  width: var(--toast-comment-width);
  min-width: 0;
  max-width: none;
  padding: 6px 6px 6px 8px;
  gap: 10px;
  transform: translateY(-4px) scale(.96);
}

.toast.toast-comment[data-open="true"] { transform: none; }

.toast-comment-text { flex: 1; }

.toast.toast-live { position: relative; inset: auto; display: block; width: 100%; max-width: none; padding: 8px; border-radius: 28px; transform: translateY(-4px) scale(.96); }
.toast.toast-live[data-open="true"] { transform: none; }
.toast.toast-capsule.toast-live .toast-surface { clip-path: none; border-radius: 28px; }
.toast-live-heading { display: flex; align-items: center; gap: 12px; }
.toast-live-heading a { flex: 1; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.toast-live-heading a:focus-visible { outline: 2px solid #d1baff; outline-offset: 3px; border-radius: 4px; }
.toast.toast-live .toast-mark { transform: none; }
.toast-live-form { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 0 0 0 12px; border: 1px solid #ffffff30; border-radius: 24px; }
.toast-live-form .toast-comment-input { flex: 1; }
.toast-live-error { margin: 8px 12px 0; color: #e3dbea; font-size: 12px; }
.toast-live-error:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
  .toast.toast-capsule.toast-live,
  .toast.toast-capsule.toast-live[data-open="true"] { transform: none; transition: opacity 160ms ease; }
}

.toast-comment-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 10px 0;
  border: 0;
  outline: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  caret-color: rgb(var(--toast-accent));
  font: inherit;
  user-select: text;
}

.toast-comment-input::placeholder { color: #c3c1ce; opacity: 1; }
.toast-comment:focus-within .toast-surface::after { background: linear-gradient(165deg, #ffffff70, #ffffff18 44%, rgb(var(--toast-accent) / .55)); }

.toast-control,
.toast-comment-send {
  display: grid;
  flex: none;
  place-items: center;
  box-sizing: border-box;
  width: var(--toast-control-size);
  height: var(--toast-control-size);
  padding: 0;
  border: 1px solid #ffffff20;
  border-radius: 50%;
  background: var(--glass-dock);
  box-shadow: inset 0 1px 0 #ffffff18, 0 8px 12px #0c0e1e26;
  color: #efedf6;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px) scale(.96);
  transition: opacity 160ms ease, transform 160ms var(--ease-quint), border-color 160ms ease;
}

.toast-control {
  pointer-events: none;
  transform: translateY(-12px) scale(.9);
  transition: opacity var(--toast-exit) ease, transform var(--toast-exit) var(--ease-quint), border-color 160ms ease;
}
.toast-comment-shell[data-open="true"] .toast-control {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition-delay: calc(var(--toast-enter) + var(--toast-seed)), calc(var(--toast-enter) + var(--toast-seed)), 0ms;
}
.toast-comment-shell[data-open="true"] .toast-control + .toast-control {
  transition-delay: calc(var(--toast-enter) + 2 * var(--toast-seed)), calc(var(--toast-enter) + 2 * var(--toast-seed)), 0ms;
}
.toast-control .icon { width: 18px; height: 18px; filter: var(--dock-icon-shadow); }
.toast-control:hover { border-color: #ffffff55; }
.toast-comment-shell[data-open="true"] .toast-control:active,
.toast-comment-send:active { transform: scale(.97); transition-delay: 0ms; }
.toast-control:focus-visible,
.toast-comment-send:focus-visible { outline: 2px solid #d1baff; outline-offset: 3px; }
.toast-control[aria-expanded="true"] { color: #d1baff; border-color: #ba97fa80; }

.toast-comment-send {
  width: 44px;
  height: 44px;
  border-color: rgb(var(--toast-accent) / .24);
  background: rgb(var(--toast-accent) / .2);
  box-shadow: inset 0 1px 0 #ffffff18;
  opacity: 1;
  transform: none;
}

.toast-comment-send:disabled { opacity: .4; cursor: default; }
.toast-comment-send .icon { width: 18px; height: 18px; }
.toast-comment-send[data-busy="true"] .icon { visibility: hidden; }
.toast-comment-send[data-busy="true"]::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff35;
  border-top-color: #f4f3f7;
  border-radius: 50%;
  animation: toast-comment-spin 700ms linear infinite;
}

@keyframes toast-comment-spin { to { transform: rotate(360deg); } }

.toast-comment-status {
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  margin: 10px 0 0;
  padding: 8px 14px;
  border: 1px solid #ffffff20;
  border-radius: 16px;
  background: var(--glass-dock);
  box-shadow: 0 4px 12px #0c0e1e24;
  color: #f4f3f7;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.toast-comment-widget {
  display: block;
  box-sizing: border-box;
  width: var(--toast-comment-panel-width);
  max-width: 100%;
  margin: 12px 0 0 auto;
  border: 1px solid #ffffff60;
  border-radius: var(--radius-tile);
  box-shadow: 0 10px 24px #0c0e1e32;
  background: #e4dee9;
}

.toast-a11y {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 430px) {
  .toast-comment-shell { max-width: calc(100vw - 24px); }
  .toast-comment-row { gap: 6px; }
  .toast.toast-comment { padding-left: 10px; gap: 6px; }
  .toast-comment .toast-mark { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .toast.toast-capsule.toast-comment,
  .toast.toast-capsule.toast-comment[data-open="true"],
  .toast-control { transform: none; transition: opacity 160ms ease; }
  .toast-comment-shell[data-open="true"] .toast-control,
  .toast-comment-shell[data-open="true"] .toast-control + .toast-control { transform: none; transition-delay: 0ms; }
  .toast-comment-send[data-busy="true"]::after { animation: none; }
}

.toast-capsule .toast-text {
  transform: translateX(6px);
  transition: opacity 80ms ease, transform 160ms var(--ease-quint);
}

.toast-capsule[data-open="true"] .toast-text {
  transform: translateX(0);
  transition: opacity 160ms ease 160ms, transform 240ms var(--ease-quint) 120ms;
}

@media (prefers-reduced-motion: reduce) {
  .toast.toast-capsule,
  .toast.toast-capsule[data-open="true"] {
    transform: translateX(-50%);
    transition: opacity 160ms ease;
  }

  .toast-capsule .toast-surface,
  .toast-capsule[data-open="true"] .toast-surface {
    clip-path: inset(0 0 round 999px);
    transition: none;
  }

  .toast-capsule .toast-mark,
  .toast-capsule[data-open="true"] .toast-mark,
  .toast-capsule .toast-text,
  .toast-capsule[data-open="true"] .toast-text {
    transform: none;
    transition: opacity 160ms ease;
  }

  .toast-capsule .toast-glow { display: none; }
}

.toast-live-form[data-control="boolean"],
.toast-live-form[data-control="choice"] { align-items: flex-end; padding: 8px; border-radius: 20px; }
.toast-live-options { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; max-height: 240px; overflow-y: auto; margin: 0; padding: 0; border: 0; }
.toast-live-options label { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px; border: 1px solid #ffffff30; border-radius: 16px; background: #ffffff0a; cursor: pointer; overflow-wrap: anywhere; }
.toast-live-options label:has(:checked) { background: #d1baff26; border-color: #d1baff; }
.toast-live-options input { flex-shrink: 0; accent-color: #d1baff; }
.toast-live-options input[type="checkbox"] { display: grid; place-content: center; width: 14px; height: 14px; margin: 0; border-radius: 35%; background: #ffffff14; box-shadow: inset 0 1px 2px #00000040, inset 0 0 0 1px #ffffff38; appearance: none; -webkit-appearance: none; cursor: pointer; transition: background-color 160ms ease-out, box-shadow 160ms ease-out; }
.toast-live-options input[type="checkbox"]::after { content: ''; width: 8px; height: 8px; background: #1b1830; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='3.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 8 3.2 3.2L13 4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='3.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 8 3.2 3.2L13 4'/%3E%3C/svg%3E") center / contain no-repeat; transform: scale(0) rotate(-25deg); transition: transform 240ms var(--ease-bounce, ease-out); }
.toast-live-options input[type="checkbox"]:checked { background: linear-gradient(180deg, #e4d6ff, #c9aeff); box-shadow: inset 0 1px 0 #ffffffa6, 0 2px 6px -2px #00000066; }
.toast-live-options input[type="checkbox"]:checked::after { transform: none; }
.toast-live-options input[type="checkbox"]:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) { .toast-live-options input[type="checkbox"], .toast-live-options input[type="checkbox"]::after { transition: none; } }
.toast-live-options label:focus-within { outline: 2px solid #d1baff; outline-offset: 2px; }
.toast-live-options:disabled { opacity: .6; }
.toast-live-open { display: inline-flex; align-items: center; gap: 12px; margin: 8px 12px; padding: 10px 14px; color: inherit; border: 1px solid #ffffff30; border-radius: 18px; text-decoration: none; }
.toast-live-open:focus-visible { outline: 2px solid #d1baff; outline-offset: 3px; }

.toast-live {
  --toast-live-yes: #b9eed7;
  --toast-live-tentative: #ead7ac;
  --toast-live-response-gap: 8px;
}
.toast.toast-live { padding: 16px; background: linear-gradient(125deg, #343240f5, #23232dfc 75%); }
.toast-live-heading { align-items: flex-start; gap: 14px; }
.toast-live-heading > a { padding-top: 2px; line-height: 1.45; }
.toast-live-caption { display: block; margin-bottom: 5px; color: #bcb1d6; font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.toast-live-heading .toast-mark { margin-top: 2px; background: radial-gradient(circle at 25% 15%, #baa0ec30, #ffffff05); }
.toast-live-heading > .toast-comment-send { width: 30px; height: 30px; min-width: 30px; background: #ffffff08; box-shadow: inset 0 0 0 1px #ffffff18; }
.toast-live-heading > .toast-comment-send .icon { width: 14px; height: 14px; }
.toast-live-form[data-direct="true"] { margin-top: 18px; padding: 0; border: 0; }
.toast-live-form[data-direct="true"] .toast-live-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: var(--toast-live-response-gap); padding: 3px; margin: -3px; overflow-x: hidden; }
.toast-live-action { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; min-width: 0; padding: 12px; border: 1px solid #ffffff24; border-radius: 16px; background: linear-gradient(160deg, #ffffff12, #ffffff04); color: #eeeaf6; font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; box-shadow: 0 2px 4px #00000016, inset 0 1px #ffffff0a; overflow-wrap: anywhere; }
.toast-live-action .icon { flex: none; width: 20px; height: 20px; }
.toast-live-action[data-tone="yes"] { color: var(--toast-live-yes); background: linear-gradient(160deg, #9ae9c51e, #9ae9c506); border-color: #b9eed740; }
.toast-live-action[data-tone="tentative"] { color: var(--toast-live-tentative); }
.toast-live-action:focus-visible { outline: 2px solid #d1baff; outline-offset: 2px; }
.toast-live-action:active:not(:disabled) { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) {
  .toast-live-action:hover:not(:disabled) { background: #ffffff1c; border-color: #ffffff55; }
}

.toast-live-shell {
  --toast-live-yes: #b9eed7;
  --toast-live-tentative: #ead7ac;
  --toast-live-response-gap: 10px;
}
.toast-live-actions > .toast-live-form[data-direct="true"] { margin-top: 12px; background: transparent; }
.toast-live-actions > .toast-live-form[data-direct="true"] .toast-live-options { display: flex; flex-wrap: wrap; justify-content: flex-start; overflow: visible; max-height: none; }
.toast-live-actions > .toast-live-form .toast-live-action { flex: 0 1 auto; min-width: 100px; justify-content: flex-start; padding: 11px calc(var(--toast-question-inset) + 1px); gap: 14px; border-radius: var(--toast-question-radius); background: linear-gradient(135deg, #363440fa, #24242efc); box-shadow: 0 5px 14px #00000030, inset 0 1px #ffffff12; }
.toast-live-actions > .toast-live-form .toast-live-action[data-tone="yes"] { background: linear-gradient(135deg, #35433ffa, #252f2dfc); }
.toast-live-shell:not([data-open="true"]) > .toast-live-actions { visibility: hidden; }
@media (max-width: 400px) {
  .toast-live-actions > .toast-live-form .toast-live-action { min-width: 0; }
}

.toast-live-actions { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; }
.toast-live-actions > .toast-live-form[data-direct="true"] { flex: 1; min-width: 0; margin-top: 0; }
.toast-live-dismiss { flex: none; width: 48px; height: 48px; margin-left: auto; border-radius: 50%; background: linear-gradient(135deg, #363440fa, #24242efc); box-shadow: 0 5px 14px #00000030, inset 0 0 0 1px #ffffff24; color: #eeeaf6; }
.toast-live-dismiss .icon { width: 20px; height: 20px; }

.toast.toast-live[data-question="true"] { padding: 18px 20px; border-radius: 24px; }
.toast.toast-live[data-question="true"] .toast-surface { border-radius: 24px; }
.toast-live[data-question="true"] .toast-live-heading { align-items: flex-start; gap: 12px; }
.toast-live[data-question="true"] .toast-mark { flex: none; align-self: flex-start; width: 24px; height: 24px; min-width: 24px; margin: 0; background: none; box-shadow: none; border: 0; color: #c8bedf; }
.toast-live[data-question="true"] .toast-mark .icon { width: 24px; height: 24px; }
.toast-live[data-question="true"] .toast-live-heading > a { padding: 0; font-size: 15px; font-weight: 400; line-height: 1.5; letter-spacing: -.01em; text-align: left; }

.toast-live-shell { --toast-question-radius: 24px; --toast-answer-height: 48px; --toast-question-inset: 20px; }
.toast-live-shell .toast[data-question="true"],
.toast-live-shell .toast[data-question="true"] .toast-surface { border-radius: var(--toast-question-radius); }
.toast-live[data-question="true"] .toast-live-heading > a { line-height: 24px; }
.toast-live[data-question="true"] .toast-mark .icon { width: 20px; height: 20px; }
.toast-live-action { line-height: 24px; }
.toast-live-actions > .toast-live-form .toast-live-action { min-height: var(--toast-answer-height); border-radius: var(--toast-question-radius); }
.toast-live-dismiss { width: var(--toast-answer-height); height: var(--toast-answer-height); }
.toast-live-form[data-control="text"],
.toast-live-form[data-control="email"] { box-sizing: border-box; min-height: var(--toast-answer-height); border-radius: var(--toast-question-radius); }
.toast-live-form .toast-comment-input { line-height: 24px; }
