/* Copy Text from Image — OCR in the browser, on top of the site stylesheet.
   Shared blocks (source card, drop zone, status, check boxes, how it works, FAQ) follow /data-extractor/app.css. */

/* .btn sets display, which would otherwise override the hidden attribute */
[hidden] { display: none !important; }

.tool-hero { padding-block: 3.5rem 1.75rem; }
.tool-hero h1 { margin-bottom: .3em; }
.tool-hero .lead { max-width: 62ch; margin: 0; }
.tool { padding-bottom: 4.5rem; }
.tool .container { display: grid; gap: 1.25rem; }

.hint { font-family: var(--font-mono); font-size: .76rem; color: var(--ink-3); margin: 0; }
.text-link-sm { font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: .18em; }
.text-link-sm:hover { color: var(--accent-ink); }

/* ---------- source card ---------- */
.source {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: grid; gap: 1rem;
}
.drop {
  display: grid; justify-items: center; gap: .45rem; text-align: center;
  padding: 2.4rem 1.25rem;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-tint-2); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.drop-icon { width: 34px; height: 34px; color: var(--accent); stroke-width: 1.6; margin-bottom: .25rem; }
.drop-title { font-weight: 600; font-size: 1.05rem; }
.drop-title u { text-decoration-color: var(--accent); text-underline-offset: .2em; }
.drop-formats { font-size: .78rem; color: var(--ink-3); }

.status { margin: 0; font-size: .9rem; color: var(--ink-2); }
.status:empty { display: none; }
.status.err { color: var(--danger); }
.status.busy::before {
  content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .5em; vertical-align: -.08em;
  border: 2px solid var(--accent-tint); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.options { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.4rem; padding-block: .1rem; }
.check { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); margin: 0; }

.export-btns { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- how it works & FAQ ---------- */
.how { padding-block: 4.5rem 4rem; border-top: 1px solid var(--line); }
.how-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.how-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem 1.4rem; }
.how-num { display: block; color: var(--accent); font-size: .85rem; margin-bottom: .9rem; }
.how-list h3 { margin-bottom: .45rem; }
.how-list p { margin: 0; color: var(--ink-2); font-size: .95rem; }

.faq-wrap { padding-block: 1rem 5rem; }
.faq { max-width: 46rem; display: grid; gap: .7rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 1.2rem; }
.faq summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--ink-3); font-size: 1.1rem; transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 1.1rem; color: var(--ink-2); }

/* ---------- settings ---------- */
kbd {
  font-family: var(--font-mono); font-size: .82em; font-weight: 500;
  padding: .05rem .35rem; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px;
  background: var(--surface); color: var(--ink);
}
.settings { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .9rem 1.5rem; }
.langs { display: grid; gap: .45rem; }
.set-label { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.lang-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.lang-list button {
  border: 1px solid var(--line); background: var(--paper); cursor: pointer;
  padding: .35rem .7rem; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--ink-2);
  transition: border-color .18s var(--ease), background-color .18s var(--ease), color .18s var(--ease);
}
.lang-list button:hover { border-color: var(--ink-3); color: var(--ink); }
.lang-list button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- work area: image on the left, text on the right ---------- */
.work { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.25rem; box-shadow: var(--shadow); display: grid; gap: .85rem; min-width: 0;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; }
.panel-title { font-size: 1.2rem; margin: 0; }
.panel-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.meta { font-size: .76rem; color: var(--ink-3); }

.thumbs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .2rem; }
.thumbs button {
  flex: none; width: 4.2rem; height: 3rem; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; background: var(--surface-2); position: relative;
}
.thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs button[aria-current="true"] { border-color: var(--accent); }
.thumbs button .done {
  position: absolute; right: 3px; bottom: 3px; width: .8rem; height: .8rem; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--surface);
}

.stage {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 16px 16px;
  max-height: 34rem; overflow-y: auto; cursor: crosshair; touch-action: none; user-select: none;
}
.stage canvas { display: block; width: 100%; height: auto; }
.sel {
  position: absolute; border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: 0 0 0 9999px rgba(22, 26, 27, .28); border-radius: 3px; pointer-events: none;
}

#out {
  width: 100%; min-height: 20rem; resize: vertical;
  font: inherit; font-size: .95rem; line-height: 1.6; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .8rem .9rem;
}
#out:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.unsure { display: grid; gap: .45rem; }
.unsure-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.unsure-list button {
  border: 1px dashed var(--line-2); background: var(--surface); cursor: pointer;
  padding: .2rem .55rem; border-radius: 6px; font-family: var(--font-mono); font-size: .8rem; color: var(--ink);
}
.unsure-list button:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 960px) {
  .work { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .how-list { grid-template-columns: 1fr; }
}
