/* Remove background: the working screen, the one-time download note, the before/after picture and the save panel.
   Colours come from app.css. */

/* ---------- working ---------- */
.rb-work { display: grid; gap: 14px; padding: 24px 0 8px; text-align: center; }
.rb-spin { display: grid; place-items: center; }
.rb-status { color: var(--ink); font-size: 1.15rem; font-weight: 700; }
.rb-bar { width: 100%; height: 1.1rem; margin: 0; border: 0; border-radius: 999px; overflow: hidden; background: var(--brand-soft); accent-color: var(--brand-2); -webkit-appearance: none; appearance: none; }
.rb-bar::-webkit-progress-bar { border-radius: 999px; background: var(--brand-soft); }
.rb-bar::-webkit-progress-value { border-radius: 999px; background: var(--brand-2); transition: width .2s; }
.rb-bar::-moz-progress-bar { border-radius: 999px; background: var(--brand-2); }
.rb-detail { min-height: 1.6em; color: var(--ink-2); font-size: 1rem; }
.rb-mini { display: inline-block; width: 1.1rem; height: 1.1rem; border: 3px solid currentColor; border-top-color: transparent; border-radius: 50%; vertical-align: -.2em; animation: spin .9s linear infinite; }
.rb-actions { display: grid; gap: 10px; }
@media (prefers-reduced-motion: reduce) {
  .rb-bar::-webkit-progress-value { transition: none; }
  .rb-mini { animation-duration: 3s; }
}

/* ---------- the one-time download note ---------- */
.rb-first { display: grid; gap: 18px; align-items: center; margin-bottom: 18px; }
@media (min-width: 720px) { .rb-first { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.rb-thumb { display: block; width: auto; max-width: 100%; height: auto; max-height: min(22rem, 34svh); margin: 0 auto; object-fit: contain; border-radius: var(--radius-md); box-shadow: 0 0 0 1px var(--line-2); }
.rb-first-text { display: grid; gap: 10px; }
.rb-h2 { font-size: 1.35rem; }

/* ---------- result ---------- */
.rb-result { display: grid; gap: 18px; }
.rb-main { display: grid; gap: 18px; }
@media (min-width: 900px) {
  .rb-main { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-template-areas: "view dl" "view side"; align-items: start; }
  .rb-dl { grid-area: dl; }
  .rb-view { grid-area: view; }
  .rb-side { grid-area: side; }
}
.rb-dl { display: grid; gap: 14px; }
.rb-h3 { font-size: 1.2rem; }
.rb-dl-slot { display: grid; gap: 10px; }
.rb-side { display: grid; gap: 16px; }

/* ---------- before / after ---------- */
.rb-cmp { display: grid; gap: 10px; }
.rb-cmp-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.rb-seg { display: inline-flex; overflow: hidden; border: 2px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.rb-seg-btn { min-width: 44px; min-height: 44px; padding: 0 14px; border: 0; background: transparent; color: var(--ink); font-weight: 700; cursor: pointer; }
.rb-seg-btn + .rb-seg-btn { border-left: 2px solid var(--line-2); }
.rb-seg-btn[aria-pressed="true"] { background: var(--brand-2); color: var(--surface); }
.rb-frame { position: relative; overflow: hidden; border-radius: var(--radius-md); box-shadow: 0 0 0 1px var(--line-2), var(--shadow); }
.rb-frame.bg-checker .rb-after { background: var(--checker); }
.rb-frame.bg-white .rb-after { background: #fff; }
.rb-frame.bg-black .rb-after { background: #000; }
.rb-scroll { overflow: hidden; }
.is-full .rb-scroll { overflow: auto; max-height: min(75vh, 46rem); overscroll-behavior: contain; }
.rb-box { position: relative; margin: 0 auto; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.is-full .rb-box { margin: 0; touch-action: auto; }
.rb-layer { position: absolute; inset: 0; }
.rb-layer canvas { display: block; width: 100%; height: 100%; max-width: none; }
.rb-handle { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; width: 3.4rem; margin-left: -1.7rem; cursor: ew-resize; touch-action: none; }
.rb-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: var(--surface); box-shadow: 0 0 0 1px var(--ink); }
.rb-grip { position: relative; display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border: 3px solid var(--surface); border-radius: 50%; background: var(--brand-2); color: var(--surface); box-shadow: 0 0 0 1px var(--ink), var(--shadow); font-size: .7rem; font-weight: 700; letter-spacing: -.05em; white-space: nowrap; }
.is-full .rb-handle { align-items: start; }
.is-full .rb-grip { position: sticky; top: 35%; }
.rb-handle:focus { outline: none; }
.rb-handle:focus-visible .rb-grip { outline: 3px solid var(--brand); outline-offset: 3px; }
.rb-tag { position: absolute; top: .6rem; padding: 4px 12px; border-radius: 999px; background: var(--ink); color: var(--surface); font-size: .9rem; font-weight: 700; pointer-events: none; }
.rb-tag-before { left: .6rem; }
.rb-tag-after { right: .6rem; }
