/* Owner Preview (Send agreement) and the hand-drawn signature pad. */
.ap-dialog{width:min(1180px,96vw);max-height:94vh;padding:0;border:1px solid #cfd8df;border-radius:12px;color:#15202b;background:#fff;display:flex;flex-direction:column;overflow:hidden}
.ap-dialog:not([open]){display:none}
.ap-dialog::backdrop{background:rgba(10,24,36,.55)}
.ap-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:14px 18px 8px;border-bottom:1px solid #e3e8ec}
.ap-head h2{margin:0;font-size:1.15rem;flex:1 1 auto}
.ap-tags{display:flex;gap:6px;flex-wrap:wrap}
.ap-tag{font-size:.78rem;font-weight:700;padding:3px 9px;border-radius:999px;background:#eef3f6;color:#2c3d4b}
.ap-tag.custom{background:#fff1d6;color:#7a4b00}
.ap-tag.ok{background:#e6f6ec;color:#1c6b3d}
.ap-tag.warn{background:#fdecea;color:#a3281b}
.tag-custom{display:inline-block;margin-left:6px;font-size:.75rem;font-weight:700;padding:2px 8px;border-radius:999px;background:#fff1d6;color:#7a4b00;vertical-align:middle}
.ap-banner{margin:0;padding:8px 18px;background:#fff8e6;color:#6b4a00;font-size:.9rem;border-bottom:1px solid #f1e2b8}
.ap-bar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;padding:10px 18px}
.ap-tabs,.ap-sizes{display:inline-flex;border:1px solid #cfd8df;border-radius:8px;overflow:hidden}
.ap-tab,.ap-size{border:0;border-radius:0;background:#fff;color:#1d6f96;padding:8px 14px;font-weight:600;min-height:40px;cursor:pointer}
.ap-tab.on,.ap-size.on{background:#1d6f96;color:#fff}
.ap-status{margin:0 18px;min-height:1.2em;font-size:.9rem;color:#2c3d4b}
.ap-status.err{color:#a3281b;font-weight:600}
.ap-body{display:grid;grid-template-columns:1fr;gap:14px;padding:10px 18px;overflow:auto;flex:1 1 auto;min-height:0}
.ap-body.editing{grid-template-columns:minmax(300px,440px) 1fr}
.ap-editor{display:flex;flex-direction:column;gap:10px;overflow:auto;max-height:70vh;padding-right:6px}
.ap-editor h3{margin:8px 0 0;font-size:1rem}
.ap-editor label{display:flex;flex-direction:column;gap:4px;font-weight:600;font-size:.9rem}
.ap-editor label.check{flex-direction:row;align-items:center;gap:8px;font-weight:500}
.ap-editor input:not([type=checkbox]),.ap-editor select,.ap-editor textarea{font:inherit;padding:8px;border:1px solid #b9c5ce;border-radius:6px;width:100%;box-sizing:border-box}
.ap-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px}
.ap-section{border:1px solid #dde3e8;border-radius:8px;padding:10px;margin:0;display:flex;flex-direction:column;gap:8px}
.ap-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.ap-view{display:flex;flex-direction:column;align-items:center;gap:8px;min-width:0}
.ap-meta{display:grid;grid-template-columns:auto 1fr;gap:2px 12px;margin:0;width:100%;max-width:760px;font-size:.92rem}
.ap-meta dt{font-weight:700;color:#4a5763}.ap-meta dd{margin:0;overflow-wrap:anywhere}
.ap-frame{border:1px solid #cfd8df;border-radius:10px;background:#fff;height:62vh;width:100%;max-width:980px}
.ap-frame.phone{width:390px;max-width:100%;border-width:10px;border-color:#22303c;border-radius:28px}
.ap-sig{display:flex;gap:10px;flex-wrap:wrap;align-items:center;padding:6px 18px}
.ap-pad{flex-basis:100%;max-width:560px}
.ap-foot{display:flex;gap:10px;flex-wrap:wrap;padding:12px 18px;border-top:1px solid #e3e8ec;background:#f7fafc}
.sp-canvas{display:block;width:100%;max-width:560px;aspect-ratio:10/3;border:1px dashed #8a99a6;border-radius:8px;background:#fff;touch-action:none}
.sp-wrap{display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.cs-current{display:block;max-width:320px;width:100%;border-bottom:1px solid #aaa;background:#fff}
@media (max-width:760px){
  .ap-dialog{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0}
  .ap-body.editing{grid-template-columns:1fr}
  .ap-editor{max-height:none}
  .ap-frame{height:70vh}
  .ap-frame.phone{border-width:6px;border-radius:18px}
}
/* The dashboard is dark; the preview is a light sheet, so its own buttons and fields are styled here. */
.ap-dialog button{font:inherit;font-weight:600;min-height:40px;padding:8px 14px;border-radius:8px;cursor:pointer;background:#1d8fc0;color:#fff;border:1px solid #1d8fc0;opacity:1}
.ap-dialog button.secondary{background:#fff;color:#0b4f72;border:1px solid #7fa6bd}
.ap-dialog button.secondary:hover{background:#eef6fa}
.ap-dialog button:disabled{opacity:.6;cursor:wait}
.ap-dialog .ap-tab,.ap-dialog .ap-size{border:0;border-radius:0;background:#fff;color:#0b4f72}
.ap-dialog .ap-tab.on,.ap-dialog .ap-size.on{background:#1d6f96;color:#fff}
.ap-dialog .muted{color:#4a5763}
.ap-meta dd{color:#15202b}
.ap-editor label{color:#15202b}
.ap-editor input:not([type=checkbox]),.ap-editor select,.ap-editor textarea{background:#fff;color:#15202b}
.ap-dialog .sp-canvas{background:#fff}
/* Preview sheets (email / agreement) and the Quote tab's agreement text. */
.ap-frame{overflow:auto;background:#fff;color:#15202b}
.ap-frame.phone{height:68vh}
.qt-box{margin-top:16px}
.qt-sheet{background:#fff;color:#15202b;border-radius:8px;padding:16px 18px;max-height:70vh;overflow:auto}
.qt-sheet h2{font-size:1.05rem;margin:14px 0 4px;color:#0b3d5c}
.qt-sheet p{margin:0 0 10px;white-space:pre-line;line-height:1.55}
#owner-terms p{white-space:pre-line}
