.rv-root {
  --rv-bg: var(--app-bg, #14161a);
  --rv-stage: var(--app-stage, #0b0c0e);
  --rv-panel: var(--app-panel, #1e2126);
  --rv-btn: var(--app-btn, #2a2e35);
  --rv-line: var(--app-line, #343941);
  --rv-text: var(--app-text, #e6e8eb);
  --rv-muted: var(--app-muted, #9aa3ad);
  --rv-ink: #f2f3f5;
  --rv-ink-text: #14161a;
  --rv-danger: #ff6b6b;
  --rv-hover: #31353d;
  --rv-pressed: #3a3f48;
  --rv-w-panel: clamp(320px, 32vw, 400px);
  --rv-ar: 862 / 612;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rv-w-panel);
  grid-template-rows: 56px minmax(0, 1fr) 64px;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background: var(--rv-bg);
  color: var(--rv-text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.rv-root *,
.rv-root *::before,
.rv-root *::after {
  box-sizing: border-box;
}

.rv-root button,
.rv-root textarea,
.rv-root a {
  font: inherit;
  color: inherit;
}

.rv-root button {
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rv-root button:focus-visible,
.rv-root textarea:focus-visible,
.rv-root a:focus-visible {
  outline: 2px solid var(--rv-ink);
  outline-offset: 2px;
}

.rv-num {
  font-variant-numeric: tabular-nums;
}

.rv-hidden {
  visibility: hidden;
}

.rv-icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rv-top {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  background: var(--rv-panel);
  border-bottom: 1px solid var(--rv-line);
}

.rv-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  white-space: nowrap;
}

.rv-waiting {
  color: var(--rv-muted);
  white-space: nowrap;
}

.rv-frameno {
  font-weight: 600;
  white-space: nowrap;
}

.rv-vid {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 14px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--rv-muted);
}

.rv-time {
  font-size: 14px;
  color: var(--rv-muted);
  white-space: nowrap;
}

.rv-grow {
  flex: 1;
}

.rv-topbtn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 8px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 150ms;
}

.rv-stage {
  grid-column: 1;
  grid-row: 2;
  position: relative;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--rv-stage);
}

.rv-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.rv-shape,
.rv-tag {
  cursor: pointer;
}

.rv-stage-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.rv-stage-msg[hidden] {
  display: none;
}

.rv-empty {
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  pointer-events: auto;
}

.rv-empty--over {
  padding: 24px;
  border-radius: 20px;
  background: rgba(11, 12, 14, 0.85);
  border: 1px solid var(--rv-line);
}

.rv-empty-h {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 600;
  text-wrap: balance;
}

.rv-muted {
  margin: 0;
  color: var(--rv-muted);
  text-wrap: pretty;
}

.rv-error-text {
  margin: 0;
  color: var(--rv-text);
  padding: 12px 16px;
  border: 1px solid var(--rv-danger);
  border-radius: 12px;
  text-align: left;
}

.rv-overbtn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(11, 12, 14, 0.72) !important;
  border: 1px solid var(--rv-line) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.rv-overbtn[hidden] {
  display: none;
}

.rv-toast-area {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
}

.rv-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 8px 8px 16px;
  border-radius: 20px;
  background: var(--rv-panel);
  border: 1px solid var(--rv-line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 14px;
  animation: rv-toast-in 200ms cubic-bezier(0.2, 0, 0, 1);
}

.rv-toast-text {
  min-width: 0;
}

.rv-toast-btn {
  flex: none;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--rv-ink) !important;
}

@keyframes rv-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.rv-bar {
  grid-column: 1;
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 0 16px;
  background: var(--rv-panel);
  border-top: 1px solid var(--rv-line);
}

.rv-hint {
  min-width: 0;
  font-size: 14px;
  color: var(--rv-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rv-pos {
  font-size: 14px;
  color: var(--rv-muted);
  white-space: nowrap;
}

.rv-panel {
  grid-column: 2;
  grid-row: 2 / 4;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--rv-panel);
  border-left: 1px solid var(--rv-line);
}

.rv-phead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 24px 0;
  min-height: 60px;
}

.rv-users {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 4px 24px 4px;
}

.rv-users-label {
  flex: 1 0 100%;
  font-size: 14px;
  color: var(--rv-muted);
}

.rv-root .rv-user {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--rv-btn);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 150ms;
}

.rv-root .rv-user small {
  font-size: 14px;
  font-weight: 400;
  color: var(--rv-muted);
}

.rv-root .rv-user[aria-pressed="true"] {
  background: var(--rv-ink);
  color: var(--rv-ink-text);
}

.rv-root .rv-user[aria-pressed="true"] small {
  color: var(--rv-ink-text);
}

.rv-pbody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rv-pfoot {
  padding: 16px 24px max(16px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rv-line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rv-status {
  margin: 0;
  font-size: 14px;
  color: var(--rv-muted);
}

.rv-marked {
  margin: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--rv-btn);
  font-weight: 600;
  color: var(--rv-text);
}

.rv-trail {
  margin: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--rv-line);
  padding-bottom: 8px;
}

.rv-trow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 0;
}

.rv-trow dt {
  flex: none;
  font-size: 14px;
  color: var(--rv-muted);
}

.rv-trow dd {
  margin: 0;
  min-width: 0;
  font-weight: 600;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rv-olist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rv-orow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid transparent !important;
  text-align: left;
  transition: background-color 150ms, border-color 150ms;
}

.rv-orow[aria-pressed="true"] {
  border-color: var(--rv-muted) !important;
  background: var(--rv-btn);
}

.rv-orow--old {
  color: var(--rv-muted);
}

.rv-orow-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rv-tagpill {
  flex: none;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #0b0c0e;
  white-space: nowrap;
}

.rv-tagpill--zone {
  background: rgba(11, 12, 14, 0.85);
  color: #fff;
  border: 1px solid #fff;
  font-size: 16px;
}

.rv-swatch {
  flex: none;
  width: 24px;
  height: 0;
  border-top: 2px dotted var(--rv-muted);
}

.rv-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rv-h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--rv-muted);
}

