/* A static replica of the consiens review screen (web/src/modules/review) for the
   mockups. Tokens are copied from web/src/index.css. Everything is scoped to .rr and
   uses only div, span and form controls, so page styles cannot leak in. */

@font-face {
    font-family: "Consiens Inter";
    src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

.rr {
    --background: #f7f7f7; --foreground: #212121; --card: #ffffff; --primary: #212121; --primary-fg: #ffffff;
    --muted: #f1f1f1; --muted-fg: #5e5e5e; --subtle-fg: #6b6b6b; --border: #dddddd; --border-subtle: #ebebeb; --divider: #f0f0f0;
    --brand: #ff5700; --brand-fg: #212121; --brand-tint: #fff0e6; --brand-tint-border: #ffd2b5; --brand-tint-fg: #9a3500;
    --destructive: #c62828; --row-hover: #fafafa; --row-selected: #f7f7f7;
    --canvas: #f3f3f3; --canvas-dot: #d2d2d2; --panel: #ffffff; --panel-border: #e6e6e6;
    --panel-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.07);
    --image-shadow: 0 1px 3px rgba(0,0,0,.08), 0 12px 32px rgba(0,0,0,.1);
    --glow: 0 0 0 3px rgba(255,87,0,.25);

    container-type: inline-size;
    width: 100%;
    color: var(--foreground);
    background: var(--background);
    font: 400 14px/1.45 "Consiens Inter", Inter, system-ui, sans-serif;
    font-feature-settings: "cv11";
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
    -webkit-font-smoothing: antialiased;
}
.rr[data-theme="dark"] {
    --background: #141414; --foreground: #f1f1f1; --card: #1e1e1e; --primary: #f1f1f1; --primary-fg: #212121;
    --muted: #2a2a2a; --muted-fg: #a8a8a8; --subtle-fg: #9a9a9a; --border: #333333; --border-subtle: #2a2a2a; --divider: #262626;
    --brand-tint: #3a1e0e; --brand-tint-border: #6b3415; --brand-tint-fg: #ffb38a;
    --destructive: #ef5350; --row-hover: #222222; --row-selected: #262626;
    --canvas: #101010; --canvas-dot: #2e2e2e; --panel: #1e1e1e; --panel-border: #333333;
    --panel-shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.4);
    --image-shadow: 0 1px 3px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.5);
}
.rr * { box-sizing: border-box; }
.rr button, .rr input, .rr textarea, .rr select { font: inherit; color: inherit; letter-spacing: inherit; margin: 0; }
.rr svg { display: block; }
.rr :focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.rr [hidden] { display: none !important; }

.rr-grid { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 360px; grid-template-rows: 56px minmax(0,1fr); height: var(--rr-height, 660px); overflow: hidden; }

/* top bar */
.rr-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 16px; background: var(--card); border-bottom: 1px solid var(--border-subtle); }
.rr-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 26cqw; }
.rr-space { flex: 1; }
.rr-sep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; flex: none; }
.rr-badge { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 20px; flex: none; border: 1px solid transparent; border-radius: 24px; padding: 0 8px; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; background: var(--primary); color: var(--primary-fg); }
.rr-badge.secondary { background: var(--muted); color: var(--foreground); }
.rr-badge.outline { background: none; border-color: var(--border); color: var(--foreground); }
.rr-badge.destructive { background: color-mix(in srgb, var(--destructive) 12%, transparent); color: var(--destructive); }

.rr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 6px; background: none; font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer; }
.rr .rr-btn.primary { background: var(--primary); color: var(--primary-fg); }
.rr .rr-btn.primary:hover { opacity: .85; }
.rr-btn.outline { border-color: var(--border); background: var(--background); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.rr-btn.outline:hover, .rr-btn.ghost:hover { background: var(--muted); }
.rr .rr-btn.tint { border-color: var(--brand-tint-border); background: var(--brand-tint); color: var(--brand-tint-fg); }
.rr-btn.sm { height: 32px; font-size: 13.5px; }
.rr-btn.xs { height: 24px; padding: 0 8px; font-size: 12px; }
.rr-btn.icon { width: 36px; padding: 0; }
.rr-btn.icon.sm { width: 32px; }
.rr-btn.icon.lg { width: 40px; height: 40px; border-radius: 8px; }
.rr-btn.icon.mini { width: 28px; height: 28px; }
.rr-btn:disabled { opacity: .5; pointer-events: none; }

.rr-avatar { position: relative; display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--muted); color: var(--muted-fg); font-size: 10px; font-weight: 600; line-height: 1; }
.rr-avatar.me { background: var(--primary); color: var(--primary-fg); }
.rr-avatar.big { width: 32px; height: 32px; }
.rr-avatar.small { width: 20px; height: 20px; font-size: 9px; }
.rr-avatar i { position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); color: var(--primary-fg); box-shadow: 0 0 0 2px var(--card); }
.rr-avatar i.changes { background: var(--brand); color: var(--brand-fg); }
.rr-faces { display: inline-flex; align-items: center; gap: 6px; }
.rr-faces .rr-summary { margin-left: 2px; font-size: 13px; color: var(--muted-fg); white-space: nowrap; }

