/* REDACT tool page — the workspace dress (crop.css is the sibling pattern;
   every class here is redact-scoped so nothing leaks into the shared pages). */

.redact-page .tool-form { max-width: 860px; margin: 0 auto; }

/* The workspace appears once a file is loaded: the marked pages column with a
   pinned tool strip above and the Redact bar below. */
#redact-workspace { max-width: 1040px; margin: 0 auto; }

.redact-toolbar {
  /* The site header is sticky too (64px, z 50): the strip must pin BELOW it,
     or its first row hides under the nav while the document scrolls. */
  position: sticky; top: calc(var(--header-h, 64px) + 10px); z-index: 12;
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px 14px; margin: 14px 0 8px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid #e3eaf2; border-radius: 14px;
  box-shadow: 0 12px 30px rgba(23, 43, 66, .07), 0 1px 2px rgba(23, 43, 66, .05);
}
/* Two deliberate rows — search above, the finders below. The finder chips
   share a soft segmented group; the page actions stay ghosted at the right,
   so the row reads "find here / adjust there" at a glance. */
.rt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rt-label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #93a1b1; margin: 0 2px;
}
.rt-searchbox {
  position: relative; flex: 1 1 260px; display: flex; align-items: center;
  min-width: 180px;
}
.rt-searchicon { position: absolute; left: 11px; color: #9db0c3; pointer-events: none; }
.rt-searchbox input {
  width: 100%; height: 38px; padding: 0 12px 0 34px;
  font: inherit; font-size: 13.5px; color: #2f3f52;
  background: #f7fafc; border: 1px solid #dde6ef; border-radius: 10px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.rt-searchbox input::placeholder { color: #9aa9ba; }
.rt-searchbox input:focus {
  outline: none; background: #fff; border-color: #8ccbbd;
  box-shadow: 0 0 0 3px rgba(31, 122, 109, .12);
}
.rt-btn {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  height: 32px; padding: 0 12px;
  border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: #45566b; font: inherit; font-size: 12.8px; font-weight: 600;
  letter-spacing: .01em; cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s, border-color .15s;
}
.rt-btn:focus-visible { outline: 2px solid rgba(31, 122, 109, .5); outline-offset: 1px; }
.rt-btn:disabled { opacity: .45; cursor: not-allowed; }
.rt-chipgroup {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px;
  padding: 3px; border-radius: 10px;
  background: #f4f7fb; border: 1px solid #e6edf6;
}
.rt-chipgroup .rt-btn:hover {
  background: #fff; color: #1f7a6d; box-shadow: 0 1px 4px rgba(23, 43, 66, .12);
}
.rt-btn.rt-ai { color: #6d4bc0; }
.rt-btn.rt-ai:hover, .rt-btn.rt-ai.rt-on {
  background: #fff; color: #5b3bad; box-shadow: 0 1px 4px rgba(93, 67, 183, .18);
}
.rt-aistar { opacity: .85; }
.rt-markall { border-color: #cfe0da; background: #f4faf8; color: #1f7a6d; }
.rt-markall:hover { background: #e9f6f1; border-color: #a9d5c8; }
.rt-actions { display: inline-flex; gap: 4px; margin-left: auto; }
.rt-btn.rt-sub { color: #5d6f83; border-color: #e0e8f1; }
.rt-btn.rt-sub:hover { background: #f4f8fc; color: #32445a; border-color: #ccd9e6; }
.redact-count {
  margin-left: auto; padding: 6px 12px; border-radius: 999px;
  background: #eef3f8; border: 1px solid #e2eaf3; color: #5a6d83;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
}
.redact-count.has { background: #1d2b3a; border-color: #1d2b3a; color: #fff; }

/* The file bar — who is being worked on, and the way back out to another
   document. App first, marketing page second. */
.redact-filebar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin: 12px 0 0;
  background: #fff; border: 1px solid #e3eaf2; border-radius: 14px;
  box-shadow: 0 8px 22px rgba(23, 43, 66, .05);
}
.rfb-ico {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; width: 38px; height: 38px;
  border-radius: 10px; background: #f2f7fb; color: #3b6ea5; font-size: 18px;
}
.rfb-meta { display: flex; flex-direction: column; min-width: 0; }
.rfb-meta strong {
  font-size: 14px; color: #243447; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 58ch;
}
.rfb-sub { font-size: 12px; color: #8296a9; }
.rfb-change { margin-left: auto; flex: 0 0 auto; }

/* The working strip — what the page shows while a scan runs (the AI pass is
   ~15s a page against the free model; without this the button looked dead). */
.redact-working {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px; padding: 11px 14px;
  background: #fff; border: 1px solid #dbe7f2; border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 35, 60, .06);
  font-size: 13.5px; color: #37474f;
}
.redact-working[hidden] { display: none; }
.redact-working.rw-ok { border-color: #c3e5cf; background: #f4fbf6; color: #1e6b3f; }
.redact-working.rw-err { border-color: #f0c4c4; background: #fff7f7; color: #a94442; }
.rw-spin {
  flex: 0 0 auto; width: 17px; height: 17px; border-radius: 50%;
  border: 2.5px solid #cfe0f0; border-top-color: var(--brand, #1f7a6d);
  animation: rwspin .8s linear infinite;
}
.redact-working.rw-ok .rw-spin, .redact-working.rw-err .rw-spin { display: none; }
.redact-working.rw-ok::before { content: "\2713"; font-weight: 700; }
.redact-working.rw-err::before { content: "\26a0"; font-weight: 700; }
.rw-text { flex: 0 1 auto; }
.rw-bar {
  flex: 1 1 140px; height: 6px; min-width: 120px; margin-left: auto;
  border-radius: 3px; background: #e3e9f0; overflow: hidden;
}
.rw-bar[hidden] { display: none; }
.rw-bar i {
  display: block; height: 100%; width: 0;
  background: var(--brand, #1f7a6d); border-radius: 3px;
  transition: width .25s ease;
}
@keyframes rwspin { to { transform: rotate(360deg); } }

.redact-hint { margin: 2px 4px 12px; color: #7a8894; font-size: 12.5px; }

.redact-pages { display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 14px 0 26px; }
.redact-page {
  position: relative; background: #fff; border-radius: 6px;
  box-shadow: 0 10px 26px rgba(15, 35, 60, .14), 0 1px 3px rgba(15, 35, 60, .08);
  overflow: visible;
}
.redact-page canvas { display: block; border-radius: 6px; }
.rp-badge {
  position: absolute; top: -11px; left: 12px; z-index: 2;
  padding: 3px 9px; border-radius: 999px;
  background: #1d2b3a; color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 4px 10px rgba(23, 43, 66, .28);
}
.rx-overlay {
  position: absolute; inset: 0; cursor: crosshair;
  touch-action: none;              /* pointer drags, not scrolls, on touch */
}
/* Deep black, fully opaque: what the mark shows is what the file will look
   like after the run (client: "darken the black sheet"). */
.rx-box {
  position: absolute; background: #000; opacity: 1;
  border: 1px solid #000; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.rx-box::after {
  content: "\00d7"; color: #fff; font-size: 14px; line-height: 1;
  opacity: 0; transition: opacity .12s;
}
.rx-box:hover::after { opacity: .9; }
.rx-live { position: absolute; background: rgba(0, 0, 0, .5); border: 1.5px dashed #000; }

/* The action footer: a summary on the left, the one button that matters on
   the right — so the state of the job and the way to finish it sit together. */
.redact-bar { position: sticky; bottom: 12px; z-index: 12; margin: 4px 0 16px; }
.redact-bar-inner {
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  padding: 10px 12px 10px 16px;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid #e3eaf2; border-radius: 14px;
  box-shadow: 0 14px 34px rgba(23, 43, 66, .14), 0 1px 2px rgba(23, 43, 66, .06);
}
.rb-summary { font-size: 13px; color: #5d6f83; }
.redact-bar-inner .redact-run {
  padding: 11px 30px; font-size: 15px; border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 35, 60, .2);
}

/* The start screen keeps the shared dropzone dress; only the radius is
   opened up to match the workspace cards. */
.redact-page .dropzone { border-radius: 16px; }
