.opwt {
  --opwt-accent: #22514a;
  --opwt-ink: #162a31;
  --opwt-line: #d5dfdc;
  color: var(--opwt-ink);
  margin: 1.4rem auto;
  max-width: 100%;
}
.opwt *, .opwt *::before, .opwt *::after { box-sizing: border-box; }
.opwt [hidden] { display: none !important; }
.opwt input, .opwt select, .opwt button { font: inherit; }
.opwt button { cursor: pointer; }
.opwt :focus-visible { outline: 2px solid #176f60; outline-offset: 3px; }
.opwt button:disabled { cursor: default; opacity: .55; }
.opwt-drop { padding: 1.5rem; border: 1px dashed #659087; border-radius: 16px; text-align: center; background: #f4faf7; }
.opwt-drop p { margin: 0 0 .75rem; }
.opwt-drop input { display: block; max-width: 100%; margin: .5rem auto; }
.opwt .opwt-run, .opwt .opwt-download, .opwt-results a {
  display: inline-flex; padding: .65rem 1rem; color: white; background: var(--opwt-accent);
  border: 1px solid var(--opwt-accent); border-radius: 8px; margin: .4rem 0; text-decoration: none;
}
.opwt-small, .opwt-shortcuts, .opwt-status, .opwt-filter-status { font-size: .9rem; }
.opwt-status:empty, .opwt-filter-status:empty, .opwt-queue:empty { display: none; }
.opwt-results { display: flex; flex-wrap: wrap; gap: .6rem; }
.opwt-files, .opwt-queue { overflow-wrap: anywhere; }
.opwt-queue button { margin-inline: 4px; }
.opwt-controls { display: flex; gap: .8rem; flex-wrap: wrap; }
.opwt-controls label { display: grid; gap: .25rem; margin: .5rem 0; }
.opwt-controls input, .opwt-controls select, .opwt-search input {
  border: 1px solid var(--opwt-line); border-radius: 8px; padding: .5rem; max-width: 100%; background: #fff;
}
.opwt-search { display: grid; gap: .4rem; max-width: 32rem; }
.opwt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); gap: 12px; }
.opwt-category + .opwt-category { margin-top: 1rem; }
.opwt-category h2 { margin-bottom: 12px; }
.opwt .opwt-card {
  display: flex; flex-direction: column; gap: .45rem; padding: 1rem; border: 1px solid var(--opwt-line);
  border-radius: 10px; color: var(--opwt-ink); text-decoration: none; background: #fff;
}
.opwt .opwt-card:hover { border-color: #659087; background: #f4faf7; }
.opwt-card strong { line-height: 1.25; }
.opwt-card span { font-size: .875rem; color: #465c60; }
.opwt-editorial { max-width: 760px; margin: 3rem auto; }
.opwt-editorial nav { background: #f3f6f5; padding: .75rem 1rem; border-radius: 8px; }
.opwt-editorial details { border-bottom: 1px solid #d5dfdc; padding: .55rem 0; }
.opwt-editorial summary { cursor: pointer; }
.opwt-studio { border: 1px solid var(--opwt-line); border-radius: 12px; overflow: hidden; background: white; }
.opwt-tool-row { display: flex; gap: 6px; padding: 7px 10px; flex-wrap: wrap; border-bottom: 1px solid var(--opwt-line); }
.opwt-toolbar { background: #f4f8f7; }
.opwt-toolbar button, .opwt-thumbs button, .opwt-inspector button, .opwt-sign button {
  padding: .35rem .55rem; border: 1px solid #cad9d5; border-radius: 6px; background: #fff;
  color: var(--opwt-ink); font-size: .825rem;
}
.opwt-toolbar button[aria-pressed=true], .opwt-thumbs button[aria-current=page], .opwt-tool-row:first-child button:last-child {
  background: var(--opwt-accent); color: #fff; border-color: var(--opwt-accent);
}
.opwt-tool-row:first-child button:last-child { margin-inline-start: auto; }
.opwt-editor-body { display: grid; grid-template-columns: 104px minmax(0, 1fr) 183px; }
.opwt-thumbs, .opwt-inspector { padding: 10px; background: #f8faf9; overflow: auto; max-height: 650px; }
.opwt-thumbs h3, .opwt-inspector h3 { font-size: .9rem; margin: 0 0 .65rem; }
.opwt-thumbs button { display: grid; justify-items: center; width: 100%; }
.opwt-page-list { display: grid; gap: 6px; }
.opwt-page-list canvas { background: white; width: auto; min-width: 25px; max-width: 100%; height: auto; }
.opwt-stage { min-width: 0; height: min(70vh, 650px); min-height: 360px; padding: 14px; overflow: auto; background: #dce7e5; }
.opwt-sheet-wrap { position: relative; margin: auto; }
.opwt-sheet { position: absolute; top: 50%; left: 50%; background: #fff; box-shadow: 0 8px 24px #172a332c; }
.opwt-sheet > canvas, .opwt-overlay { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.opwt-overlay { touch-action: none; user-select: none; }
.opwt .opwt-mark {
  display: block; position: absolute; overflow: hidden; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0;
  border-radius: 0; background: transparent; color: var(--mark); text-align: left; line-height: 1; letter-spacing: normal;
}
.opwt .opwt-mark[aria-pressed=true] { outline: 2px solid #286be3; outline-offset: 2px; }
.opwt .opwt-mark-text { white-space: nowrap; padding-inline: 2px; font-family: Arial, sans-serif; }
.opwt .opwt-mark-highlight { background: var(--mark); opacity: .36; }
.opwt .opwt-mark-box, .opwt .opwt-mark-ellipse { border: 2px solid var(--mark); }
.opwt .opwt-mark-ellipse { border-radius: 50%; }
.opwt .opwt-mark-line { background: linear-gradient(var(--mark),var(--mark)) center / 100% 2px no-repeat; }
.opwt .opwt-mark-redact { background: #000; }
.opwt .opwt-mark-white { background: #fff; }
.opwt-mark img { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.opwt-ghost { position: absolute; border: 1px dashed #286be3; background: #286be320; pointer-events: none; }
.opwt-inspector p, .opwt-inspector label { font-size: .8rem; overflow-wrap: anywhere; }
.opwt-inspector label, .opwt-sign label { display: grid; gap: 3px; margin: 0 0 .55rem; }
.opwt-inspector input:not([type=checkbox]), .opwt-inspector select, .opwt-sign input {
  width: 100%; min-width: 0; border: 1px solid var(--opwt-line); border-radius: 5px; padding: 4px;
}
.opwt-sign { width: min(520px, 94vw); color: var(--opwt-ink); border: 1px solid var(--opwt-line); border-radius: 12px; }
.opwt-sign::backdrop { background: #12232ba6; }
.opwt-sign canvas { width: 100%; border: 1px solid var(--opwt-line); touch-action: none; }
.opwt-sign-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 730px) {
  .opwt-editor-body { grid-template-columns: minmax(0, 1fr); }
  .opwt-page-list { display: flex; overflow-x: auto; }
  .opwt-thumbs button { width: 65px; flex: 0 0 auto; }
  .opwt-stage { height: 55vh; min-height: 300px; }
  .opwt-inspector { max-height: 240px; }
}
.opwt-page-list img { object-fit: contain; max-width: 100%; }
.opwt-tool-row input[type=search] {
  min-width: 0; border: 1px solid var(--opwt-line); border-radius: 6px; background: #fff;
  padding: 4px 7px; font-size: .825rem;
}
.opwt-studio:fullscreen { overflow: auto; padding: 4px; }
.opwt-studio:fullscreen .opwt-stage { height: 82vh; }
.opwt .opwt-native-hit { position:absolute; min-width:0; min-height:0; margin:0; padding:0; border:0; border-radius:0; outline:none; box-shadow:none; background:transparent; cursor:text; }
.opwt .opwt-native-hit.opwt-word-active,.opwt .opwt-native-hit:focus-visible { outline:2px solid #176f60; background:#45ac9823; }

.opwt .opwt-inline-word { position:absolute; z-index:3; box-sizing:border-box; min-width:0; max-width:100%; padding:0 2px; margin:0; border:0; border-radius:2px; outline:2px solid #6952cd; background:white; color:#171722; font-family:Arial,sans-serif; line-height:1; touch-action:auto; user-select:text; }
