/* Yesian runtime styles: toasts and inline field errors. Uses the theme's tokens. */
#ys-toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(24rem, calc(100vw - 2rem));
}
/* ys.js shows it as a manual popover, so it is in the top layer above an
   open dialog: the browser's popover box is undone. */
#ys-toasts[popover] {
  inset: auto 1rem 1rem auto;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
}
.ys-toast {
  padding: 0.75rem 1rem;
  border-radius: var(--app-radius, 0.25rem);
  background: var(--app-surface, #fff);
  color: var(--app-text, #222);
  border-left: 4px solid var(--color-info, #3b82f6);
  box-shadow: var(--app-shadow, 0 2px 8px rgba(0, 0, 0, 0.15));
  cursor: pointer;
  animation: ys-in 0.15s ease-out;
}
.ys-toast-success { border-left-color: var(--color-success, #28bd14); }
.ys-toast-error { border-left-color: var(--color-error, #d43939); }
.ys-toast-warning { border-left-color: var(--color-warning, #f59e0b); }
.ys-error { display: block; margin-top: -0.5rem; margin-bottom: 0.75rem; color: var(--app-danger, #d43939); }
@keyframes ys-in { from { opacity: 0; transform: translateY(0.5rem); } }

/* For keyboard and screen reader users (ys.js): text only a screen reader
   gets; the "Skip to content" link, seen when the Tab key reaches it; the
   page's content takes the focus after a page change without showing a ring. */
.ys-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.ys-skip {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 3000;
  padding: 0.5rem 0.9rem;
  border-radius: var(--app-radius, 0.4rem);
  background: var(--app-surface, #fff);
  color: var(--app-text, #222);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  transform: translateY(-200%);
}
.ys-skip:focus {
  transform: none;
  outline: 2px solid var(--app-accent-tone, #4e5fc2);
  outline-offset: 2px;
}
[data-slot="app"][tabindex="-1"]:focus {
  outline: none;
}

/* The runtime did not load (or scripts are off): said at the top of the page. */
.ys-notice {
  position: fixed;
  top: 0.5rem;
  left: 50%;
  z-index: 3000;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 1rem);
  margin: 0;
  padding: 0.6rem 1rem;
  border-radius: var(--app-radius, 0.4rem);
  border-left: 4px solid var(--app-warning, #916313);
  background: var(--app-surface, #fff);
  color: var(--app-text, #222);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.ys-notice[hidden] { display: none; }

/* "A new version is ready" (ys.js checkRelease): above everything, bottom centre. */
.ys-update {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100vw - 2rem);
  padding: 0.6rem 0.6rem 0.6rem 1rem;
  border-radius: var(--app-radius, 8px);
  background: var(--app-text, #1f2328);
  color: var(--app-bg, #fff);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  font-size: 0.92rem;
}
.ys-update button {
  margin: 0;
  padding: 0.35rem 0.8rem;
  width: auto;
  font-size: 0.88rem;
}

/* Who else follows a channel (data-presence): one round mark per person. */
[data-presence] {
  display: inline-flex;
  gap: 0.25rem;
  vertical-align: middle;
}
.ys-person {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--app-accent-soft, #e0e7ff);
  color: var(--app-accent, #4f46e5);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
}

/* "Send feedback" (lib/feedback.go): a small button in the bottom left corner
   (toasts are on the right), out of the way of the page. */
.ys-feedback {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.45rem 0.8rem;
  width: auto;
  border: 1px solid var(--app-border, #d0d7de);
  border-radius: 999px;
  background: var(--app-bg, #fff);
  color: var(--app-text, #1f2328);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0.85;
}
.ys-feedback:hover, .ys-feedback:focus-visible { opacity: 1; }
@media (max-width: 600px) {
  .ys-feedback span { display: none; }
  .ys-feedback { padding: 0.55rem; }
}
@media print { .ys-feedback { display: none; } }
.ys-feedback-kinds { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; border: 0; padding: 0; margin: 0 0 1rem; }
.ys-feedback-kinds label { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; }
/* A sender's conversation about their feedback (core/feedback, /your-feedback/...). */
.ys-feedback-thread-page { max-width: 42rem; margin: 1.5rem auto; }
.ys-feedback-status { margin: 0 0 1rem; }
.ys-feedback-status.is-done strong, .ys-feedback-status.is-live strong { color: var(--app-success, #1a7f37); }
.ys-feedback-note { margin: 0 0 0.75rem; padding: 0.6rem 0.9rem; border: 1px solid var(--app-border, #d0d7de); border-radius: 10px; }
.ys-feedback-note.is-team { margin-left: 1.5rem; background: var(--app-accent-soft, #eef1fb); border-color: transparent; }
.ys-feedback-note.is-sender { margin-right: 1.5rem; }
.ys-feedback-note p { margin: 0.2rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ys-feedback-answer { margin-top: 1.25rem; }