/* canvas */
.rr-main { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr); min-width: 0; min-height: 0; }
.rr-main.railed { grid-template-columns: 112px minmax(0,1fr); }
.rr-rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px; background: var(--card); border-right: 1px solid var(--border-subtle); }
.rr-thumb { position: relative; width: 100%; border-radius: 4px; background: var(--card); box-shadow: 0 0 0 2px var(--primary); line-height: 0; }
.rr-thumb canvas { width: 100%; height: auto; border-radius: 4px; }
.rr-thumb .rr-badge { position: absolute; top: 4px; right: 4px; height: 16px; min-width: 16px; padding: 0 4px; line-height: 16px; }
.rr-thumb i { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--destructive); left: 4px; }
.rr-thumb i.ink { top: 4px; } .rr-thumb i.code { bottom: 4px; }
.rr-rail > span { font-size: 12px; color: var(--muted-fg); }

.rr-canvas { position: relative; overflow: hidden; container-type: size; display: grid; place-items: center; background-color: var(--canvas); background-image: radial-gradient(circle, var(--canvas-dot) 1px, transparent 1.4px); background-size: 22px 22px; }
.rr-art { position: relative; isolation: isolate; width: min(calc(100cqw - 64px), calc((100cqh - 150px) * var(--ratio))); aspect-ratio: var(--ratio); box-shadow: var(--image-shadow); line-height: 0; margin-bottom: 14px; touch-action: manipulation; }
.rr-art > .rr-layer, .rr-art > .rr-layer > svg, .rr-art > .rr-layer > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.rr-art[data-tool="comment"] { cursor: crosshair; }
.rr-art[data-tool="rect"], .rr-art[data-tool="arrow"], .rr-art[data-tool="pen"], .rr-art[data-tool="highlight"] { cursor: crosshair; touch-action: none; }
.rr-art[data-tool="hand"] { cursor: grab; touch-action: none; }
.rr-art svg.rr-draw { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.rr-markers { position: absolute; inset: 0; pointer-events: none; }
.rr .rr-marker { position: absolute; pointer-events: auto; border: 0; background: none; padding: 0; cursor: pointer; line-height: 0; scale: var(--unzoom, 1); filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.rr .rr-marker.at-pin { width: 28px; height: 28px; margin: -28px 0 0; transform-origin: 0 100%; }
.rr .rr-marker.at-badge { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
.rr .rr-marker.rr-ghost { pointer-events: none; opacity: .6; }
.rr-marker svg { overflow: visible; }
.rr-marker text { font: 600 12px "Consiens Inter", Inter, sans-serif; }

.rr-cursor { position: absolute; z-index: 1; pointer-events: none; line-height: 0; animation: rr-roam 7s ease-in-out infinite; }
.rr-cursor b { position: absolute; left: 12px; top: 14px; border-radius: 10px; padding: 3px 8px; background: #2f7bff; color: #fff; font-size: 12px; font-weight: 500; line-height: 14px; }
@keyframes rr-roam { 50% { transform: translate(-46px, -60px); } }
@media (prefers-reduced-motion: reduce) { .rr-cursor { animation: none; } }

.rr-panel { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px; box-shadow: var(--panel-shadow); }
.rr-layers { position: absolute; top: 16px; right: 16px; z-index: 3; display: grid; justify-items: end; gap: 8px; }
.rr-layers > .rr-btn { height: 40px; padding: 0 12px; background: var(--panel); border-color: var(--panel-border); border-radius: 12px; box-shadow: var(--panel-shadow); }
.rr-pop { padding: 6px; min-width: 240px; }
.rr-pop .rr-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-size: 13px; }
.rr-pop .rr-row span.grow { flex: 1; white-space: nowrap; }
.rr kbd { font: 500 11px "Consiens Inter", Inter, sans-serif; background: var(--muted); color: var(--muted-fg); border-radius: 4px; padding: 2px 6px; }

.rr-zoom { position: absolute; left: 16px; bottom: 16px; z-index: 2; display: flex; align-items: center; gap: 2px; padding: 4px; }
.rr-zoom .rr-pct { width: 58px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }
.rr-tools { position: absolute; left: 50%; bottom: 16px; z-index: 2; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 4px; }
.rr-tools .rr-sep, .rr-zoom .rr-sep { margin: 0 4px; }
.rr .rr-tools .rr-btn[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); }
.rr-swatch { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.rr-colors { position: absolute; left: 50%; bottom: 72px; z-index: 4; transform: translateX(-50%); display: grid; grid-template-columns: repeat(6, 26px); gap: 6px; padding: 10px; }
.rr .rr-colors button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.rr .rr-colors button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--primary); }
.rr-keys { position: absolute; right: 16px; bottom: 16px; z-index: 2; display: grid; justify-items: end; gap: 8px; }
.rr-keys > .rr-btn { background: var(--panel); border-color: var(--panel-border); border-radius: 12px; box-shadow: var(--panel-shadow); }

.rr-composer { position: absolute; z-index: 5; width: 320px; max-width: calc(100% - 24px); padding: 10px; display: grid; gap: 10px; }
.rr textarea { width: 100%; display: block; resize: none; background: var(--background); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; line-height: 1.4; }
.rr-composer textarea, .rr textarea:focus { border-color: var(--primary); box-shadow: var(--glow); outline: none; }
.rr-composer .rr-row { display: flex; align-items: center; gap: 8px; }
.rr-composer .rr-target { flex: 1; font-size: 12px; color: var(--muted-fg); }

.rr-dot { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }

/* compare */
.rr-compare { position: absolute; top: 14px; left: 50%; z-index: 3; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; width: max-content; max-width: calc(100% - 24px); padding: 6px 8px; }
.rr-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.rr .rr-toggle button { height: 30px; border: 0; background: none; padding: 0 10px; font-size: 13px; font-weight: 500; cursor: pointer; border-left: 1px solid var(--border); }
.rr .rr-toggle button:first-child { border-left: 0; }
.rr .rr-toggle button[aria-pressed="true"] { background: var(--muted); }
.rr .rr-compare input[type="range"] { width: 120px; accent-color: var(--primary); }
.rr .rr-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
.rr .rr-switch input { accent-color: var(--primary); }
.rr-canvas.comparing .rr-art { margin-top: 44px; margin-bottom: 0; width: min(calc(100cqw - 48px), calc((100cqh - 170px) * var(--ratio))); }
.rr-art.side { box-shadow: none; }
.rr-art.side > .rr-layer { width: calc(50% - 6px); box-shadow: var(--image-shadow); }
.rr-art.side > .rr-layer.head { left: calc(50% + 6px); }
.rr-art.slider > .rr-layer.head { clip-path: inset(0 0 0 var(--cut)); }
.rr-art.diff > .rr-layer.head { mix-blend-mode: difference; }
.rr-wipe { position: absolute; top: 0; bottom: 0; left: var(--cut); width: 2px; margin-left: -1px; background: var(--primary); pointer-events: none; }
.rr-art:not(.slider) .rr-wipe { display: none; }
.rr-vtag { position: absolute; bottom: -24px; font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--muted-fg); }

