/* Raised surfaces, mobile sheets and transient forum messages. */
.v38-one-ui {
  --v38-scrim: rgb(13 19 31 / 52%);
}

:root[data-theme="dark"] .v38-one-ui {
  --v38-scrim: rgb(0 0 0 / 64%);
}

.v38-modal-open { overflow: hidden; }

.v38-one-ui .v38-popover[hidden] { display: none !important; }

.v38-one-ui .v38-popover,
.v38-one-ui.v353-polish .v38-floating-disclosure {
  position: fixed;
  inset: var(--v38-surface-top, 56px) auto auto var(--v38-surface-left, 12px);
  z-index: 58;
  max-height: var(--v38-surface-max-height, min(540px, 72vh));
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--v38-raised, var(--panel));
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--v38-radius-small, 16px);
  box-shadow: var(--v38-overlay-shadow, 0 16px 40px #0003);
}

.v38-one-ui .v38-popover {
  width: min(var(--v38-popover-width, 22rem), calc(100vw - 24px));
  padding: 10px;
  animation: v38-pop-in 150ms ease-out both;
}

.v38-one-ui .v38-popover:has([data-v38-initial-focus]) { --v38-popover-width: 27rem; }

.v38-one-ui .v38-popover-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.v38-one-ui .v38-popover-list > :is(a, button),
.v38-one-ui .v38-popover-list > li > :is(a, button) {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 0;
  border-radius: var(--v38-radius-small, 14px);
  background: transparent;
  color: var(--ink);
  text-align: start;
  overflow-wrap: anywhere;
}

.v38-one-ui .v38-popover-list > :is(a, button):hover,
.v38-one-ui .v38-popover-list > li > :is(a, button):hover {
  background: var(--v38-accent-soft, var(--panel2));
  color: var(--v38-accent-text, var(--ink));
}

.v38-one-ui .v38-dialog {
  position: fixed;
  inset: 0;
  width: min(calc(100% - 32px), 29rem);
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--v38-radius, 24px);
  color: var(--ink);
  background: var(--v38-raised, var(--panel));
  box-shadow: var(--v38-overlay-shadow, 0 20px 50px #0004);
  overscroll-behavior: contain;
}

.v38-one-ui .v38-dialog[open] { animation: v38-pop-in 170ms ease-out both; }

.v38-one-ui .v38-dialog::backdrop {
  background: var(--v38-scrim, rgb(13 19 31 / 52%));
  animation: v38-scrim-in 150ms ease-out both;
}

:root[data-theme="dark"] .v38-one-ui .v38-dialog::backdrop {
  background: var(--v38-scrim, rgb(0 0 0 / 64%));
}

.v38-one-ui .v38-dialog-content { padding: clamp(17px, 4vw, 26px); }

.v38-one-ui .v38-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-block-end: 10px;
}

.v38-one-ui .v38-dialog-head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 3.2vw, 1.46rem);
  letter-spacing: -.025em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.v38-one-ui :is(.v38-dialog-close, .v38-toast-close) {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--panel2);
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1;
}

.v38-one-ui :is(.v38-dialog-close, .v38-toast-close):hover {
  background: var(--v38-accent-soft, var(--panel2));
  color: var(--v38-accent-text, var(--ink));
}

.v38-one-ui .v38-dialog-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.v38-one-ui .v38-dialog-form {
  display: grid;
  gap: 8px;
}

.v38-one-ui .v38-dialog-form label {
  font-weight: 650;
  font-size: .9rem;
}

.v38-one-ui .v38-dialog-input {
  width: 100%;
  min-width: 0;
  min-height: 49px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--v38-radius-small, 14px);
  background: var(--v38-field, var(--bg));
  color: var(--ink);
  font-size: 1rem;
}

.v38-one-ui .v38-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.v38-one-ui .v38-dialog-actions > button {
  min-height: 46px;
  padding-inline: 17px;
  border-radius: var(--v38-pill, 999px);
}

