/* Nokora fonts */
@font-face{
  font-family:"Nokora";
  src:url("../fonts/Nokora-Light.ttf") format("truetype");
  font-weight:300 500;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Nokora";
  src:url("../fonts/Nokora-SemiBold.ttf") format("truetype");
  font-weight:600 900;
  font-style:normal;
  font-display:swap;
}

/* Bootstrap overrides: Light for body, SemiBold for bold/titles/buttons */
:root{
  --bs-body-font-family:"Nokora",system-ui,"Noto Sans Khmer","Khmer OS",sans-serif;
  --bs-body-font-weight:300;
  --bs-body-color:#1a2340;
  --bs-primary:#2563eb;
  --bs-primary-rgb:37,99,235;
  --bs-link-color:#2563eb;
  --app-w:1100px;            /* total width: sidebar + content */
}
.btn{--bs-btn-font-weight:600}
.btn-primary{--bs-btn-bg:#2563eb;--bs-btn-border-color:#2563eb;--bs-btn-hover-bg:#1d4ed8;--bs-btn-hover-border-color:#1d4ed8;--bs-btn-disabled-bg:#2563eb;--bs-btn-disabled-border-color:#2563eb}
.btn-outline-primary{--bs-btn-color:#1f3a8a;--bs-btn-border-color:#1f3a8a;--bs-btn-hover-bg:#1f3a8a;--bs-btn-hover-border-color:#1f3a8a}
b,strong,h1,h2,h3,h4,h5,h6,th,.badge,.fw-semibold{font-weight:600!important}

/* page shell: sidebar + content centered together, no gap */
body{background:#e9edf7}
.app{max-width:var(--app-w);height:100vh}

/* left sidebar */
.side{width:220px}
.thumb{cursor:pointer}
.thumb:hover{background:var(--bs-light-bg-subtle,#f8f9fa)}
.thumb img{border:2px solid transparent}
.thumb.active{background:var(--bs-primary-bg-subtle)}
.thumb.active img{border-color:var(--bs-primary)}

/* top bar dropzone */
.drop{border:2px dashed #aab}
.drop.over{background:var(--bs-primary-bg-subtle);border-color:var(--bs-primary)!important}

/* preview: frame = image size (aspect ratio via --ar set by JS), centered */
.preview{position:relative;overflow:hidden;background:#fff;width:100%;height:30vh;display:flex;align-items:center;justify-content:center}
.preview.has-img{
  --ar:.7;
  height:auto;
  aspect-ratio:var(--ar);
  width:min(100%, calc(60vh * var(--ar)));
}
.preview img,.preview svg{position:absolute;inset:0;width:100%;height:100%}
.preview img{object-fit:fill;user-select:none;-webkit-user-drag:none}
.preview .badge{position:absolute;top:8px;right:8px;z-index:3;width:auto;height:auto}
.preview .hint{position:absolute;left:8px;bottom:8px;z-index:3;width:auto;height:auto;max-width:calc(100% - 16px);background:rgba(31,58,138,.88);color:#fff;font-size:11px;line-height:1.3;font-weight:300;padding:3px 10px;border-radius:12px;pointer-events:none;white-space:normal;text-align:left}

/* block editor overlay */
.preview svg{touch-action:none;cursor:crosshair;user-select:none}
.bx{fill:rgba(0,200,0,.08);stroke:#00c800;stroke-width:2;vector-effect:non-scaling-stroke;cursor:move}
.bx:hover{fill:rgba(0,200,0,.18)}
.bx.sel{fill:rgba(37,99,235,.15);stroke:#2563eb;stroke-width:2.5}
.draft{fill:rgba(37,99,235,.1);stroke:#2563eb;stroke-width:1.5;stroke-dasharray:6 4;vector-effect:non-scaling-stroke;pointer-events:none}
.hd{fill:#fff;stroke:#2563eb;stroke-width:1.5;vector-effect:non-scaling-stroke}

/* OCR output: full height, no inner scroll (whole right column scrolls) */
.out{min-height:160px;height:auto;overflow:visible;padding-bottom:60px;white-space:pre-wrap;word-break:break-word;font-size:17px;line-height:1.7;font-weight:300;outline:none}

@media(max-width:700px){.side{width:110px}}