.atp-view { display: grid; gap: 20px; min-width: 0; color: var(--ink); }
.atp-launcher { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line-strong); border-radius: 12px; min-width: 0; }
.atp-launcher h2 { font-size: 16px; margin-bottom: 6px; }
.atp-launcher .atp-detail-actions { justify-content: space-between; flex-wrap: wrap; }
.atp-launcher .atp-detail-actions > div { flex: 1 1 240px; }
.atp-launcher .atp-recovery-form { max-width: 760px; }
.atp-view svg { width: 18px; height: 18px; flex: 0 0 auto; }
.atp-source, .atp-source > div, .atp-detail > header, .atp-detail-actions, .atp-pagination, .atp-pagination > div { display: flex; align-items: center; gap: 12px; }
.atp-source, .atp-detail > header, .atp-pagination { justify-content: space-between; }
.atp-source { padding-bottom: 18px; border-bottom: 1px solid var(--line-strong); }
.atp-source p { display: grid; gap: 4px; }
.atp-source span, .atp-context, .atp-totals small, .atp-toolbar > span, .atp-detail > header p, .atp-detail-actions > span { color: var(--ink-soft); font-size: 13px; }
.atp-totals { display: grid; grid-template-columns: 1fr 1fr minmax(180px, .8fr); align-items: center; gap: 24px; padding: 8px 0 14px; }
.atp-totals > div { display: grid; gap: 5px; min-width: 0; }
.atp-totals span { font-size: 14px; font-weight: 500; }
.atp-totals strong { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.atp-totals p { font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.atp-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line-strong); }
.atp-tabs button { display: flex; align-items: center; gap: 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 12px; font-size: 14px; color: var(--ink-soft); }
.atp-tabs button:hover { background: var(--surface-2); }
.atp-tabs button[aria-pressed="true"] { color: var(--brand-700); border-bottom-color: var(--brand); font-weight: 600; }
.atp-tabs b { min-width: 24px; padding: 2px 6px; border-radius: 4px; background: var(--surface); color: var(--ink); font-size: 12px; text-align: center; }
.atp-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; }
.atp-toolbar label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; }
.atp-toolbar label:first-child { flex: 1 1 300px; }
.atp-toolbar label:nth-child(2) { flex: 0 1 290px; }
.atp-toolbar input, .atp-toolbar select { width: 100%; min-width: 0; }
.atp-toolbar > span { padding-bottom: 12px; }
.atp-view input::placeholder { color: #626263; opacity: 1; }
.atp-table-wrap { min-width: 0; max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.atp-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.atp-table caption { text-align: left; padding: 14px; font-weight: 600; }
.atp-table th { padding: 12px 14px; font-size: 12px; color: var(--ink-soft); font-weight: 500; background: var(--surface-2); }
.atp-table td { padding: 16px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.atp-table td > span, .atp-table td > strong { display: block; }
.atp-table td > span:not(.atp-status) { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.atp-table td > strong { font-size: 14px; font-weight: 600; }
.atp-table tr.is-selected td { background: var(--brand-tint); }
.atp-numeric { white-space: nowrap; font-variant-numeric: tabular-nums; }
.atp-status { display: inline-flex !important; padding: 4px 7px; border-radius: 4px; background: var(--surface-2); color: var(--ink-soft); font-size: 12px; }
.atp-status.is-warning { background: var(--warn-tint); color: #77500e; }
.atp-status.is-success { background: var(--ok-tint); color: #125e47; }
.atp-status.atp-reason-amount { background: oklch(96% .05 85); color: oklch(38% .08 65); }
.atp-status.atp-reason-guide { background: oklch(95% .03 305); color: oklch(38% .12 305); }
.atp-status.atp-reason-carta { background: oklch(95% .03 250); color: oklch(38% .10 250); }
.atp-status.atp-reason-invalid { background: oklch(95% .03 25); color: oklch(38% .12 25); }
.atp-status.atp-reason-other { background: var(--surface-2); color: var(--ink); }
.atp-row-action { text-align: right; }
.atp-row-action .btn { white-space: nowrap; }
.atp-row-buttons { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.atp-quick-recovery section { max-width: 600px; margin-inline: auto; display: grid; gap: 12px; }
.atp-quick-recovery .atp-recovery-form { border-top: 0; padding-top: 4px; }
.atp-quick-recovery section > strong { overflow-wrap: anywhere; }
.atp-pagination { font-size: 13px; color: var(--ink-soft); }
.atp-empty { padding: 46px 24px; text-align: center; display: grid; justify-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.atp-empty > svg { width: 28px; height: 28px; color: var(--ink-soft); }
.atp-empty h2 { font-size: 18px; font-weight: 600; }
.atp-empty p { max-width: 65ch; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.atp-skeleton { height: 15px; width: min(340px, 80%); border-radius: 4px; background: var(--line); }
.atp-alert { display: flex; gap: 12px; align-items: start; padding: 14px; border: 1px solid #dcba7a; border-radius: 8px; background: var(--warn-tint); color: #68450b; font-size: 14px; line-height: 1.5; }
.atp-detail { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 24px; display: grid; gap: 22px; scroll-margin-top: 24px; min-width: 0; }
.atp-detail h2 { font-size: 20px; overflow-wrap: anywhere; }
.atp-detail h3 { font-size: 16px; }
.atp-detail > header p { margin-top: 6px; }
.atp-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 0; }
.atp-facts dt { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.atp-facts dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.atp-detail-actions { flex-wrap: wrap; }
.atp-evidence { border-top: 1px solid var(--line); padding-top: 18px; }
.atp-evidence summary { cursor: pointer; font-size: 14px; font-weight: 500; }
.atp-guide { padding-top: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.atp-reasons { display: grid; gap: 9px; margin: 0; padding-left: 20px; }
.atp-reasons li { font-size: 14px; }
.atp-reasons code { display: block; font-size: 11px; color: var(--ink-soft); overflow-wrap: anywhere; margin-top: 3px; }
.atp-comparison th, .atp-comparison td { overflow-wrap: anywhere; }
.atp-recovery-form { width: min(100%, 600px); display: grid; gap: 16px; border-top: 1px solid var(--line-strong); padding-top: 20px; }
.atp-recovery-form > p { color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.atp-recovery-form > label:not(.atp-checkbox) { display: grid; gap: 7px; font-size: 14px; }
.atp-recovery-form textarea { font: inherit; resize: vertical; }
.atp-checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.5; }
.atp-checkbox input { width: 18px; height: 18px; flex: 0 0 18px; padding: 0; margin: 2px 0 0; accent-color: var(--brand); }
.atp-form-error { color: var(--crit) !important; }
.atp-recovery-receipt { display: grid; gap: 16px; }
.atp-view :focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.atp-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@media (max-width: 1150px) { .atp-totals { grid-template-columns: 1fr 1fr; } .atp-totals > p { grid-column: 1 / -1; } .atp-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .atp-source { align-items: flex-start; flex-direction: column; }
  .atp-totals { gap: 20px; } .atp-totals strong { font-size: 22px; }
  .atp-tabs { display: grid; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
  .atp-tabs button { justify-content: space-between; padding: 12px 14px; background: var(--surface); }
  .atp-tabs button[aria-pressed="true"] { background: var(--brand-tint); }
  .atp-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .atp-toolbar > span { padding: 0; }
  .atp-table:not(.atp-comparison), .atp-table:not(.atp-comparison) > tbody { display: block; }
  .atp-table:not(.atp-comparison) > thead { display: none; }
  .atp-table:not(.atp-comparison) > tbody > tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 15px; gap: 14px; border-bottom: 1px solid var(--line-strong); }
  .atp-table:not(.atp-comparison) > tbody > tr > td { display: block; padding: 0; border: 0; overflow-wrap: anywhere; }
  .atp-table:not(.atp-comparison) > tbody > tr > td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--ink-soft); margin-bottom: 6px; }
  .atp-table:not(.atp-comparison) > tbody > tr > td:first-child, .atp-table:not(.atp-comparison) > tbody > tr > .atp-row-action { grid-column: 1 / -1; }
  .atp-table > tbody > tr.atp-inline-detail { display: block; padding: 0; }
  .atp-table > tbody > tr.atp-inline-detail > td::before { display: none; }
  .atp-row-action .btn { width: 100%; justify-content: center; }
  .atp-detail { padding: 18px; }
  .atp-comparison { font-size: 12px; table-layout: fixed; }
  .atp-comparison th, .atp-comparison td { padding: 10px 8px; }
  .atp-pagination { align-items: flex-start; gap: 8px; flex-direction: column; }
}
.atp-inline-detail > td { padding: 0; }
.atp-inline-detail .atp-detail { border: 0; border-radius: 0; }
@media (max-width: 420px) { .atp-totals { grid-template-columns: 1fr; } }
