/* Collaboratorium review: the app around the page. Built on the Fly-by-Wireframe kit (loaded first): every color, space
   and font here is one of the kit's semantic tokens, so the app follows the kit's light, dark and brand modes. */
html, body { height: 100%; }
body.rv { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; background: var(--fbw-color-surface-sunken); } /* only the page inside scrolls */
.rv code { font-family: var(--fbw-font-family-code); }

/* Bar */
.rv-bar { flex: none; display: flex; flex-wrap: wrap; gap: var(--fbw-space-inline-md); align-items: center; justify-content: space-between;
  padding: var(--fbw-space-inset-sm) var(--fbw-space-page-margin); background: var(--fbw-color-surface-page); border-bottom: 1px solid var(--fbw-color-border-default); }
.rv-bar__id { flex: 1 1 20rem; min-width: 0; display: flex; align-items: center; gap: var(--fbw-space-inline-sm) var(--fbw-space-inline-md); }
.rv-bar__id fbw-logo { flex: none; }
.rv-bar__page { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: var(--fbw-space-inline-md); border-left: 1px solid var(--fbw-color-border-default); }
.rv-gate fbw-logo { display: block; margin-bottom: var(--fbw-space-stack-md); }
.rv-bar__page { margin: 0; font-weight: var(--fbw-font-weight-semibold); overflow-wrap: anywhere; max-width: none; }
.rv-bar__acts { flex: none; display: flex; flex-wrap: wrap; gap: var(--fbw-space-inline-sm); align-items: center; }
.rv-menu { position: relative; }
.rv-menu summary { list-style: none; }
.rv-menu summary::-webkit-details-marker { display: none; }
.rv-menu summary::after { content: " ▾"; }
.rv-menu__panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: var(--fbw-depth-z-dropdown); display: grid; gap: 2px; min-width: 16rem;
  padding: var(--fbw-space-inset-xs); background: var(--fbw-color-surface-raised); border: 1px solid var(--fbw-color-border-strong); box-shadow: var(--fbw-depth-shadow-2); }
.rv-menu__panel .fbw-btn { justify-content: flex-start; width: 100%; }

/* Stage: a grey canvas with the page in a window (desktop) or a device (tablet, mobile) */
.rv-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rv-viewbar { flex: none; display: flex; flex-wrap: wrap; gap: var(--fbw-space-inline-sm); align-items: center; justify-content: center;
  padding: var(--fbw-space-inset-xs) var(--fbw-space-page-margin); background: var(--fbw-color-surface-page); border-bottom: 1px solid var(--fbw-color-border-default); }
.rv-viewbar [aria-pressed="true"], .rv-bar__acts [aria-pressed="true"] { background: var(--fbw-color-text-default); color: var(--fbw-color-surface-page); border-color: var(--fbw-color-text-default); }
.rv-dim { font-family: var(--fbw-font-family-mono); opacity: .7; margin-left: 4px; }
.rv-landscape { margin-left: var(--fbw-space-inline-md); font-size: var(--fbw-font-size-sm); }
.rv-limited { flex: none; margin: 0; border-radius: 0; }
.rv-limited p { max-width: none; margin: 0; }
.rv-work { flex: 1; min-height: 0; display: flex; }
.rv-side { flex: none; width: min(26rem, 45vw); border-left: 1px solid var(--fbw-color-border-strong); background: var(--fbw-color-surface-sunken); display: flex; }
.rv-side[hidden] { display: none; }
.rv-side iframe { flex: 1; width: 100%; height: 100%; border: 0; }
.rv-canvas { flex: 1; min-width: 0; min-height: 0; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: var(--fbw-space-inset-lg); }
.rv-device { --w: 100%; --h: 100%; position: relative; display: flex; flex-direction: column; flex: none; width: var(--w); height: var(--h); max-width: 100%; max-height: 100%; }
.rv-device__screen { flex: 1; min-height: 0; display: flex; overflow: hidden; background: var(--fbw-color-surface-page); }
.rv-device__screen { position: relative; }
.rv-loading { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: var(--fbw-color-surface-page); color: var(--fbw-color-text-subtle); }
.rv-loading[hidden] { display: none; }
.rv-device__screen iframe.is-loading { visibility: hidden; }
.rv-device__screen iframe { flex: 1; width: 100%; height: 100%; border: 0; background: var(--fbw-color-surface-page); }
/* Desktop: a window with a title bar */
.rv-device[data-device="desktop"] { border: 1px solid var(--fbw-color-border-strong); box-shadow: var(--fbw-depth-shadow-3); background: var(--fbw-color-surface-raised); }
.rv-device__bar { flex: none; display: flex; align-items: center; gap: var(--fbw-space-inline-md); height: 34px; padding: 0 var(--fbw-space-inset-sm);
  border-bottom: 1px solid var(--fbw-color-border-default); background: var(--fbw-color-surface-sunken); }