/* sidebar */
.rr-side { min-height: 0; overflow-y: auto; scrollbar-width: thin; background: var(--card); border-left: 1px solid var(--border-subtle); }
.rr-side-head { position: sticky; top: 0; z-index: 2; display: grid; gap: 12px; padding: 16px; background: var(--card); border-bottom: 1px solid var(--border-subtle); }
.rr-title { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; font-weight: 600; }
.rr-title small { font-size: 12.5px; font-weight: 400; color: var(--muted-fg); }
.rr-tabs { display: grid; grid-template-columns: repeat(3, 1fr); height: 36px; padding: 3px; border-radius: 8px; background: var(--muted); }
.rr .rr-tabs button { display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 6px; background: none; font-size: 14px; font-weight: 500; color: color-mix(in srgb, var(--foreground) 60%, transparent); cursor: pointer; }
.rr .rr-tabs button[aria-selected="true"] { background: var(--card); color: var(--foreground); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.rr[data-theme="dark"] .rr-tabs button[aria-selected="true"] { background: #3a3a3a; }
.rr-tabs span { color: var(--muted-fg); font-variant-numeric: tabular-nums; }
.rr-thread { position: relative; border-bottom: 1px solid var(--divider); }
.rr-thread:hover { background: var(--row-hover); }
.rr-thread.selected { background: var(--row-selected); }
.rr .rr-open { display: grid; gap: 6px; width: 100%; border: 0; background: none; padding: 14px 16px; text-align: left; cursor: pointer; }
.rr-who { display: flex; align-items: center; gap: 8px; min-width: 0; padding-right: 64px; }
.rr-who b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-who small { flex: none; font-size: 12.5px; color: var(--subtle-fg); }
.rr-body { font-size: 14px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.rr-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted-fg); }
.rr-actions { position: absolute; top: 10px; right: 12px; display: flex; gap: 2px; opacity: 0; }
.rr-thread:hover .rr-actions, .rr-thread:focus-within .rr-actions, .rr-thread.selected .rr-actions { opacity: 1; }
.rr-replies { display: grid; gap: 12px; padding: 0 16px 16px; }
.rr-reply { position: relative; display: grid; gap: 2px; padding-left: 44px; }
.rr-reply .rr-avatar { position: absolute; top: 0; left: 18px; }
.rr-reply b { font-size: 13px; font-weight: 600; }
.rr-reply small { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--subtle-fg); }
.rr-reply div { font-size: 13.5px; }
.rr-input { display: flex; align-items: flex-end; gap: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--background); padding-right: 6px; }
.rr-input:focus-within { border-color: var(--primary); box-shadow: var(--glow); }
.rr .rr-input textarea { flex: 1; border: 0; box-shadow: none; background: none; }
.rr-input .rr-btn { margin-bottom: 6px; }
.rr-empty { display: grid; justify-items: center; gap: 8px; padding: 40px 32px; text-align: center; }
.rr-empty i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--muted); }
.rr-empty b { font-weight: 500; }
.rr-empty span { font-size: 13.5px; color: var(--muted-fg); }

