@font-face {
  font-family: Newsreader;
  src: url(assets/ui/newsreader-latin-wght-normal.woff2);
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: Newsreader;
  src: url(assets/ui/newsreader-vietnamese-wght-normal.woff2);
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169,
    U+01A0-01A1, U+01AF-01B0, U+0300-0309, U+0323, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: Newsreader;
  src: url(assets/ui/newsreader-latin-wght-italic.woff2);
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: Newsreader;
  src: url(assets/ui/newsreader-vietnamese-wght-italic.woff2);
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169,
    U+01A0-01A1, U+01AF-01B0, U+0300-0309, U+0323, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: Inter;
  src: url(assets/ui/inter-latin.woff2);
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url(assets/ui/inter-vietnamese.woff2);
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169,
    U+01A0-01A1, U+01AF-01B0, U+0300-0309, U+0323, U+1EA0-1EF9, U+20AB;
}
:root {
  --navy: #101b2b;
  --ink: #1a2939;
  --muted: #626a71;
  --ivory: #f7f5ef;
  --line: #d9d6cd;
  --brass: #dfbe82;
  --serif: Newsreader, Georgia, serif;
  font:
    16px/1.52 Inter,
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--ivory);
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
a.button,
select {
  color: inherit;
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 17px;
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.35;
  transition:
    background 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
button:active,
a.button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #a87b38;
  outline-offset: 3px;
}
button:hover:not(:disabled),
a.button:hover {
  box-shadow: 0 3px 12px #101b2b12;
}
.symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.ic {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bound {
  max-width: 1192px;
  width: calc(100% - 96px);
  margin-inline: auto;
}
.skip {
  position: absolute;
  top: -90px;
  left: 20px;
  z-index: 9;
  background: white;
  padding: 10px;
}
.skip:focus {
  top: 8px;
}
header {
  background: var(--navy);
  color: #fbf6ea;
}
.mast {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #bdac8b38;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font: 510 1.65rem/1 var(--serif);
  letter-spacing: -0.04em;
}
.brand > span:last-child {
  padding-top: 5px;
}
.logo {
  width: 39px;
  height: 39px;
  background: linear-gradient(135deg, #ecd6a7, #be945a);
  border-radius: 10px;
  position: relative;
  box-shadow: inset 0 0 0 1px #f2dca9;
}
.logo i,
.logo:before {
  content: "";
  position: absolute;
  left: 12px;
  top: 9px;
  width: 15px;
  height: 19px;
  border: 1.6px solid #25313b;
  transform: rotate(12deg);
  border-radius: 2px;
}
.logo:before {
  transform: rotate(-8deg) translate(-3px, 2px);
}
.logo i {
  background: #dfbe82;
}
.logo i:after {
  content: "";
  position: absolute;
  inset: 6px 3px auto;
  border-block: 1px solid #3c4040;
  height: 3px;
}
.offline {
  background: #ffffff06;
  border-color: #ddd3ba45;
  color: #e8dfcf;
  border-radius: 30px;
  min-height: 42px;
  padding: 8px 15px;
  font-size: 0.84rem;
}
.offline .ic {
  color: #e4c58b;
  width: 17px;
}
.hero {
  overflow: hidden;
  position: relative;
  color: #fffaf1;
  background: radial-gradient(ellipse at 77% 69%, #38404a 0, transparent 43%),
    linear-gradient(110deg, #101b2b 12%, #152336 57%, #192638);
  border-bottom: 1px solid #b9a680;
}
.hero-inner {
  isolation: isolate;
  position: relative;
  min-height: 362px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-block: 48px 34px;
}
.intro,
.hero-actions,
.privacy {
  position: relative;
  z-index: 1;
}
.intro h1 {
  font: 460 clamp(3.65rem, 6.8vw, 6.25rem) / 1.05 var(--serif);
  letter-spacing: -0.058em;
}
.intro em {
  font-weight: 420;
  color: #ead2a3;
}
.intro p {
  max-width: 390px;
  color: #d3d8df;
  line-height: 1.65;
  margin: 10px 0 24px;
  font-size: 1.02rem;
}
.hero-art {
  position: absolute;
  inset: -26px -1.5% -24px 45%;
  z-index: -1;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  min-height: 0;
  filter: drop-shadow(0 16px 10px #060b1226);
}
.hero-actions,
.tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.gold {
  background: linear-gradient(105deg, #edd5a6, #dfbe82);
  border-color: #eddab1;
  color: #1b2531;
}
.ghost {
  color: #f2eee5;
  background: #ffffff06;
  border-color: #83909e80;
}
.hero-actions button {
  min-height: 49px;
  padding: 12px 22px;
}
.privacy {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: #c0c7cc;
  font-size: 0.82rem;
}
.privacy .ic {
  color: #c6ae80;
  width: 16px;
  height: 16px;
}
.workspace {
  padding-block: 33px 32px;
}
.sectionhead,
.sectiontitle,
.dialog-top,
.viewer-bar,
.name-row {
  display: flex;
  align-items: center;
}
.sectionhead,
.dialog-top,
.viewer-bar {
  justify-content: space-between;
  gap: 12px;
}
.sectionhead {
  margin-bottom: 19px;
}
.sectiontitle {
  gap: 12px;
}
.sectiontitle > .ic {
  color: #816a44;
  width: 23px;
  height: 23px;
}
h2 {
  font: 500 2.12rem/1.17 var(--serif);
  letter-spacing: -0.048em;
  padding-top: 4px;
}
h3 {
  font: 520 1.5rem/1.25 var(--serif);
  letter-spacing: -0.033em;
}
#count,
#camCount {
  font-size: 0.81rem;
  font-weight: 550;
  border: 1px solid #d6d1c3;
  border-radius: 20px;
  padding: 5px 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#empty {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 14px;
}
.drop,
.demo {
  border-radius: 15px;
  background: #fdfcf8;
  padding: 24px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 17px;
  min-width: 0;
}
.drop {
  border: 1.5px dashed #c8bdab;
}
.drop.over {
  background: #efe5ce;
  border-color: #865e24;
}
.drop-icon,
.dialog-icon {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 13px;
  background: #f0e9d9;
  color: #7b5d30;
  display: grid;
  place-items: center;
}
.drop-icon .ic {
  width: 24px;
  height: 24px;
}
.drop p,
.demo small {
  color: var(--muted);
  font-size: 0.87rem;
  margin-top: 3px;
  display: block;
}
.drop .paper-btn {
  margin-left: auto;
  white-space: nowrap;
}
.demo {
  border: 1px solid var(--line);
  background: linear-gradient(110deg, #f0ece2, #f8f5ec);
  font-weight: 400;
}
.demo img {
  width: 44px;
  height: 62px;
  object-fit: cover;
  border: 1px solid #d4c8af;
  transform: rotate(-7deg);
  box-shadow:
    2px 3px 0 #d7cfbe,
    3px 6px 9px #2f241a12;
}
.demo b {
  font-weight: 640;
  font-size: 1rem;
}
.demo > .ic {
  margin-left: auto;
  width: 16px;
}
.narrow-only {
  display: none !important;
}
#message:not(:empty) {
  margin-top: 16px;
  line-height: 1.55;
  font-size: 0.9rem;
  border-left: 2px solid #a89059;
  padding: 6px 12px;
  color: #344452;
}
body.editing .hero-inner {
  min-height: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding-block: 16px;
  gap: 15px;
}
body.editing .intro,
body.editing .hero-art {
  display: none;
}
body.editing .privacy {
  margin: 0;
}
body.editing .hero-actions button {
  min-height: 43px;
  padding: 10px 16px;
}
.name-row {
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.name-row label,
#panel-edit > label,
h4 {
  font-weight: 640;
  font-size: 0.88rem;
}
.name-row input,
select,
#lines input {
  font: inherit;
  min-height: 44px;
  min-width: 0;
  border: 1px solid #cecfc9;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink);
  background: #fff;
}
.name-row input {
  width: min(440px, 100%);
}
#strip {
  display: flex;
  overflow: auto;
  gap: 8px;
  padding: 4px 2px 13px;
  scrollbar-width: thin;
  scrollbar-color: #c4baa6 transparent;
}
#strip button {
  flex: none;
  display: flex;
  gap: 7px;
  font-size: 0.78rem;
  padding: 5px 10px 5px 5px;
  min-height: 44px;
  background: #fdfcf8;
}
#strip img {
  width: 26px;
  height: 32px;
  object-fit: contain;
  background: #eeeae1;
}
#strip [aria-current="true"] {
  border-color: #967240;
  box-shadow: inset 0 0 0 1px #967240;
  background: #f5ecdb;
}
.editor {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
}
.view,
.controls {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fffefa;
  border-radius: 14px;
  overflow: hidden;
}
.viewer-bar {
  font-size: 0.83rem;
  font-weight: 620;
  padding: 4px 13px 4px 18px;
}
.compact {
  background: transparent;
  border: 0;
  font-size: 0.8rem;
  padding: 7px;
  gap: 6px;
}
.compact .ic {
  width: 16px;
}
#preview {
  background: radial-gradient(ellipse at 48% 32%, #eae7df, #d9d7cf);
  display: flex;
  justify-content: center;
  padding: 18px;
}
#preview img {
  display: block;
  max-width: 100%;
  max-height: 58dvh;
  object-fit: contain;
  box-shadow: 0 4px 13px #27303923;
}
#quality:not(:empty) {
  padding: 10px 15px;
  font-size: 0.83rem;
  background: #fff4d8;
}
#quality:empty {
  display: none;
}
.controls [role="tablist"] {
  display: flex;
  padding: 6px 9px 0;
  border-bottom: 1px solid var(--line);
  gap: 4px;
}
.controls [role="tab"] {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.84rem;
  padding: 10px 2px;
  color: #54606a;
  border-bottom: 2px solid transparent;
  gap: 6px;
}
.controls [role="tab"] .ic {
  width: 16px;
}
.controls [role="tab"][aria-selected="true"] {
  color: #26394a;
  border-bottom-color: #99713a;
  font-weight: 730;
}
.controls [role="tabpanel"] {
  padding: 22px;
}
#mode {
  display: block;
  width: 100%;
  margin: 8px 0 13px;
}
.edit-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.edit-tools button {
  padding: 10px 4px;
}
.tool-group {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
h4 {
  margin-bottom: 8px;
}
.danger,
.plain {
  border: 0;
  background: transparent;
  color: #954b44;
  padding-left: 0;
}
.danger {
  margin-top: 8px;
}
.plain {
  color: #4b5863;
  text-decoration: underline;
  text-underline-offset: 4px;
  margin-top: 12px;
}
.ink {
  background: #17283c;
  color: #fffdf8 !important;
  border-color: #17283c;
}
#panel-ocr p {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 8px 0 15px;
}
#lines input {
  width: 100%;
  display: block;
  margin-bottom: 7px;
}
#lines:not(:empty) {
  padding: 12px 0;
  max-height: 55vh;
  overflow: auto;
}
#lines .uncertain {
  border-color: #b98a47;
  background: #fff6df;
}
.export {
  width: 100%;
  border-color: #dedad1;
  text-align: left;
  gap: 12px;
  justify-content: flex-start;
  margin-top: 10px;
  padding: 12px;
}
.export:hover {
  background: #f9f6ee;
}
.export b,
.export small {
  display: block;
}
.export small {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}
.export > .ic {
  margin-left: auto;
  width: 16px;
}
.format {
  min-width: 35px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 5px 11px 5px 5px;
  font-size: 0.74rem;
  font-style: normal;
  letter-spacing: 0.02em;
}
.red {
  background: #f8e7df;
  color: #964d37;
}
.blue {
  background: #e5edf7;
  color: #295a8d;
}
.slate {
  background: #e9edef;
  color: #4c5e6c;
}
dialog {
  color: var(--ink);
  background: #fcfaf4;
  border: 1px solid #bdb29e;
  border-radius: 19px;
  padding: 25px;
  width: min(550px, calc(100vw - 28px));
  max-height: 94dvh;
  overflow: auto;
  box-shadow: 0 24px 96px #030d2245;
}
dialog::backdrop {
  background: #0e1b2ac4;
}
dialog p {
  color: #52606b;
  font-size: 0.94rem;
  margin: 10px 0 18px;
}
dialog h2 {
  font-size: 2rem;
}
dialog .dialog-icon {
  margin-bottom: 14px;
}
.tools {
  gap: 8px;
}
.canvas-wrap {
  margin: 12px 0;
  background: #dcd9d0;
  border-radius: 8px;
  overflow: hidden;
}
#corners {
  display: block;
  max-width: 100%;
  height: auto;
  touch-action: none;
}
.camera-frame {
  background: #08101b;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 14px;
}
#paperOutline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#paperOutline polygon {
  fill: #70e5c126;
  stroke: #8ff4cd;
  stroke-width: 2.5px;
  vector-effect: non-scaling-stroke;
}
.release { font: 500 .68rem var(--sans, sans-serif); opacity: .72; }
#quickPdf { margin: 0 0 14px; }
#feed {
  width: 100%;
  max-height: 55dvh;
  min-height: 170px;
  object-fit: contain;
  display: block;
}
.camera-actions {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
}
.camera-actions button {
  font-size: 0.8rem;
  padding: 9px;
  flex: 1;
}
.shutter {
  background: #e7c995;
  border-color: #b89a63;
  color: #192637;
}
.shutter .ic {
  width: 22px;
}
#busy progress {
  width: 100%;
  height: 7px;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  accent-color: #a7814c;
  margin: 18px 0 0;
}
#resultName {
  overflow-wrap: anywhere;
}
#zoomDialog {
  width: min(960px, calc(100vw - 16px));
  padding: 14px;
}
#zoomPan {
  overflow: auto;
  max-height: 75dvh;
  overscroll-behavior: contain;
  background: #d8d5cb;
  margin-top: 10px;
}
#zoomImage {
  display: block;
  max-width: none;
  width: max(100%, 850px);
  height: auto;
}
[hidden] {
  display: none !important;
}
@media (max-width: 930px) {
  .bound {
    width: calc(100% - 48px);
  }
  .hero-inner {
    min-height: 315px;
  }
  .hero-art {
    left: 49%;
    right: -5%;
  }
  .intro p {
    max-width: 360px;
  }
  .drop,
  .demo {
    padding: 17px;
    gap: 12px;
  }
  .drop-icon {
    display: none;
  }
  .editor {
    grid-template-columns: minmax(0, 1fr) minmax(290px, 0.83fr);
  }
}
@media (max-width: 700px) {
  .bound {
    width: calc(100% - 36px);
  }
  .mast {
    height: 64px;
  }
  .brand {
    font-size: 1.4rem;
    gap: 9px;
  }
  .logo {
    width: 34px;
    height: 34px;
  }
  .logo i,
  .logo:before {
    left: 10px;
    top: 7px;
  }
  .offline {
    font-size: 0.76rem;
    min-height: 42px;
    padding: 9px 12px;
    gap: 6px;
  }
  .hero-inner {
    padding: 29px 0 24px;
    min-height: 300px;
    justify-content: flex-end;
  }
  .intro h1 {
    font-size: clamp(3.2rem, 10.5vw, 4.45rem);
    max-width: 55%;
    line-height: 1.02;
  }
  .intro h1 em {
    display: block;
  }
  .intro p {
    font-size: 0.92rem;
    max-width: 58%;
    margin: 10px 0 20px;
    line-height: 1.5;
  }
  .hero-art {
    inset: 1% -11% 14% 45%;
  }
  .hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .hero-actions button {
    padding: 12px 4px;
    min-height: 47px;
  }
  .privacy {
    font-size: 0.77rem;
    margin-top: 14px;
  }
  .workspace {
    padding: 22px 0 28px;
  }
  .sectionhead {
    margin-bottom: 14px;
  }
  .sectiontitle {
    gap: 9px;
  }
  .sectiontitle > .ic {
    width: 19px;
  }
  h2 {
    font-size: 1.72rem;
  }
  #count {
    font-size: 0.75rem;
    padding: 4px 9px;
  }
  #empty {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .drop {
    padding: 18px 14px;
  }
  .drop h3 {
    font-size: 1.35rem;
  }
  .drop p {
    font-size: 0.8rem;
  }
  .wide-only {
    display: none !important;
  }
  .narrow-only {
    display: block !important;
  }
  .demo {
    padding: 14px 17px;
    gap: 15px;
  }
  .demo img {
    width: 33px;
    height: 46px;
  }
  .demo small {
    font-size: 0.78rem;
  }
  .demo b {
    font-size: 0.94rem;
  }
  .paper-btn {
    font-size: 0.83rem;
    padding: 9px 12px;
  }
  body.editing .privacy {
    display: none;
  }
  body.editing .hero-inner {
    padding-block: 12px;
  }
  .editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .view,
  .controls {
    width: 100%;
  }
  .name-row {
    gap: 6px;
  }
  .name-row input {
    width: 100%;
  }
  #preview {
    padding: 12px;
  }
  #preview img {
    max-height: 35dvh;
  }
  .controls [role="tabpanel"] {
    padding: 16px;
  }
  dialog {
    padding: 18px;
  }
  .hero-actions button,
  .tools button,
  #mode {
    font-size: 0.87rem;
  }
  .drop,
  .demo,
  .view,
  .controls {
    border-radius: 12px;
  }
}
@media (max-width: 360px) {
  .bound {
    width: calc(100% - 24px);
  }
  .brand {
    font-size: 1.26rem;
  }
  .hero-art {
    left: 48%;
    right: -15%;
    bottom: 22%;
  }
  .intro p {
    max-width: 65%;
  }
  .hero-actions {
    gap: 6px;
  }
  .drop {
    gap: 8px;
  }
  .camera-actions {
    flex-wrap: wrap;
  }
}
@media (min-width: 701px) and (max-height: 650px) {
  .hero-inner {
    min-height: 270px;
    padding-block: 26px;
  }
  .hero-art {
    inset: 0 0 0 49%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 700px) {
  body:not(.editing) .hero-inner {
    display: grid;
    grid-template-columns: 0.94fr 1.06fr;
    grid-template-rows: auto auto auto auto;
    align-items: center;
    min-height: 0;
    padding-block: 19px 20px;
  }
  body:not(.editing) .intro {
    display: contents;
  }
  body:not(.editing) .intro h1 {
    grid-area: 1/1;
    max-width: none;
    position: relative;
    z-index: 1;
  }
  body:not(.editing) .hero-art {
    grid-area: 1/2;
    position: relative;
    inset: auto;
    align-self: stretch;
    height: clamp(123px, 34vw, 165px);
    margin: 0 -7px 0 0;
  }
  body:not(.editing) .intro p {
    grid-area: 2/1/3/-1;
    max-width: 39ch;
    margin: 6px 0 16px;
  }
  body:not(.editing) .hero-actions {
    grid-area: 3/1/4/-1;
  }
  body:not(.editing) .privacy {
    grid-area: 4/1/5/-1;
  }
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.compare-button[aria-pressed="true"] {
  color: #213349;
  background: #eee4ce;
  box-shadow: inset 0 0 0 1px #c1a571;
}
#preview {
  position: relative;
}
#previewState {
  position: absolute;
  left: 9px;
  bottom: 9px;
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 650;
  color: #fff;
  background: #17283c;
  border-radius: 6px;
  pointer-events: none;
}
.filter-strength {
  margin: 2px 0 13px;
}
.filter-strength label {
  font-size: 0.88rem;
  font-weight: 640;
}
.filter-strength select {
  width: 100%;
  margin: 6px 0 0;
}
