/* Shared AgentPayMail product controls use the existing brand tokens. */
:root { color-scheme: dark; }
:where(button, a, input, select, textarea, summary):focus-visible { outline:2px solid var(--pf); outline-offset:4px; }
button:disabled, [aria-disabled="true"] { cursor:not-allowed; opacity:.5; }
button:not(:disabled):active, .btn:active { transform:translateY(1px); }
.btn { transition:background .16s, border-color .16s, color .16s, opacity .16s, transform .16s; }
.btn[aria-busy="true"] { cursor:progress; }
.apm-visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.apm-mono, .apm-label { font-family:var(--mono); }
.apm-label { display:block; color:var(--muted-foreground); font-size:11px; text-transform:uppercase; letter-spacing:.1em; }
.apm-muted { color:var(--muted-foreground); font-size:13px; line-height:1.7; }
.apm-empty { padding:24px 0; color:var(--muted-foreground); font-size:14px; }
.apm-disclosure { margin-top:16px; color:var(--dim); font:11px/1.7 var(--mono); overflow-wrap:anywhere; }
.apm-error { color:#f87171; font-size:13px; padding:10px 0; }
.apm-badge { display:inline-flex; align-items:center; gap:6px; padding:4px 8px; border:1px solid var(--border); border-radius:4px; color:var(--pf); font:10px/1.4 var(--mono); white-space:nowrap; }
.apm-badge-warning { color:#e0af68; }
.apm-badge-error { color:#f87171; }
.is-success { color:var(--pf); }
.apm-toast-region { position:fixed; top:auto; left:auto; margin:0; padding:0; overflow:visible; border:0; background:transparent; z-index:1000; bottom:24px; right:24px; width:min(380px,calc(100% - 32px)); display:flex; flex-direction:column; gap:8px; pointer-events:none; }
.apm-toast { display:flex; align-items:center; gap:12px; padding:14px 16px; background:var(--card); color:var(--foreground); border:1px solid var(--border-strong); border-radius:8px; box-shadow:0 8px 28px #0008; font-size:13px; line-height:1.5; pointer-events:auto; animation:apm-toast-in .2s ease-out; transition:opacity .18s,transform .18s; }
.apm-toast.is-leaving { opacity:0; transform:translateY(6px); }
.apm-toast-icon { display:grid; place-items:center; width:22px; height:22px; flex-shrink:0; border-radius:50%; background:var(--accent); font:13px var(--mono); color:var(--pf); }
.apm-toast-error .apm-toast-icon { color:#f87171; }
.apm-toast-warning .apm-toast-icon { color:#e0af68; }
.apm-toast-dismiss { align-self:start; margin-left:auto; padding:0 4px; color:var(--dim); font-size:18px; }
.apm-modal { position:fixed; inset:0; margin:auto; width:min(650px,calc(100% - 32px)); max-height:calc(100dvh - 48px); color:var(--foreground); background:var(--background); border:1px solid var(--border-strong); border-radius:10px; padding:0; box-shadow:0 25px 80px #000a; overflow:auto; }
.apm-modal::backdrop { background:rgba(0,0,0,.7); backdrop-filter:blur(4px); }
.apm-modal[open] { animation:apm-modal-in .16s ease-out; }
.apm-modal-head { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:20px 24px; border-bottom:1px dashed var(--border-strong); }
.apm-modal-head h2 { font-size:16px; font-weight:600; letter-spacing:-.02em; }
.apm-modal-close { display:grid; place-items:center; width:28px; height:28px; color:var(--muted-foreground); border-radius:4px; font-size:22px; }
.apm-modal-close:hover { background:var(--accent); color:var(--foreground); }
.apm-modal-body { padding:24px; min-width:0; }
.apm-modal-footer { display:flex; justify-content:flex-end; gap:10px; padding:0 24px 24px; }
.apm-modal-footer:empty { display:none; }
.apm-drawer { inset:0 0 0 auto; margin:0; width:min(570px,calc(100% - 32px)); max-height:none; height:100dvh; border-radius:0; border-right:0; border-top:0; border-bottom:0; }
.apm-drawer .apm-modal-head { position:sticky; top:0; z-index:2; background:var(--background); }
.apm-thread-meta { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.apm-thread-subject { margin:20px 0; font-size:21px; line-height:1.4; font-weight:500; }
.apm-thread-list { display:flex; flex-direction:column; gap:12px; }
.apm-thread-message { padding:16px; background:var(--card); border:1px solid var(--border); border-radius:6px; }
.apm-thread-message>div { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.apm-thread-role { color:var(--pf); font:10px var(--mono); text-transform:uppercase; }
.apm-thread-message time { color:var(--dim); font:10px var(--mono); }
.apm-thread-message h4 { margin:8px 0; font-size:12px; font-family:var(--mono); font-weight:400; overflow-wrap:anywhere; }
.apm-thread-message p { color:var(--muted-foreground); font-size:13px; line-height:1.7; white-space:pre-wrap; overflow-wrap:anywhere; }
.apm-role-system { border-style:dashed; background:transparent; }
.apm-payment-request { margin-top:20px; padding:20px; border:1px solid var(--border-strong); border-radius:6px; }
.apm-payment-request>strong { display:block; font:28px/1.5 var(--mono); margin:6px 0; }
.apm-payment-request>p { font-size:12px; color:var(--muted-foreground); margin:4px 0 16px; }
.apm-payment-request .apm-live-progress { color:var(--pf); margin:12px 0 0; min-height:18px; }
.apm-receipt { margin-top:18px; padding:18px; background:var(--card); border:1px solid var(--border); border-radius:6px; }
.apm-receipt-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; color:var(--muted-foreground); font:11px var(--mono); }
.apm-receipt dl, .apm-thread-details dl { display:grid; gap:12px; }
.apm-receipt dl>div, .apm-thread-details dl>div { display:grid; grid-template-columns:95px 1fr; gap:12px; font-size:12px; }
.apm-receipt dt, .apm-thread-details dt { color:var(--dim); }
.apm-receipt dd, .apm-thread-details dd { margin:0; overflow-wrap:anywhere; }
.apm-thread-details { margin:20px 0; border-top:1px dashed var(--border); padding-top:16px; }
.apm-thread-details summary { color:var(--muted-foreground); cursor:pointer; font-size:12px; margin-bottom:16px; }
.apm-code-block { margin:18px 0; width:100%; max-width:100%; background:#0d0d0f; border:1px solid var(--border); border-radius:6px; overflow:hidden; }
.apm-code-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:10px 12px; border-bottom:1px solid var(--border); }
.apm-code-toolbar select { border:0; border-right:1px solid var(--border); border-radius:0; background:transparent; color:var(--foreground); font:11px var(--mono); padding:3px 12px 3px 0; min-width:100px; cursor:pointer; }
.apm-code-toolbar select option { background:var(--card); }
.apm-code-environment { color:var(--dim); margin-right:auto; font:10px var(--mono); }
.apm-code-button { border:1px solid var(--border); border-radius:4px; padding:5px 10px; color:var(--muted-foreground); font:11px var(--mono); transition:background .15s,border-color .15s,color .15s; }
.apm-code-button:hover:not(:disabled) { border-color:var(--border-strong); background:var(--accent); color:var(--foreground); }
.apm-code-block pre { max-width:100%; overflow:auto; margin:0; padding:20px; white-space:pre; tab-size:2; font:12px/1.8 var(--mono); color:var(--tk-v); }
.apm-code-block code { font:inherit; }
.apm-code-output { padding:16px 20px; border-top:1px dashed var(--border-strong); background:var(--pf-weak); white-space:pre-wrap; overflow-wrap:anywhere; max-height:300px; overflow:auto; font:11px/1.8 var(--mono); color:var(--pf); }
.apm-manual-copy { display:block; width:100%; min-height:180px; margin-top:16px; padding:14px; resize:vertical; border:1px solid var(--border-strong); border-radius:4px; background:var(--card); color:var(--foreground); font:12px/1.7 var(--mono); }
.apm-tools { display:flex; position:fixed; left:20px; bottom:20px; gap:6px; z-index:45; }
.apm-tools button { height:30px; padding:0 9px; background:var(--background); border:1px solid var(--border-strong); border-radius:4px; color:var(--dim); font:11px var(--mono); box-shadow:0 3px 12px #0005; transition:color .15s,border-color .15s; }
.apm-tools button:hover { color:var(--pf); border-color:var(--pf); }
.apm-command-modal { max-width:510px; }
.apm-command-modal .apm-modal-body { padding:16px; }
.apm-command-search { width:100%; padding:12px; margin-bottom:12px; border:1px solid var(--border); border-radius:4px; color:var(--foreground); background:var(--card); font:13px var(--mono); }
.apm-command-list { display:flex; flex-direction:column; gap:3px; }
.apm-command-list button { display:flex; align-items:center; justify-content:space-between; padding:12px; border-radius:4px; text-align:left; color:var(--muted-foreground); font-size:13px; transition:background .15s,color .15s; }
.apm-command-list button:hover, .apm-command-list button:focus { background:var(--accent); color:var(--foreground); }
.apm-command-list button[hidden] { display:none; }
.apm-terminal-modal { max-width:700px; }
.apm-terminal-output { height:290px; overflow:auto; margin:16px 0; padding:16px; background:#070708; border:1px solid var(--border); border-radius:4px; color:var(--pf); white-space:pre-wrap; overflow-wrap:anywhere; font:12px/1.8 var(--mono); }
.apm-terminal-form { display:flex; align-items:center; gap:12px; border:1px solid var(--border); padding:10px 12px; border-radius:4px; font-family:var(--mono); }
.apm-terminal-form label { color:var(--pf); }
.apm-terminal-form input { width:100%; min-width:0; color:var(--foreground); background:transparent; border:0; font:12px var(--mono); }
.apm-mini-steps { list-style:none; padding:0; margin:18px 0; }
.apm-mini-steps li { padding:8px 0; border-bottom:1px dashed var(--border); color:var(--muted-foreground); font:12px var(--mono); }
.apm-mini-steps li:last-child { color:var(--pf); }
.apm-skeleton { color:transparent!important; border-radius:4px; background:var(--accent); animation:apm-skeleton 1.5s ease-in-out infinite; pointer-events:none; }
@keyframes apm-toast-in { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:none; } }
@keyframes apm-modal-in { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:none; } }
@keyframes apm-skeleton { 50% { opacity:.4; } }
@media(max-width:640px) { .apm-modal { max-height:calc(100dvh - 32px); }.apm-modal-head { padding:18px; }.apm-modal-body { padding:18px; }.apm-modal-footer { padding:0 18px 18px; }.apm-drawer { max-height:100dvh; }.apm-toast-region { bottom:58px; right:16px; }.apm-tools { left:16px; bottom:16px; }.apm-thread-message>div { align-items:start; flex-direction:column; }.apm-receipt { padding:14px; }.apm-receipt dl>div { grid-template-columns:75px 1fr; }.apm-code-environment { display:none; }.apm-code-toolbar select { margin-right:auto; }.apm-code-block pre { padding:16px; font-size:11px; }.apm-terminal-output { height:240px; }.apm-thread-meta { flex-wrap:wrap; } }
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; } }
