/* ============================================================
   NOBODY CLEAN — the redactor
   ============================================================ */
.app { display: grid; grid-template-columns: 340px 1fr; gap: 0; min-height: calc(100vh - 68px); }
@media (max-width: 940px) { .app { grid-template-columns: 1fr; } }

/* ---------- side panel ---------- */
.panel { border-right: var(--line); background: var(--paper-2); padding: 22px; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 940px) { .panel { border-right: 0; border-bottom: var(--line); order: 2; } }

.panel__group { display: grid; gap: 10px; }
.panel__title { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.panel__title span { margin-left: auto; font-weight: 400; text-transform: none; letter-spacing: .04em; }

.tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tool {
  display: flex; align-items: center; gap: 9px; padding: 11px 12px;
  background: var(--paper); border: var(--line); border-radius: var(--r-md);
  font-size: 13px; font-weight: 700; text-align: left; text-transform: uppercase; letter-spacing: .02em;
  transition: background .12s var(--ease), box-shadow .12s var(--ease);
}
.tool svg { width: 17px; height: 17px; flex: none; }
.tool kbd {
  margin-left: auto; font-family: var(--mono); font-size: 10px; font-weight: 500;
  border: 1.5px solid var(--paper-3); border-radius: 4px; padding: 1px 5px; color: var(--ink-soft);
}
.tool:hover { background: var(--paper-3); }
.tool[aria-pressed="true"] { background: var(--butter); box-shadow: inset 0 0 0 2px var(--ink); }
.tool[aria-pressed="true"] kbd { border-color: var(--butter-2); color: var(--ink); }

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.detections { display: grid; gap: 6px; max-height: 244px; overflow-y: auto; padding-right: 4px; scrollbar-gutter: stable; }
.det {
  display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center;
  padding: 8px 10px; background: var(--paper); border: 2px solid var(--paper-3); border-radius: var(--r-sm);
  font-family: var(--mono); font-size: 11.5px; text-align: left; width: 100%;
}
.det[aria-pressed="true"] { border-color: var(--ink); background: var(--butter); }
.det__kind { font-weight: 700; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: var(--ink); color: var(--paper); }
.det[aria-pressed="true"] .det__kind { background: var(--ink); }
.det__txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.det__on { font-size: 13px; }

.progress { height: 8px; border: var(--line); border-radius: var(--r-pill); overflow: hidden; background: var(--paper); }
.progress i { display: block; height: 100%; width: 0%; background: var(--butter); transition: width .25s var(--ease); }

.hint { font-family: var(--mono); font-size: 11.5px; line-height: 1.55; color: var(--ink-soft); }
.hint b { color: var(--ink); }

.privacy {
  margin-top: auto; padding: 14px; border: var(--line); border-radius: var(--r-md);
  background: var(--butter); font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
}
.privacy b { display: block; margin-bottom: 4px; letter-spacing: .1em; text-transform: uppercase; font-size: 10.5px; }

/* ---------- stage ---------- */
.stage { position: relative; display: grid; place-items: center; padding: 26px; background:
  repeating-conic-gradient(var(--paper) 0% 25%, var(--paper-2) 0% 50%) 50% / 26px 26px; }
.stage__inner { position: relative; max-width: 100%; }
#canvas {
  border: var(--line); border-radius: var(--r-sm); box-shadow: var(--pop);
  max-width: 100%; max-height: min(74vh, 780px); width: auto; height: auto;
  touch-action: none; cursor: crosshair; background: var(--paper);
}
#canvas.erasing { cursor: not-allowed; }
.stage__bar {
  position: absolute; left: 50%; bottom: 14px; translate: -50% 0;
  display: flex; gap: 8px; align-items: center; padding: 8px;
  background: var(--paper); border: var(--line); border-radius: var(--r-pill); box-shadow: var(--pop-sm);
}
.stage__meta { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); padding: 0 8px; white-space: nowrap; }

/* ---------- dropzone ---------- */
.drop {
  display: grid; place-items: center; gap: 18px; text-align: center;
  padding: clamp(30px, 6vw, 70px); max-width: 560px;
  border: 3px dashed var(--ink); border-radius: var(--r-lg); background: var(--paper);
}
.drop h2 { font-size: clamp(24px, 3.4vw, 34px); }
.drop p { color: var(--ink-2); font-size: 15px; }
.drop__ghost { width: 108px; border: var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--butter); rotate: -3deg; }
.stage.over .drop { background: var(--butter); transform: scale(1.01); }

.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* toolbar on top of the tool page */
.tbar { display: flex; align-items: center; gap: 14px; height: 68px; border-bottom: var(--line); background: var(--paper); }
.tbar__logo { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.tbar__logo svg { height: 19px; width: 115px; flex: none; }
.tbar__name { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; padding-left: 12px; border-left: 2px solid var(--paper-3); }
@media (max-width: 560px) { .tbar__name, .tbar__back { display: none; } }

.tbar__in { display: flex; align-items: center; gap: 14px; height: 100%; width: min(100% - 32px, 1500px); margin-inline: auto; }
.panel { overflow-y: auto; max-height: calc(100vh - 68px); }
@media (max-width: 940px) { .panel { max-height: none; } }