.rv-note-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rv-h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
}

.rv-composer {
  flex: 0 1 auto;
  gap: 12px;
}

.rv-textarea {
  width: 100%;
  min-height: 132px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--rv-line);
  background: var(--rv-stage);
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
}

.rv-textarea::placeholder {
  color: var(--rv-muted);
}

.rv-counter {
  align-self: flex-end;
  min-height: 20px;
  font-size: 14px;
  color: var(--rv-muted);
}

.rv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 600;
  text-align: center;
  transition: background-color 150ms, color 150ms, transform 100ms;
}

.rv-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.rv-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.rv-root .rv-btn--primary {
  background: var(--rv-ink);
  color: var(--rv-ink-text);
  font-size: 20px;
}

.rv-btn--big {
  min-height: 64px;
}

.rv-btn--second {
  background: var(--rv-btn) !important;
}

.rv-btn--plain {
  min-height: 48px;
  padding: 0 12px 0 4px;
}

.rv-btn--plain:last-child:not(:first-child) {
  padding: 0 4px 0 12px;
}

.rv-btn--ghost {
  width: 100%;
  min-height: 48px;
  color: var(--rv-danger) !important;
}

.rv-btn--decided {
  box-shadow: inset 0 0 0 2px var(--rv-ink);
}

.rv-btn--primary.rv-btn--decided {
  box-shadow: 0 0 0 2px var(--rv-panel), 0 0 0 4px var(--rv-ink);
}

.rv-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rv-sep {
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--rv-line);
}

.rv-dock[inert] {
  opacity: 0.6;
}

@media (hover: hover) {
  .rv-topbtn:hover,
  .rv-btn--plain:hover:not(:disabled),
  .rv-btn--ghost:hover:not(:disabled),
  .rv-orow:hover,
  .rv-toast-btn:hover {
    background: var(--rv-hover);
  }

  .rv-btn--second:hover:not(:disabled) {
    background: var(--rv-hover) !important;
  }
}

@media (max-width: 899px), (orientation: portrait) {
  .rv-root {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 56px auto 48px auto;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  .rv-stage {
    grid-column: 1;
    grid-row: 2;
    aspect-ratio: var(--rv-ar);
    max-height: 70vh;
    width: 100%;
  }

  .rv-bar {
    grid-row: 3;
  }

  .rv-panel {
    grid-column: 1;
    grid-row: 4;
    border-left: 0;
    border-top: 1px solid var(--rv-line);
  }

  .rv-pbody {
    overflow: visible;
    padding: 16px;
  }

  .rv-dock {
    position: sticky;
    bottom: 0;
    z-index: 4;
    background: var(--rv-panel);
  }

  .rv-phead,
  .rv-users,
  .rv-pfoot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .rv-top {
    gap: 8px;
  }

  .rv-time {
    display: none;
  }

  .rv-dock {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding-top: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }

  .rv-dock > .rv-error-text {
    grid-column: 1 / -1;
  }

  .rv-dock .rv-btn {
    min-height: 52px;
    padding: 0 8px;
    line-height: 1.2;
  }

  .rv-dock > .rv-sep {
    margin: 0;
    padding: 0;
    border: 0;
  }
}

@media (max-width: 599px) {
  .rv-top {
    height: auto;
    flex-wrap: wrap;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .rv-dock > .rv-btn--big,
  .rv-dock > .rv-two {
    grid-column: 1 / -1;
  }

  .rv-dock .rv-btn--second .rv-icon,
  .rv-dock .rv-btn--ghost .rv-icon {
    display: none;
  }

  .rv-dock .rv-btn--second,
  .rv-dock .rv-btn--ghost {
    font-size: 15px;
  }

  .rv-root {
    grid-template-rows: auto auto 48px auto;
  }

  .rv-vid {
    display: none;
  }

  .rv-grow {
    flex-basis: 0;
  }

  .rv-hint {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rv-root * {
    transition: none !important;
    animation: none !important;
  }

  .rv-btn:active:not(:disabled) {
    transform: none;
  }
}

.rv-user {
  max-width: 12em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--rv-muted);
}

@media (max-width: 599px) {
  .rv-user {
    display: none;
  }
}
