/* Scans: uploading photos of cards and checking what was read from them. */
.scan-tips { margin: 8px 0 18px 18px; color: var(--dim); }
.scan-tips li { margin: 4px 0; }
.scan-open { margin: 8px 0 0 18px; }
.scan-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 18px 0; padding: 10px 14px; color: var(--dim); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.scan-wait { color: var(--warn); }
.scan-file { margin-left: 8px; font-size: 11px; font-weight: 400; color: var(--muted); }
table.scan-cards td { vertical-align: middle; }
.scan-pic { width: 140px; }
.scan-pic img { display: block; width: 124px; height: auto; border-radius: 6px; transition: transform 0.1s; transform-origin: left center; }
.scan-pic img:hover { position: relative; z-index: 3; transform: scale(3); }
.scan-read { max-width: 30ch; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.scan-by { display: inline-block; margin-bottom: 4px; padding: 0 8px; font-family: var(--mono); font-size: 10px; color: var(--bg); background: var(--accent3); border-radius: 99px; }
.scan-by-nameguess { background: var(--warn); }
.scan-by-nothing { color: #fff; background: var(--danger); }
.scan-decide { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.scan-what { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.scan-what select, .scan-what input[type=text] { padding: 5px 8px; font: inherit; font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; }
/* A card of many printings has long option texts; the closed select must not take the row. */
.scan-what select { max-width: 22ch; text-overflow: ellipsis; }
.scan-what select.scan-unsure { border-color: var(--warn); }
.scan-warn { font-size: 11px; color: var(--warn); }
.scan-buttons { display: flex; gap: 6px; }
.scan-state { margin-left: 10px; font-size: 11px; color: var(--muted); }
tr.scan-confirmed td { background: rgba(16, 185, 129, 0.06); }
tr.scan-skipped td { opacity: 0.5; }
.scan-by-ai { margin-left: 4px; color: #fff; background: var(--accent2); }
/* The conversation on the left, the cards to check on the right. On a wide screen the two fill the
   window and each scrolls by itself, so neither the bar nor the place to write leaves the view; on a
   narrow one they stand one under the other and the page scrolls as usual. */
.scan-layout { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 20px; }
.scan-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.scan-panel > .scan-bar { margin: 0 0 14px; }
.scan-scroll > .scan-photo:first-child { margin-top: 0; }
.scan-help h2 { margin: 18px 0 8px; font-family: var(--mono); font-size: 15px; }
.scan-help h2:first-child { margin-top: 0; }
.scan-help .hint { font-size: 13px; color: var(--muted); }
.scan-help .notice.ok { border-left-color: var(--accent3); }
@media (min-width: 901px) {
  body:has(.scan-layout) { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  body:has(.scan-layout) .container { display: flex; flex: 1 1 0; flex-direction: column; min-height: 0; padding-bottom: 16px; }
  .scan-layout { flex: 1 1 0; grid-template-rows: minmax(0, 1fr); min-height: 0; }
  .scan-scroll { flex: 1 1 0; min-height: 0; padding-right: 8px; overflow-y: auto; }
}
@media (max-width: 900px) {
  .scan-layout { grid-template-columns: 1fr; }
  .scan-layout .chat { max-height: 60vh; }
}
.scan-no { display: inline-block; margin-bottom: 4px; padding: 0 6px; font-family: var(--mono); font-size: 11px; color: var(--accent); border: 1px solid var(--border); border-radius: 4px; }
.scan-nopic { display: block; max-width: 124px; font-size: 11px; line-height: 1.4; color: var(--muted); }
.scan-open li { margin: 6px 0; }
.scan-open .post-action { display: inline-flex; margin-left: 10px; vertical-align: middle; }
.scan-original { margin: 0 0 14px; }
.scan-original summary { font-family: var(--mono); font-size: 12px; color: var(--dim); cursor: pointer; }
.scan-original-view { position: relative; max-width: 720px; margin-top: 10px; }
.scan-original-view img { display: block; width: 100%; height: auto; border-radius: 8px; }
.scan-original-view svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scan-original-view polygon { fill: none; stroke-width: 3; vector-effect: non-scaling-stroke; }
.scan-original-view polygon.sure { stroke: var(--accent3); }
.scan-original-view polygon.unsure { stroke: var(--warn); }
.scan-original-view polygon.unclear { stroke: var(--danger); stroke-dasharray: 8 6; }
.scan-original-view text { font-family: var(--mono); font-weight: 700; fill: #fff; stroke: #000; stroke-width: 0.12em; paint-order: stroke; text-anchor: middle; dominant-baseline: middle; }
.scan-done { margin: 8px 0 26px; }
.scan-done summary { margin-bottom: 10px; font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--accent3); cursor: pointer; }
/* One photo is one card of the panel, folded by its heading. */
.scan-photo { margin: 0 0 16px; padding: 12px 14px; background: var(--surface-glass, rgba(17, 24, 39, 0.5)); border: 1px solid var(--border); border-radius: 10px; }
.scan-photo > summary { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; cursor: pointer; list-style: none; }
.scan-photo > summary::-webkit-details-marker { display: none; }
/* The arrow a flex summary loses: it points right when folded, down when open. */
.scan-photo > summary::before { content: ""; align-self: center; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid var(--accent); transition: transform 0.12s; }
.scan-photo[open] > summary::before { transform: rotate(90deg); }
.scan-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.scan-photo > summary h2 { display: inline; font-family: var(--mono); font-size: 15px; }
.scan-photo[open] > summary { margin-bottom: 12px; }
.scan-tally { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.scan-photo .scan-done { margin: 12px 0 0; }
/* A scan in a window over a deck's conversation: the window takes the screen, and the scan's
   two columns fill it as they fill a page of their own. */
.modal-back:has(.modal.sheet) { padding: 16px; }
.modal.sheet { display: flex; flex-direction: column; max-width: 96rem; padding: 18px 20px 16px; }
.modal.sheet .modal-title { margin: 0 32px 14px 0; font-size: 16px; }
@media (min-width: 901px) {
  .modal.sheet { height: calc(100vh - 32px); height: calc(100dvh - 32px); }
  .modal.sheet .scan-layout { flex: 1 1 0; }
}
.scan-commit { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.scan-commit label { display: inline-flex; gap: 6px; align-items: center; }
.scan-owned { font-size: 11px; color: var(--muted); }