.rv-device__dots { display: flex; gap: 6px; }
.rv-device__dots i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--fbw-color-border-strong); }
.rv-device__dots i:first-child { background: var(--fbw-brand-seed, var(--fbw-color-text-accent)); border-color: transparent; }
.rv-device__name { flex: 1; min-width: 0; text-align: center; margin-right: 46px; font: 500 var(--fbw-font-size-xs)/1 var(--fbw-font-family-mono); color: var(--fbw-color-text-subtle);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Tablet and mobile: a bezel at the device's real size (it shrinks to fit the window height; the page scrolls inside) */
.rv-device[data-device="tablet"], .rv-device[data-device="mobile"] { background: var(--fbw-color-text-default); box-shadow: var(--fbw-depth-shadow-3); }
.rv-device[data-device="tablet"] { --w: calc(768px + 2 * 18px); --h: calc(1024px + 2 * 18px); padding: 18px; border-radius: 30px; }
.rv-device[data-device="tablet"].is-landscape { --w: calc(1024px + 2 * 18px); --h: calc(768px + 2 * 18px); }
.rv-device[data-device="mobile"] { --w: calc(375px + 2 * 12px); --h: calc(667px + 2 * 34px); padding: 34px 12px; border-radius: 44px; }
.rv-device[data-device="mobile"].is-landscape { --w: calc(667px + 2 * 34px); --h: calc(375px + 2 * 12px); padding: 12px 34px; }
.rv-device[data-device="tablet"] .rv-device__bar, .rv-device[data-device="mobile"] .rv-device__bar { display: none; }
.rv-device[data-device="tablet"] .rv-device__screen { border-radius: 8px; }
.rv-device[data-device="mobile"] .rv-device__screen { border-radius: 6px; }
/* the phone's speaker and the tablet's camera, drawn on the bezel */
.rv-device[data-device="mobile"]::before, .rv-device[data-device="tablet"]::before { content: ""; position: absolute; left: 50%; transform: translateX(-50%); background: var(--fbw-color-surface-page); opacity: .35; border-radius: 99px; }
.rv-device[data-device="mobile"]::before { top: 15px; width: 56px; height: 5px; }
.rv-device[data-device="tablet"]::before { top: 7px; width: 5px; height: 5px; }
.rv-device[data-device="mobile"].is-landscape::before { top: 50%; left: 15px; width: 5px; height: 56px; transform: translateY(-50%); }
.rv-device[data-device="tablet"].is-landscape::before { top: 50%; left: 7px; transform: translateY(-50%); }
.rv-empty { max-width: 40rem; margin: auto; padding: var(--fbw-space-inset-xl); background: var(--fbw-color-surface-page); border: 1px solid var(--fbw-color-border-default); }
.rv-empty h1 { font-size: var(--fbw-font-size-3xl); margin: var(--fbw-space-stack-xs) 0 var(--fbw-space-stack-sm); }
.rv-lede { font-size: var(--fbw-font-size-lg); color: var(--fbw-color-text-subtle); margin-bottom: var(--fbw-space-stack-md); }
.rv-empty p + p { margin-top: var(--fbw-space-stack-sm); }
@media (max-width: 40rem) { .rv-canvas { padding: var(--fbw-space-inset-xs); } }

/* Gate */
body.rv--gate { height: auto; min-height: 100dvh; overflow: auto; align-items: center; justify-content: center; padding: var(--fbw-space-page-margin); }
.rv-gate { width: 100%; max-width: 32rem; padding: var(--fbw-space-inset-xl); background: var(--fbw-color-surface-page); border: 1px solid var(--fbw-color-border-default); }
.rv-gate h1 { font-size: var(--fbw-font-size-3xl); margin: var(--fbw-space-stack-xs) 0 var(--fbw-space-stack-sm); }
.rv-gate form { margin: var(--fbw-space-stack-md) 0; }
.rv-label { display: block; font-weight: var(--fbw-font-weight-semibold); }
.rv-hint { color: var(--fbw-color-text-subtle); font-size: var(--fbw-font-size-sm); margin: 2px 0 var(--fbw-space-stack-xs); }
.rv-error { color: var(--fbw-color-feedback-error-text); background: var(--fbw-color-feedback-error-surface); border-left: 3px solid var(--fbw-color-feedback-error-border);
  padding: var(--fbw-space-inset-xs) var(--fbw-space-inset-sm); margin: 0 0 var(--fbw-space-stack-xs); font-weight: var(--fbw-font-weight-semibold); }
.rv-input { width: 100%; min-height: 48px; padding: var(--fbw-space-inset-xs) var(--fbw-space-inset-sm); background: var(--fbw-color-surface-field);
  border: 1px solid var(--fbw-color-border-input); color: var(--fbw-color-text-default); margin-bottom: var(--fbw-space-stack-sm); }
.rv-input:hover { border-color: var(--fbw-color-border-input-hover); }
.rv-input[aria-invalid="true"] { border-color: var(--fbw-color-feedback-error-border); border-width: 2px; }
.rv-input--code { font: 600 var(--fbw-font-size-lg)/1.4 var(--fbw-font-family-mono); letter-spacing: .06em; text-transform: uppercase; }

/* Dialogs and status */
.rv-dialog { max-width: 38rem; width: calc(100% - 32px); padding: var(--fbw-space-inset-lg); background: var(--fbw-color-surface-raised); color: var(--fbw-color-text-default);
  border: 1px solid var(--fbw-color-border-strong); box-shadow: var(--fbw-depth-shadow-3); margin: auto; }
.rv-dialog::backdrop { background: rgb(0 0 0 / .5); }
.rv-dialog h2 { font-size: var(--fbw-font-size-xl); margin-bottom: var(--fbw-space-stack-sm); }
.rv-dialog p, .rv-dialog ul { margin-bottom: var(--fbw-space-stack-sm); }
.rv-dialog ul { padding-left: 1.2rem; }
.rv-dialog li + li { margin-top: var(--fbw-space-stack-xs); }
.rv-row { display: flex; flex-wrap: wrap; gap: var(--fbw-space-inline-sm); align-items: center; margin-bottom: var(--fbw-space-stack-sm); }
.rv-row--end { justify-content: flex-end; margin: var(--fbw-space-stack-md) 0 0; }
.rv-check { display: inline-flex; gap: var(--fbw-space-inline-xs); align-items: center; }
.rv-report { border-top: 1px solid var(--fbw-color-border-default); padding-top: var(--fbw-space-stack-sm); font-size: var(--fbw-font-size-sm); overflow-wrap: anywhere; }
.rv-report p { max-width: none; }
.rv-status { position: fixed; left: 50%; bottom: var(--fbw-space-inset-md); transform: translateX(-50%); z-index: var(--fbw-depth-z-toast); max-width: min(44rem, calc(100% - 32px));
  padding: var(--fbw-space-inset-sm) var(--fbw-space-inset-md); background: var(--fbw-color-surface-inverse); color: var(--fbw-color-text-inverse);
  box-shadow: var(--fbw-depth-shadow-2); opacity: 0; pointer-events: none; transition: opacity var(--fbw-motion-duration-fast, .2s); }
.rv-status.on { opacity: 1; }
