/* ---------- review layer: notes pinned to the page (review-only, remove at launch) ----------
   Self-contained so it looks the same on the light options and the dark one. Everything lives
   inside <rv-root>; nothing here restyles the site itself except the two mode cursors. */

rv-root {
  --rv-bg: #fffdf8; --rv-bg-2: #f1ebdf; --rv-ink: #1e3528; --rv-muted: #5c6b60;
  --rv-accent: #a4552c; --rv-accent-ink: #fff6ec; --rv-edit: #2f6f8f; --rv-line: rgb(30 53 40 / .16);
  --rv-danger: #9b2c2c; --rv-shadow: 0 20px 50px -20px rgb(0 0 0 / .45);
  display: block; font: 15px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--rv-ink);
}
rv-root *, rv-root *::before, rv-root *::after { box-sizing: border-box; }
rv-root [hidden] { display: none !important; }
rv-root button, rv-root input, rv-root textarea { font: inherit; }
rv-root h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
rv-root a { color: var(--rv-accent); }

.rv-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem .95rem; border-radius: 999px; border: 1px solid var(--rv-line); background: var(--rv-bg); color: var(--rv-ink); cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .15s, transform .1s, filter .15s; }
.rv-btn:hover { background: var(--rv-bg-2); }
.rv-btn:active { transform: scale(.97); }
.rv-btn.primary { background: var(--rv-accent); color: var(--rv-accent-ink); border-color: transparent; }
.rv-btn.primary:hover { filter: brightness(1.08); background: var(--rv-accent); }
.rv-btn.quiet { border-color: transparent; background: transparent; font-weight: 500; }
.rv-btn.danger { color: var(--rv-danger); }
.rv-btn[aria-pressed="true"] { background: var(--rv-ink); color: var(--rv-bg); border-color: transparent; }
.rv-btn[disabled] { opacity: .55; cursor: not-allowed; }
rv-root :is(button, input, textarea, a, [tabindex]):focus-visible { outline: 2px solid var(--rv-accent); outline-offset: 2px; }

/* floating entry button and the toolbar that replaces it */
.rv-fab { position: fixed; right: 1rem; bottom: 1rem; z-index: 9000; box-shadow: var(--rv-shadow); }
@media (max-width: 899px) { .rv-fab { bottom: 5rem; } }
.rv-bar { position: fixed; z-index: 9000; left: 50%; bottom: 1rem; transform: translateX(-50%); display: flex; gap: .35rem; padding: .35rem; border-radius: 999px; background: var(--rv-bg); border: 1px solid var(--rv-line); box-shadow: var(--rv-shadow); max-width: calc(100% - 1rem); }
.rv-bar .rv-btn { min-height: 42px; padding-inline: .8rem; }
@media (max-width: 599px) {
  .rv-bar { left: .5rem; right: .5rem; transform: none; justify-content: space-between; }
  .rv-bar .rv-btn { padding-inline: .5rem; font-size: .88rem; flex: 1; }
}
body.rv-on .float-cta { display: none; }

