/* handoff/amazon-sheets-sync/tool.css (thiet-ke, o-8dde55). Loaded AFTER styles.css; uses its tokens only. */
:root { --ok: #0f6b4f; --bad: #b42318; --bad-soft: #fdecea; --tool-line: var(--line); }
@media (prefers-color-scheme: dark) {
  :root { --ok: #4cc39a; --bad: #ff8a80; --bad-soft: #3a1f1d; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.btn, .btn-primary { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border: 0; cursor: pointer; padding: 13px 24px; border-radius: 999px; font: inherit; font-weight: 600; }
.btn:focus-visible, .btn-primary:focus-visible, .visually-hidden:focus-visible + .hint { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone:focus-within { border-color: var(--accent); }

#tool .tool-lead { max-width: 40em; margin: 0 0 20px; }
.dropzone {
  background: var(--surface); border: 2px dashed var(--tool-line); border-radius: var(--radius);
  padding: 32px 20px; text-align: center; display: grid; justify-items: center; gap: 12px;
}
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon { color: var(--accent); }
.dropzone-btn { cursor: pointer; }
.dropzone-hint { margin: 0; font-size: 14px; color: var(--muted); max-width: 36em; }

#toolResults { margin-top: 24px; }
#toolResults:empty { display: none; }
.loading { text-align: center; padding: 32px 20px; color: var(--muted); }
.loading p { margin: 0; font-size: 17px; }

.results { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.results-header h2 { font-size: 22px; margin: 0 0 4px; }
.settlement-id { margin: 0 0 20px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.back-link { display: inline-flex; align-items: center; min-height: 48px; font-size: 15px; font-weight: 600; }
.summary-cards { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); margin-bottom: 24px; }
.summary-cards .card { padding: 16px; }
.card-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.card-amount { font-size: 26px; font-weight: 700; line-height: 1.2; margin: 4px 0; font-variant-numeric: tabular-nums; color: var(--text); }
.card-amount.ok { color: var(--ok); }
.card-amount.warn { color: var(--warn); }
.card-amount.alert { color: var(--bad); }
.card-note { font-size: 14px; color: var(--muted); }

.findings-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.findings-table th, .findings-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.findings-table th { font-size: 13px; font-weight: 600; color: var(--muted); }
.findings-table .amount-col { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.findings-table tr.flagged td { background: color-mix(in srgb, var(--warn) 12%, transparent); }
.findings-table .tag { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--warn); }
.findings-actions { margin-top: 20px; display: grid; gap: 10px; justify-items: start; }
.findings-actions p { margin: 0; color: var(--muted); }

.error-section { margin: 0; }
.error-card { background: var(--bad-soft); border: 1px solid var(--bad); border-radius: var(--radius); padding: 20px; }
.error-card h3 { color: var(--bad); margin: 0 0 6px; }
.error-card p { margin: 0 0 14px; overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .summary-cards { grid-template-columns: 1fr; }
  .results { padding: 16px; }
}
@media (max-width: 640px) {
  /* table rows become labelled cards, no sideways scroll at 390 */
  .findings-table thead { display: none; }
  .findings-table table, .findings-table tbody, .findings-table tr, .findings-table td { display: block; width: 100%; }
  .findings-table tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
  .findings-table td { border-bottom: 0; padding: 8px 12px; }
  .findings-table .amount-col { text-align: left; font-weight: 700; padding-top: 0; }
}

/* o-781269 UX pass (thiet-ke 2026-11-19): nav Plans link, sample run, file help, next step after results. */
.top-nav { display: flex; align-items: center; gap: 16px; }
.top-link { display: inline-flex; align-items: center; min-height: 48px; padding: 0 4px; font-weight: 600; text-decoration: none; }
#sampleBtn { margin-top: 4px; }
.where { margin: 16px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; }
.where summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--accent); }
.where p { margin: 0 0 16px; font-size: 15px; }
.sample-note { margin: 16px 0 0; font-size: 14px; font-weight: 600; color: var(--warn); }
.tool-next { margin-top: 16px; padding: 20px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); display: grid; gap: 12px; justify-items: start; }
.tool-next p { margin: 0; }
.tool-next[hidden], .sample-note[hidden] { display: none; }
@media (max-width: 860px) {
  /* stacked hero: the example table pushed the real tool 1.3 screens down; the sample run now shows a real result */
  .hero .sheet { display: none; }
  .hero { padding-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media (max-width: 480px) {
  .top-sheet { display: none; }
}