/* feature panels above the comments */
.rr-feature { display: grid; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border-subtle); }
.rr-feature-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 500; }
.rr-feature-head > span { display: flex; align-items: center; gap: 8px; }
.rr-alert { display: flex; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; color: var(--muted-fg); }
.rr-alert svg { flex: none; margin-top: 2px; }

/* dialogs and toasts */
.rr-scrim { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.5); }
.rr-dialog { width: min(480px, 100%); display: grid; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.rr-dialog b { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.rr-dialog label { display: grid; gap: 6px; font-weight: 500; }
.rr-dialog label textarea { font-weight: 400; }
.rr-dialog .rr-note { color: var(--muted-fg); }
.rr-dialog .rr-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.rr-menu { position: absolute; top: 50px; z-index: 10; padding: 4px; }
.rr-toast { position: absolute; right: 16px; bottom: 76px; z-index: 15; padding: 12px 16px; font-size: 13.5px; font-weight: 500; }
.rr-narrow { display: none !important; }

/* Below 900px the sidebar moves under the canvas, below 620px the chrome thins out
   the way the app's phone layout does. */
@container (max-width: 900px) {
    .rr-grid { grid-template-columns: minmax(0,1fr); grid-template-rows: 56px var(--rr-canvas-height, 480px) auto; height: auto; }
    .rr-main.railed { grid-template-columns: minmax(0,1fr); }
    .rr-rail { display: none; }
    .rr-side { border-left: 0; border-top: 1px solid var(--border-subtle); max-height: 420px; }
    .rr-keys { display: none; }
    .rr .rr-tools { left: auto; right: 12px; transform: none; }
}
@container (max-width: 720px) {
    .rr-zoom { display: none; }
    .rr .rr-tools { left: 50%; right: auto; transform: translateX(-50%); }
}
@container (max-width: 620px) {
    .rr-wide { display: none !important; }
    .rr-narrow { display: inline-flex !important; }
    .rr-top { padding: 0 12px; }
    .rr-tools { gap: 2px; bottom: 10px; }
    .rr .rr-tools .rr-btn { width: 34px; height: 34px; }
    .rr-tools .rr-sep { margin: 0 2px; }
    .rr-art { width: min(calc(100cqw - 24px), calc((100cqh - 130px) * var(--ratio))); }
    .rr-layers { display: none; }
    .rr .rr-compare .rr-switch { display: none; }
    .rr .rr-canvas.comparing .rr-art { margin-top: 84px; width: min(calc(100cqw - 24px), calc((100cqh - 140px) * var(--ratio))); }
}