/* modes */
body.rv-mode-pin, body.rv-mode-pin * { cursor: crosshair !important; }
body.rv-mode-pin rv-root, body.rv-mode-pin rv-root * { cursor: default !important; }
body.rv-mode-edit :is(h1, h2, h3, h4, p, li, blockquote, dt, dd, small, summary, .btn):not(rv-root *):hover { outline: 2px dashed #a4552c; outline-offset: 3px; cursor: text; }
.rv-editing { outline: 2px solid #a4552c !important; outline-offset: 3px; background: rgb(164 85 44 / .08); }

/* pins follow their element every frame, so they stay put through pinned and transformed sections */
.rv-pins { position: fixed; inset: 0; z-index: 8990; pointer-events: none; }
.rv-pin { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 999px 999px 999px 4px; background: var(--rv-accent); color: var(--rv-accent-ink); border: 2px solid #fff; box-shadow: 0 6px 16px -6px rgb(0 0 0 / .6); font: 700 12px/24px "Segoe UI", system-ui, sans-serif; text-align: center; pointer-events: auto; cursor: pointer; padding: 0; will-change: transform; }
.rv-pin.edit { background: var(--rv-edit); border-radius: 6px; }
.rv-pin.done { background: #8a948c; }
.rv-pin.lost { display: none; }
.rv-pin:hover, .rv-pin.is-active { box-shadow: 0 0 0 4px rgb(164 85 44 / .3), 0 6px 16px -6px rgb(0 0 0 / .6); }

/* notes panel: drawer on a laptop, bottom sheet on a phone */
.rv-panel { position: fixed; z-index: 9010; top: 0; right: 0; bottom: 0; width: min(100%, 24rem); background: var(--rv-bg); border-left: 1px solid var(--rv-line); box-shadow: var(--rv-shadow); display: grid; grid-template-rows: auto 1fr auto; }
@media (max-width: 599px) { .rv-panel { top: auto; left: 0; width: auto; height: 72vh; border-left: 0; border-top: 1px solid var(--rv-line); border-radius: 1rem 1rem 0 0; } }
.rv-panel > header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .6rem .7rem 1rem; border-bottom: 1px solid var(--rv-line); }
.rv-panel > .list { overflow: auto; overscroll-behavior: contain; }
.rv-panel > footer { padding: .5rem .6rem .5rem 1rem; border-top: 1px solid var(--rv-line); display: flex; gap: .25rem .75rem; justify-content: space-between; align-items: center; flex-wrap: wrap; font-size: .88rem; }
.rv-note { padding: .8rem 1rem; border-bottom: 1px solid var(--rv-line); display: grid; grid-template-columns: 28px 1fr; gap: .6rem; cursor: pointer; }
.rv-note > div { min-width: 0; }
.rv-note:hover { background: var(--rv-bg-2); }
.rv-note.is-active { background: rgb(164 85 44 / .09); }
.rv-note .num { width: 26px; height: 26px; border-radius: 999px 999px 999px 4px; background: var(--rv-accent); color: var(--rv-accent-ink); font: 700 12px/26px "Segoe UI", system-ui, sans-serif; text-align: center; }
.rv-note .num.edit { background: var(--rv-edit); border-radius: 6px; }
.rv-note.done .num { background: #8a948c; }
.rv-note .kind { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--rv-muted); }
.rv-note .where { font-size: .85rem; color: var(--rv-muted); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-note .body { margin: .3rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rv-note del { color: var(--rv-muted); }
.rv-note ins { text-decoration: none; background: rgb(47 122 74 / .16); border-radius: 3px; padding: 0 .15em; }
.rv-note.done .body { opacity: .6; }
.rv-note .warn { font-size: .8rem; color: var(--rv-danger); margin: .2rem 0; }
.rv-note .meta { font-size: .8rem; color: var(--rv-muted); display: flex; gap: .3rem .8rem; align-items: center; flex-wrap: wrap; margin-top: .25rem; }
.rv-note .meta label { display: inline-flex; gap: .35rem; align-items: center; cursor: pointer; min-height: 32px; }
.rv-note .meta input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--rv-accent); }
.rv-note .meta .rv-btn { min-height: 32px; padding: .2rem .6rem; font-size: .8rem; }
.rv-note .confirm { display: inline-flex; gap: .3rem; align-items: center; }
.rv-empty, .rv-error, .rv-skel { padding: 1.2rem 1rem; color: var(--rv-muted); line-height: 1.5; }
.rv-error { color: var(--rv-danger); display: grid; gap: .6rem; justify-items: start; }
.rv-skel i { display: block; height: .9rem; border-radius: 4px; background: var(--rv-bg-2); margin: .55rem 0; animation: rv-shimmer 1.1s infinite alternate; }
.rv-skel i:nth-child(2) { width: 80%; } .rv-skel i:nth-child(3) { width: 55%; }
@keyframes rv-shimmer { to { opacity: .4; } }

/* compose popover and the code gate */
.rv-pop { position: fixed; z-index: 9020; width: min(100% - 1rem, 22rem); background: var(--rv-bg); border: 1px solid var(--rv-line); border-radius: 1rem; box-shadow: var(--rv-shadow); padding: .9rem; display: grid; gap: .6rem; }
@media (max-width: 599px) { .rv-pop { left: .5rem !important; right: .5rem; bottom: .5rem; top: auto !important; width: auto; } }
.rv-pop .hint { font-size: .85rem; color: var(--rv-muted); margin: 0; overflow-wrap: anywhere; }
.rv-pop textarea, .rv-pop input { width: 100%; padding: .6rem .7rem; border: 1px solid var(--rv-line); border-radius: .6rem; background: #fff; color: var(--rv-ink); min-height: 44px; }
.rv-pop textarea { min-height: 6rem; resize: vertical; }
.rv-pop label { font-size: .85rem; font-weight: 600; display: grid; gap: .3rem; }
.rv-pop .row { display: flex; gap: .5rem; justify-content: flex-end; }
.rv-pop .err { color: var(--rv-danger); font-size: .85rem; margin: 0; min-height: 0; }
.rv-pop .err:empty { display: none; }
.rv-gate { top: 50% !important; left: 50% !important; right: auto; bottom: auto !important; transform: translate(-50%, -50%); }
.rv-backdrop { position: fixed; inset: 0; z-index: 9015; background: rgb(0 0 0 / .35); }

/* toasts */
.rv-toasts { position: fixed; z-index: 9030; left: 50%; bottom: 4.6rem; transform: translateX(-50%); width: max-content; max-width: calc(100% - 1.5rem); pointer-events: none; }
.rv-toast { background: var(--rv-ink); color: var(--rv-bg); padding: .6rem .9rem; border-radius: .7rem; box-shadow: var(--rv-shadow); display: flex; gap: .7rem; align-items: center; font-size: .92rem; pointer-events: auto; }
@media (max-width: 599px) { .rv-toasts { top: 4.5rem; bottom: auto; } }
.rv-toast.error { background: var(--rv-danger); color: #fff; }
.rv-toast button { background: transparent; border: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: .2rem .3rem; min-height: 32px; }

@media (prefers-reduced-motion: reduce) { .rv-skel i { animation: none; } .rv-btn { transition: none; } }