.v38-one-ui .v38-danger-btn {
  border: 1px solid transparent;
  background: var(--v38-danger-bg, #fbe5e5);
  color: var(--v38-danger, #9e2232);
  font-weight: 700;
}

.v38-one-ui .v38-danger-btn:hover { border-color: currentColor; }

.v38-one-ui .v38-dialog .v38-popover {
  position: static;
  width: auto;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
  overflow: visible;
}

.v38-one-ui.v353-polish .v38-floating-disclosure {
  width: min(17.5rem, calc(100vw - 24px));
  padding: 8px;
}

.v38-one-ui.v353-polish .v353-action-menu-body.v38-floating-disclosure .inline-form {
  display: grid;
  width: 100%;
}

.v38-one-ui.v353-polish .v353-action-menu-body.v38-floating-disclosure button {
  min-height: 44px;
  text-align: start;
}

.v38-one-ui :is(.v353-editor-more,.v353-action-menu,.v352-report) > summary {
  min-height: 44px;
  border-radius: var(--v38-pill, 999px);
}

.v38-one-ui :is(.v353-editor-more,.v353-action-menu,.v352-report)[open] > summary {
  background: var(--v38-accent-soft, var(--panel2));
  color: var(--v38-accent-text, var(--ink));
}

.v38-one-ui .v352-report .report-form {
  padding: 14px;
  border-radius: var(--v38-radius-small, 14px);
}

.v38-one-ui .v352-report .report-form input { width: 100%; }

.v38-one-ui .v38-field-error {
  margin: 2px 0 8px;
  color: var(--v38-danger, #aa2439);
  font-size: .875rem;
}

.v38-one-ui .v38-toast-stack {
  position: fixed;
  z-index: 85;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
  width: min(25rem, calc(100% - 32px));
  pointer-events: none;
}

.v38-one-ui .v38-toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 6px 8px 6px 16px;
  border: 1px solid var(--line);
  border-radius: var(--v38-radius-small, 14px);
  background: var(--v38-raised, var(--panel));
  color: var(--ink);
  box-shadow: var(--v38-overlay-shadow, 0 12px 30px #0003);
  font-size: .9rem;
  overflow-wrap: anywhere;
  pointer-events: auto;
  animation: v38-pop-in 150ms ease-out both;
}

.v38-one-ui .v38-toast[data-tone="error"] {
  background: var(--v38-danger-bg, #fbe5e5);
  color: var(--v38-danger, #9e2232);
}

.v38-one-ui .v38-toast[data-tone="success"] {
  background: var(--v38-accent-soft, var(--panel2));
  color: var(--v38-accent-text, var(--ink));
}

.v38-one-ui .v38-toast-close { background: transparent; color: inherit; }

.v38-one-ui.v312-design .v312-menu-overlay {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: var(--v38-scrim);
  animation: v38-scrim-in 150ms ease-out both;
}

.v38-one-ui.v312-design .v312-drawer {
  inset: 12px 12px 12px auto;
  width: min(23rem, calc(100vw - 24px));
  height: auto;
  padding-inline: 14px;
  border: 1px solid var(--line);
  border-radius: var(--v38-radius, 24px);
  background: var(--v38-raised, var(--panel));
  box-shadow: var(--v38-overlay-shadow, 0 20px 50px #0004);
  animation: v38-pop-in 170ms ease-out both;
}

.v38-one-ui.v312-design .v312-drawer-head {
  background: var(--v38-raised, var(--panel));
  min-height: 62px;
  padding-inline: 6px;
}

.v38-one-ui.v312-design .v312-drawer-head strong {
  font-size: 1.2rem;
  letter-spacing: -.02em;
}

.v38-one-ui.v312-design .v312-drawer-nav > a {
  min-height: 48px;
  border-radius: var(--v38-radius-small, 14px);
  font-size: .92rem;
}

.v38-one-ui.v312-design .v312-drawer-nav > a[aria-current="page"] {
  background: var(--v38-accent-soft, var(--panel2));
  color: var(--v38-accent-text, var(--ink));
}

.v38-one-ui.v312-design .v312-drawer-label { font-size: .8rem; }

.v38-one-ui .v39-sheet-grip { display: none; }

@media (max-width: 760px) {
  .v38-one-ui .v38-dialog {
    inset: auto 0 var(--v39-keyboard-gap, 0px);
    width: 100%;
    max-height: 87vh;
    max-height: 87dvh;
    max-height: min(87dvh, calc(var(--v39-visible-height, 100dvh) - 10px));
    margin: 0;
    border-radius: 26px 26px 0 0;
  }

  .v38-one-ui .v38-dialog[open],
  .v38-one-ui.v312-design .v312-drawer {
    animation: v38-sheet-in 235ms cubic-bezier(.2,.75,.22,1) backwards;
    translate: 0 var(--v39-sheet-offset, 0px);
    transition: translate 205ms cubic-bezier(.2,.75,.22,1);
  }

  .v38-one-ui .v38-dialog-content {
    padding: 0 max(18px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  }

  .v38-one-ui .v38-dialog.v38-sheet {
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
    scrollbar-color: color-mix(in srgb, var(--muted) 55%, var(--panel2)) transparent;
  }

  .v38-one-ui .v39-sheet-grip {
    display: grid;
    place-items: center;
    height: 40px;
    touch-action: none;
    user-select: none;
  }

  .v38-one-ui .v39-sheet-grip::after {
    content: "";
    width: 36px;
    height: 4px;
    border-radius: 99px;
    background: var(--muted);
    opacity: .45;
  }

  .v38-one-ui .v38-dialog-actions > button { flex: 1 1 8rem; }

  .v38-one-ui .v38-toast-stack {
    left: 12px;
    right: 12px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    width: auto;
  }

  .v38-one-ui.v312-design .v312-drawer {
    inset: auto 0 var(--v39-keyboard-gap, 0px);
    width: 100%;
    max-height: 87vh;
    max-height: min(87dvh, calc(var(--v39-visible-height, 100dvh) - 10px));
    padding: 0 max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-width: 1px 0 0;
    border-radius: 26px 26px 0 0;
  }

  .v38-one-ui.v312-design .v312-drawer-head {
    min-height: 84px;
    padding-block: 38px 6px;
  }

  .v38-one-ui.v312-design .v312-drawer-head .v39-sheet-grip {
    position: absolute;
    inset: 0 0 auto;
  }

  .v38-one-ui :is(.v38-dialog, .v312-drawer):is(.v39-sheet-manipulated, .v39-sheet-closing) {
    animation: none;
  }

  .v38-one-ui :is(.v38-dialog, .v312-drawer).v39-sheet-dragging {
    transition: none;
  }

  .v38-one-ui :is(.v38-dialog, .v312-drawer).v39-sheet-closing {
    translate: 0 calc(100% + 12px);
    pointer-events: none;
  }

  .v38-one-ui .v38-dialog::backdrop,
  .v38-one-ui.v312-design .v312-menu-overlay {
    opacity: var(--v39-sheet-scrim-opacity, 1);
    animation-fill-mode: backwards;
    transition: opacity 205ms ease-out;
  }

  .v38-one-ui .v38-dialog:is(.v39-sheet-manipulated, .v39-sheet-closing)::backdrop,
  .v38-one-ui.v312-design .v312-menu-overlay:is(.v39-sheet-manipulated, .v39-sheet-closing) {
    animation: none;
  }

  .v38-one-ui .v38-dialog.v39-sheet-dragging::backdrop,
  .v38-one-ui.v312-design .v312-menu-overlay.v39-sheet-dragging {
    transition: none;
  }

  .v38-one-ui .v38-dialog.v39-sheet-closing::backdrop,
  .v38-one-ui.v312-design .v312-menu-overlay.v39-sheet-closing {
    opacity: 0;
  }
}

@keyframes v38-pop-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes v38-sheet-in {
  from { transform: translateY(min(40vh, 260px)); }
  to { transform: translateY(0); }
}

@keyframes v38-scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .v38-one-ui :is(.v38-popover, .v38-dialog, .v38-toast, .v312-menu-overlay, .v312-drawer),
  .v38-one-ui .v38-dialog::backdrop {
    animation: none;
    transition: none;
  }
}
