/* A shared conversation surface for management, landlord and resident work. */
.ai-contract-heading {padding:16px 20px 12px;}
.ai-contract-heading h2 {margin:0;}
.ai-contract-heading p {margin:4px 0 0; color:var(--chat-muted); font-size:.875rem;}
:is(.ai-monthly-contract .ai-contract-values,.ai-contract-values.ai-invoice-values) {
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr));
 gap:12px;
 margin:0;
 padding:0 20px 16px;
}
.ai-invoice-completion{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px 16px;padding:12px 14px;margin:0 20px 12px;border-radius:12px;background:var(--chat-soft);color:var(--chat-ink);font-size:.875rem}
.ai-invoice-completion time{font-variant-numeric:tabular-nums}
.ai-invoice-reversals{padding:0 20px 16px}
.ai-invoice-reversals h3{margin:0;font-size:.9rem}
.ai-invoice-reversals ul{list-style:none;padding:0;margin:6px 0 0}
.ai-invoice-reversals li{display:flex;justify-content:space-between;gap:8px 16px;flex-wrap:wrap;padding:10px 0;border-top:1px solid var(--chat-line);font-size:.875rem}
.ai-invoice-reversals p{color:var(--chat-muted);font-size:.8125rem}
.ai-contract-values>div {
 padding:12px;
 border-radius:12px;
 background:var(--chat-soft);
}
.ai-contract-values dt {
 color:var(--chat-muted);
 font-size:.875rem;
 word-break:keep-all;
}
.ai-contract-values dd {
 margin:3px 0 0;
 font-size:clamp(1rem,3vw,1.25rem);
 font-weight:650;
 font-variant-numeric:tabular-nums;
 overflow-wrap:anywhere;
}
.ai-monthly-contract .ai-card-action a {min-height:44px; box-sizing:border-box;}
.ai-amount {white-space:nowrap;font-variant-numeric:tabular-nums;}
:is(.assistant,.landlord-assistant){--chat-ink:#19232f;--chat-muted:#566474;--chat-accent:#0066cc;--chat-line:#e1e6ed;--chat-surface:#fff;--chat-soft:#f4f6f9;--chat-radius:20px;color:var(--chat-ink);font-family:-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Noto Sans KR",sans-serif;font-size:16px;line-height:1.65;color-scheme:light}
:root .assistant{max-width:880px;padding:32px!important;border:1px solid var(--chat-line);border-radius:28px;background:var(--chat-surface);box-shadow:0 8px 36px #152b4710}
.ai-eyebrow{font-size:12px!important;letter-spacing:.07em;font-weight:600;color:var(--chat-muted)!important;margin:0 0 16px!important}
.assistant .ai-identity{gap:12px;margin:0 0 14px}.assistant .ai-identity img{width:40px;height:40px;border-radius:12px}.assistant .ai-identity h1{font-size:32px!important;font-weight:700;letter-spacing:-1.2px;line-height:1.25;margin:0!important}.assistant .ai-top p{color:var(--chat-muted);font-size:15px;word-break:keep-all}
:is(.assistant,.landlord-assistant) .ai-chat-toolbar{gap:8px;padding:14px 0;margin:20px 0 0;background:var(--chat-surface);border-color:var(--chat-line);box-shadow:none}
:is(.assistant,.landlord-assistant) .ai-chat-toolbar button{min-height:46px;border-radius:12px;padding:10px 16px;font-size:14px;font-weight:600;box-shadow:none}.assistant #ai-new{background:var(--chat-accent);border-color:var(--chat-accent);color:#fff}.assistant #ai-history-toggle{background:var(--chat-soft);border:1px solid transparent;color:var(--chat-ink)}
:is(.assistant,.landlord-assistant) .ai-chat-status{font-size:12px;color:var(--chat-muted);margin-inline-start:auto}
.assistant .ai-scope{margin:16px 0 24px;gap:8px 12px}.assistant .ai-scope>span{border:1px solid var(--chat-line);background:var(--chat-soft);color:var(--chat-ink);border-radius:99px;padding:6px 12px;font-size:13px}.assistant .ai-scope small{font-size:12px;color:var(--chat-muted)}
.assistant .ai-prompts{gap:12px;margin:24px 0}.assistant .ai-prompts button{min-height:76px;align-items:center;padding:18px;border:1px solid var(--chat-line);border-radius:16px;background:var(--chat-surface);color:var(--chat-ink);font-size:15px;line-height:1.5;word-break:keep-all}.assistant .ai-prompts button>span{color:var(--chat-muted);font-size:20px;flex:none}
:is(.assistant,.landlord-assistant) .ai-turn{margin:28px 0 38px;animation:chat-arrive .16s ease-out}.ai-conversation:empty{display:none}
:is(.assistant,.landlord-assistant) .ai-question{width:fit-content;max-width:88%;background:#eef3f9;color:var(--chat-ink);border:0;border-radius:20px 20px 6px 20px;padding:14px 18px;margin:0 0 24px auto;font-size:15px;line-height:1.65}
:is(.assistant,.landlord-assistant) .ai-answer{border:0;padding:0}.ai-answer-label{display:inline-flex;align-items:center;gap:8px;color:var(--chat-muted)!important;font-size:12px;font-weight:600;margin-bottom:6px}.ai-answer-label::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--chat-accent);flex:none}
:is(.assistant,.landlord-assistant) .ai-reply{font-size:16px;line-height:1.85;letter-spacing:-.2px;color:var(--chat-ink);white-space:normal;max-width:72ch;margin:4px 0 18px;word-break:keep-all;overflow-wrap:anywhere}.ai-reply>p{margin:0 0 14px}.ai-reply>p:last-child{margin-bottom:0}.ai-reply .ai-section-heading{margin:22px 0 6px;font-size:14px;color:var(--chat-muted)}.ai-reply .ai-section-heading:first-child{margin-top:8px}.ai-reply ul,.ai-reply ol{padding-inline-start:22px;margin:10px 0 20px}.ai-reply li{padding-inline-start:3px;margin:8px 0}.ai-reply strong{font-weight:650}
:is(.assistant,.landlord-assistant) .ai-asof{font-size:12px;line-height:1.6;color:var(--chat-muted);margin:12px 0 20px}
:is(.assistant,.landlord-assistant) .ai-reconciliation{border:1px solid var(--chat-line);border-radius:var(--chat-radius);background:var(--chat-surface);box-shadow:none;margin:22px 0;overflow:hidden}.ai-reconciliation>header{padding:20px 20px 10px}.ai-reconciliation h2{font-size:17px;line-height:1.5}.ai-table-note{color:var(--chat-muted);font-size:13px;padding:0 20px 16px}
:is(.assistant,.landlord-assistant) .ai-key-evidence{margin:8px 16px 16px;padding:12px 16px;border:0;border-radius:14px;background:var(--chat-soft)}.ai-key-evidence summary{font-size:14px;color:var(--chat-ink)}.ai-key-evidence p{font-size:14px;color:var(--chat-muted);margin:8px 0 4px}
:is(.assistant,.landlord-assistant) .ai-sources{margin-top:20px;color:var(--chat-muted);border:0;background:none}.ai-sources>summary,.ai-notes>summary{min-height:44px;display:flex;align-items:center;gap:8px;cursor:pointer;font-size:13px;list-style:none}.ai-sources>summary::before,.ai-notes>summary::before{content:"＋";font-size:17px;line-height:1}.ai-sources[open]>summary::before,.ai-notes[open]>summary::before{content:"−"}.ai-notes{margin:8px 0;font-size:13px;color:var(--chat-muted)}
:is(.assistant,.landlord-assistant) .ai-composer{border:1px solid #bac7d6;border-radius:22px;padding:16px;background:var(--chat-surface);box-shadow:0 4px 16px #152b4708;margin:24px 0 0;transition:border-color .15s,box-shadow .15s}.assistant .ai-composer:focus-within{border-color:var(--chat-accent);box-shadow:0 0 0 3px #0066cc18}.assistant .ai-composer textarea{font-size:16px;line-height:1.65;min-height:64px;color:var(--chat-ink)}.assistant .ai-composer textarea::placeholder{color:#5d6c7d}.assistant .ai-send{height:46px;width:46px;border-radius:14px;background:var(--chat-accent);color:#fff;font-size:26px;flex:none}.ai-composer-caption,.ai-help{color:var(--chat-muted);font-size:12px;line-height:1.6}.assistant .ai-attach{min-height:44px;padding:8px 12px;border-radius:10px}.assistant .ai-help{margin:12px 0 24px}
.ai-answer-tools{display:flex;align-items:center;gap:10px;margin:12px 0}.ai-copy{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:8px 12px;border:1px solid transparent!important;border-radius:10px;background:transparent!important;color:var(--chat-muted)!important;font:inherit;font-size:13px;cursor:pointer}.ai-copy-status{font-size:12px;color:var(--chat-muted)}.ai-next{padding:16px 0 0;border-top:1px solid var(--chat-line);margin:12px 0 20px}.ai-next>p{margin:0 0 10px;font-size:12px;font-weight:600;color:var(--chat-muted)}.ai-next>div{display:flex;flex-wrap:wrap;gap:8px}.ai-next button{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:10px 14px;border:1px solid var(--chat-line);border-radius:12px;background:var(--chat-surface);color:var(--chat-ink);font:inherit;font-size:13px;line-height:1.5;text-align:left;word-break:keep-all;cursor:pointer}.ai-next button span{color:var(--chat-muted);flex:none}
:is(.assistant,.landlord-assistant) :is(button,a,summary){-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:background-color .15s,color .15s,border-color .15s}:is(.assistant,.landlord-assistant) :is(button,a,summary):focus-visible{outline:3px solid var(--chat-accent);outline-offset:3px}:is(.assistant,.landlord-assistant) button:disabled{opacity:.5;cursor:wait}
@media(hover:hover){.ai-next button:hover,.ai-copy:hover,.assistant .ai-prompts button:hover{background:var(--chat-soft)!important;border-color:#bac7d6!important}}
.landlord-assistant{border-radius:24px!important;border:1px solid var(--chat-line)!important;background:var(--chat-surface)!important}.landlord-assistant .ask textarea{font-size:16px;min-height:100px;border-radius:16px!important;padding:16px!important;line-height:1.65}.landlord-assistant .ask>button{border-radius:12px;min-height:46px;padding:10px 18px;background:var(--chat-accent);color:#fff}.landlord-assistant .answer{margin-top:28px;padding:0;border:0;background:none}.landlord-assistant .ai-turn+.ai-turn{border-top:1px solid var(--chat-line);padding-top:28px}.landlord-assistant .landlord-ai-context{color:var(--chat-muted);font-size:13px}
@keyframes chat-arrive{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@media(max-width:760px){:root .assistant{padding:20px 16px!important;margin:16px 0!important;border-radius:22px}.assistant .ai-identity h1{font-size:27px!important}.assistant .ai-chat-status{width:100%;margin:4px 0 0}.assistant .ai-chat-toolbar{top:env(safe-area-inset-top,0px);margin-top:16px}.assistant .ai-scope{margin:16px 0}.assistant .ai-prompts{gap:10px}.assistant .ai-prompts button{padding:14px;font-size:14px;min-height:86px}.assistant .ai-composer{padding:12px}.ai-next>div{display:grid;grid-template-columns:1fr}.ai-next button{width:100%}:is(.assistant,.landlord-assistant) .ai-question{max-width:94%;padding:12px 15px}.ai-reconciliation>header{padding:18px 14px 10px}.ai-table-note{padding:0 14px 16px}:is(.assistant,.landlord-assistant) .ai-key-evidence{margin:8px 12px 12px;padding:10px 12px}.landlord-assistant{padding:20px 16px!important}.ai-reply{max-width:100%}.ai-turn{scroll-margin-top:130px}}
@media(max-width:360px){.assistant .ai-prompts{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){:is(.assistant,.landlord-assistant) *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Intake drafts should show the symptom, not only the location header. */
:is(.assistant,.landlord-assistant) :is(.ai-intake,.landlord-intake) textarea{min-height:180px;font-size:16px;line-height:1.75}
:is(.assistant,.landlord-assistant) :is(.ai-intake,.landlord-intake){border:1px solid var(--chat-line);border-radius:20px;background:#f7f9fc;padding:20px;margin:24px 0}
:is(.assistant,.landlord-assistant) :is(.ai-intake,.landlord-intake) label{color:var(--chat-muted);font-size:13px}
:is(.assistant,.landlord-assistant) :is(.ai-intake,.landlord-intake) button[type=submit],.landlord-assistant .landlord-intake>button{background:var(--chat-accent)!important;color:white!important;border-radius:12px;min-height:46px}
@media(max-width:760px){:is(.assistant,.landlord-assistant) :is(.ai-intake,.landlord-intake){padding:16px}.assistant .ai-scope{margin-bottom:12px}.assistant .ai-composer{margin-top:14px}}

.ai-evidence-review{list-style:none;padding:0 20px;margin:0}.ai-evidence-review li{padding:18px 0;border-top:1px solid var(--chat-line)}.ai-evidence-review li>div{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}.ai-evidence-review p{font-size:14px;line-height:1.7;margin:8px 0}.ai-evidence-review small{display:block;font-size:12px;color:var(--chat-muted);overflow-wrap:anywhere}.ai-row-state small{overflow-wrap:anywhere}.ai-evidence-review .ai-detail-link{margin-top:8px}
@media(max-width:760px){.ai-evidence-review{padding:0 14px}.ai-result-table .ai-row-state{grid-column:1/-1}.ai-result-table td:last-child{grid-column:1/-1}}

/* Keep the answer below the sticky conversation controls after a submission. */
:is(.assistant,.landlord-assistant) .ai-turn{scroll-margin-block-start:112px}
.ai-payment-facts{display:flex;flex-wrap:wrap;column-gap:14px;row-gap:4px}
@media(max-width:760px){:is(.assistant,.landlord-assistant) .ai-turn{scroll-margin-block-start:148px}}
@media(min-width:761px){.landlord-assistant .ai-turn{scroll-margin-block-start:92px}}

:is(.assistant,.landlord-assistant) .ai-reply>.ai-section-heading:first-child{
 color:var(--chat-ink);font-size:16px;font-weight:700;margin-bottom:10px
}

:is(.assistant,.landlord-assistant) caption.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}

.ai-pending-turn .ai-question{white-space:pre-wrap;overflow-wrap:anywhere}
.ai-pending-turn .ai-retrieval{width:fit-content;max-width:100%;margin:0;padding:12px 16px;background:var(--chat-soft);color:var(--chat-ink);border-color:var(--chat-line)}
.ai-pending-turn .ai-retrieval p{margin:4px 0 0;color:var(--chat-muted)}

.ai-scope-choices.ai-receipt-choices{display:grid;gap:8px}
.ai-receipt-choices button{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:54px;text-align:start}
.ai-receipt-choices button time{display:block;margin-top:2px;color:var(--chat-muted);font-size:.8125rem;font-variant-numeric:tabular-nums}
.ai-receipt-choices button .ai-amount{flex-shrink:0}
