.d1ph-client-portal{--p:#5A3E9A;--a:#C04A9A;--dark:#21183f;--bg:#f7f6fb;max-width:1120px;margin:40px auto;padding:0 18px;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#171327}.d1ph-portal-hero{display:flex;justify-content:space-between;align-items:center;gap:24px;padding:34px;border-radius:24px;background:linear-gradient(135deg,var(--dark),var(--p) 58%,var(--a));color:#fff;box-shadow:0 22px 55px rgba(42,29,75,.22)}.d1ph-portal-hero h1{margin:8px 0 4px;font-size:clamp(28px,4vw,44px);color:#fff}.d1ph-portal-hero p{margin:0;opacity:.84}.d1ph-portal-kicker{font-size:11px;font-weight:800;letter-spacing:.18em;color:#9ee7ff}.d1ph-portal-status{padding:10px 16px;border-radius:999px;background:#fff;color:var(--p);font-weight:800}.d1ph-portal-alert{margin:18px 0;padding:14px 18px;border-radius:14px;background:#eafaf0;color:#16743b}.d1ph-portal-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:20px 0}.d1ph-portal-metrics>div,.d1ph-portal-grid article,.d1ph-portal-message-form,.d1ph-portal-files a,.d1ph-portal-approvals article{background:#fff;border:1px solid #e8e3f1;border-radius:18px;box-shadow:0 10px 28px rgba(45,34,80,.07)}.d1ph-portal-metrics>div{padding:20px}.d1ph-portal-metrics small{display:block;color:#776e8c}.d1ph-portal-metrics strong{display:block;font-size:26px;margin-top:6px}.d1ph-portal-metrics i{display:block;height:6px;background:#eeeaf6;border-radius:8px;margin-top:12px;overflow:hidden}.d1ph-portal-metrics b{display:block;height:100%;background:linear-gradient(90deg,#16a9e8,var(--p),var(--a))}.d1ph-portal-tabs{display:flex;gap:8px;overflow:auto;padding:6px;background:#fff;border:1px solid #e8e3f1;border-radius:16px}.d1ph-portal-tabs button{border:0;background:transparent;padding:12px 16px;border-radius:11px;font-weight:800;color:#625a76;cursor:pointer;white-space:nowrap}.d1ph-portal-tabs button.is-active{background:linear-gradient(135deg,var(--p),var(--a));color:#fff}.d1ph-portal-panel{display:none;padding:22px 0}.d1ph-portal-panel.is-active{display:block}.d1ph-portal-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.d1ph-portal-grid article{padding:25px}.d1ph-portal-grid article>span{font-size:11px;letter-spacing:.15em;color:var(--p);font-weight:900}.d1ph-portal-grid h2{font-size:22px;margin:8px 0 16px}.d1ph-portal-checklist{list-style:none;padding:0;margin:0}.d1ph-portal-checklist li{display:flex;gap:10px;padding:9px 0;border-bottom:1px solid #eeeaf5}.d1ph-portal-checklist li.is-done{text-decoration:line-through;color:#8b8498}.d1ph-portal-conversation{display:flex;flex-direction:column;gap:12px;margin-bottom:20px}.d1ph-portal-conversation article{max-width:78%;padding:14px 17px;border-radius:18px;background:#fff;border:1px solid #e5dfef}.d1ph-portal-conversation article.is-agency{align-self:flex-end;background:#f0e9fb;border-color:#ded0f3}.d1ph-portal-conversation small{display:block;color:#746c84;margin-bottom:7px}.d1ph-portal-conversation p{margin:0 0 8px}.d1ph-portal-message-form{padding:22px}.d1ph-portal-message-form label{font-weight:800}.d1ph-portal-message-form textarea{display:block;width:100%;box-sizing:border-box;margin:9px 0 14px;border:1px solid #d9d2e6;border-radius:13px;padding:14px;font:inherit;color:#171327}.d1ph-portal-message-form button,.d1ph-portal-approvals a{border:0;border-radius:11px;padding:12px 18px;background:linear-gradient(135deg,var(--p),var(--a));color:#fff;font-weight:800;text-decoration:none;cursor:pointer}.d1ph-portal-files{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.d1ph-portal-files a{padding:18px;text-decoration:none;color:#21183f}.d1ph-portal-files strong,.d1ph-portal-files small{display:block;overflow:hidden;text-overflow:ellipsis}.d1ph-portal-files small{margin-top:6px;color:#776f86}.d1ph-portal-approvals{display:grid;gap:12px}.d1ph-portal-approvals article{display:flex;align-items:center;gap:18px;padding:18px}.d1ph-portal-approvals article div{flex:1}.d1ph-portal-approvals strong,.d1ph-portal-approvals small{display:block}.d1ph-portal-approvals span{font-weight:800;color:var(--p)}.d1ph-portal-empty,.d1ph-portal-invalid{background:#fff;border:1px solid #e8e3f1;border-radius:18px;padding:28px;text-align:center}.d1ph-portal-invalid{max-width:680px;margin:70px auto}@media(max-width:760px){.d1ph-portal-hero{align-items:flex-start;flex-direction:column}.d1ph-portal-metrics{grid-template-columns:1fr 1fr}.d1ph-portal-grid{grid-template-columns:1fr}.d1ph-portal-files{grid-template-columns:1fr}.d1ph-portal-conversation article{max-width:92%}.d1ph-portal-approvals article{align-items:flex-start;flex-wrap:wrap}}

/* Sprint 6.2 — standalone app experience */
body.d1ph-client-portal-app{margin:0!important;background:#0d0920!important;color:#171327;min-height:100vh;overflow-x:hidden}body.d1ph-client-portal-app>.site,body.d1ph-client-portal-app #page{min-height:100vh}.d1ph-app-shell{min-height:100vh;background:radial-gradient(circle at 88% 4%,rgba(192,74,154,.20),transparent 28%),linear-gradient(180deg,#110b27 0,#0d0920 52%,#f7f6fb 52%);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.d1ph-app-topbar{height:74px;display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;padding:0 max(24px,calc((100vw - 1120px)/2));border-bottom:1px solid rgba(255,255,255,.10);color:#fff}.d1ph-app-brand{display:flex;align-items:baseline;gap:3px;color:#fff!important;text-decoration:none!important}.d1ph-app-brand span,.d1ph-app-brand strong{font-size:25px;line-height:1}.d1ph-app-brand span{color:#d991cc}.d1ph-app-brand small{margin-left:10px;font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:#9ee7ff}.d1ph-app-secure{font-size:12px;color:#cfc7df}.d1ph-app-main{padding:1px 0 52px}.d1ph-app-footer{padding:28px 20px;text-align:center;color:#6f687e;background:#f7f6fb;font-size:12px}.d1ph-client-portal{margin:26px auto 0}.d1ph-portal-hero{position:relative;overflow:hidden}.d1ph-portal-hero:after{content:"";position:absolute;width:260px;height:260px;border-radius:50%;right:-95px;top:-145px;background:rgba(255,255,255,.08)}.d1ph-portal-identity{display:flex;align-items:center;gap:18px;position:relative;z-index:1}.d1ph-portal-avatar{width:62px;height:62px;border-radius:18px;display:grid;place-items:center;background:linear-gradient(135deg,#d26bb7,#7655b4);box-shadow:inset 0 0 0 1px rgba(255,255,255,.18);font-size:27px;font-weight:900}.d1ph-portal-hero-side{display:flex;align-items:flex-end;flex-direction:column;gap:10px;position:relative;z-index:1}.d1ph-portal-hero-side small{color:rgba(255,255,255,.76)}.d1ph-portal-welcome{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:20px 0;padding:24px 28px;border-radius:20px;background:#fff;border:1px solid #e8e3f1;box-shadow:0 12px 35px rgba(26,16,52,.12)}.d1ph-portal-welcome span{font-size:10px;letter-spacing:.16em;font-weight:900;color:#5a3e9a}.d1ph-portal-welcome h2{margin:6px 0;font-size:25px;color:#171327}.d1ph-portal-welcome p{margin:0;color:#6e667d}.d1ph-portal-actions{display:flex;gap:10px;flex-wrap:wrap}.d1ph-portal-actions button{border:0;border-radius:12px;padding:13px 17px;background:linear-gradient(135deg,#5a3e9a,#c04a9a);color:#fff;font-weight:800;cursor:pointer}.d1ph-portal-actions button.is-secondary{background:#f3eff9;color:#5a3e9a;border:1px solid #ddd3ec}.d1ph-portal-metrics>div{position:relative;padding:21px 20px 20px 64px;min-height:84px;box-sizing:border-box}.d1ph-metric-icon{position:absolute;left:18px;top:22px;width:34px;height:34px;border-radius:11px;display:grid;place-items:center;background:#f1eaf8;color:#6b46aa;font-size:19px;font-weight:900}.d1ph-portal-empty{grid-column:1/-1;display:flex;align-items:center;justify-content:center;flex-direction:column;min-height:170px;box-sizing:border-box}.d1ph-portal-empty b{display:grid;place-items:center;width:48px;height:48px;border-radius:15px;background:#f1eaf8;color:#6843a9;font-size:22px}.d1ph-portal-empty h3{margin:14px 0 5px;color:#21183f}.d1ph-portal-empty p{margin:0;max-width:450px;color:#766f85}.d1ph-portal-tabs button{font-size:14px}.d1ph-portal-message-form button:hover,.d1ph-portal-actions button:hover,.d1ph-portal-approvals a:hover{transform:translateY(-1px);box-shadow:0 10px 22px rgba(90,62,154,.2)}
@media(max-width:760px){.d1ph-app-topbar{padding:0 18px}.d1ph-app-secure{display:none}.d1ph-client-portal{margin-top:18px}.d1ph-portal-welcome{align-items:flex-start;flex-direction:column}.d1ph-portal-actions{width:100%}.d1ph-portal-actions button{flex:1}.d1ph-portal-identity{align-items:flex-start}.d1ph-portal-avatar{width:52px;height:52px;border-radius:15px}.d1ph-portal-hero-side{align-items:flex-start}.d1ph-portal-metrics>div{padding-left:58px}}

/* HotFix 6.2.1 — Chat do Portal */
.d1ph-portal-chat{display:flex;flex-direction:column;height:min(680px,calc(100vh - 150px));min-height:520px;overflow:hidden;background:#fff;border:1px solid #e4deed;border-radius:22px;box-shadow:0 16px 40px rgba(38,26,69,.10)}
.d1ph-portal-chat-header{flex:0 0 auto;display:flex;align-items:center;gap:12px;padding:16px 20px;border-bottom:1px solid #ebe6f2;background:#fff}
.d1ph-portal-chat-header>div:nth-child(2){display:flex;flex:1;flex-direction:column;min-width:0}.d1ph-portal-chat-header strong{color:#21183f;font-size:15px}.d1ph-portal-chat-header small{margin-top:2px;color:#80778f;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.d1ph-portal-chat-header>span{display:flex;align-items:center;gap:7px;color:#746b83;font-size:11px;font-weight:700}.d1ph-portal-chat-header>span i{width:8px;height:8px;border-radius:50%;background:#26ad68;box-shadow:0 0 0 4px #e6f7ed}.d1ph-chat-team-avatar,.d1ph-chat-avatar{display:grid;flex:0 0 auto;place-items:center;color:#fff;font-weight:900;text-transform:uppercase;background:linear-gradient(135deg,#5a3e9a,#c04a9a)}.d1ph-chat-team-avatar{width:39px;height:39px;border-radius:12px;font-size:13px}.d1ph-chat-avatar{width:34px;height:34px;margin-top:19px;border-radius:11px;font-size:11px}.d1ph-chat-row.is-client .d1ph-chat-avatar{background:linear-gradient(135deg,#17a4d9,#536bc8)}
.d1ph-portal-conversation{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;display:flex;flex-direction:column;gap:18px;margin:0;padding:24px;background:linear-gradient(180deg,#faf9fc,#f6f3fa)}.d1ph-portal-conversation::-webkit-scrollbar{width:9px}.d1ph-portal-conversation::-webkit-scrollbar-track{background:transparent}.d1ph-portal-conversation::-webkit-scrollbar-thumb{background:#d8d0e4;border:3px solid #f7f5fa;border-radius:10px}.d1ph-chat-row{display:flex;align-items:flex-start;gap:10px;width:100%}.d1ph-chat-row.is-agency{flex-direction:row-reverse}.d1ph-chat-bubble{width:fit-content;max-width:min(74%,680px);padding:12px 15px 8px!important;border:1px solid #e1dbe9!important;border-radius:7px 18px 18px 18px!important;background:#fff!important;box-shadow:0 5px 16px rgba(42,31,69,.05)}.d1ph-chat-row.is-agency .d1ph-chat-bubble{border-color:#d9cdec!important;border-radius:18px 7px 18px 18px!important;background:#eee7f8!important}.d1ph-chat-bubble>header{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:6px}.d1ph-chat-bubble>header strong{color:#34284a;font-size:12px}.d1ph-chat-bubble time{color:#92899e;font-size:10px;white-space:nowrap}.d1ph-chat-message{color:#292236;font-size:14px;line-height:1.55;overflow-wrap:anywhere}.d1ph-chat-message p{margin:0 0 8px}.d1ph-chat-message p:last-child{margin-bottom:0}.d1ph-chat-delivery{display:flex;justify-content:flex-end;align-items:center;gap:4px;margin-top:5px;color:#8b8296;font-size:9px}.d1ph-chat-delivery span{color:#6f4ca7;letter-spacing:-3px;margin-right:3px}.d1ph-chat-row.is-client .d1ph-chat-delivery{display:none}
.d1ph-portal-message-form{position:relative;z-index:2;flex:0 0 auto;display:flex;align-items:flex-end;gap:12px;margin:0!important;padding:14px 16px!important;border:0!important;border-top:1px solid #e5dfec!important;border-radius:0!important;background:#fff!important;box-shadow:0 -8px 22px rgba(42,31,69,.04)!important}.d1ph-portal-message-form textarea{flex:1;min-height:48px;max-height:140px;resize:none;margin:0!important;padding:13px 15px!important;border-color:#ddd5e8!important;background:#f9f7fb;line-height:1.45}.d1ph-portal-message-form textarea:focus{outline:0;border-color:#8b62bd!important;box-shadow:0 0 0 3px rgba(90,62,154,.11)}.d1ph-portal-message-form button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:12px 18px!important}.d1ph-portal-message-form button b{font-size:14px;transform:rotate(-18deg)}
@media(max-width:760px){.d1ph-portal-panel[data-portal-panel="messages"]{padding-left:0;padding-right:0}.d1ph-portal-chat{height:calc(100vh - 112px);min-height:500px;border-radius:17px}.d1ph-portal-chat-header{padding:13px 14px}.d1ph-portal-chat-header>span{display:none}.d1ph-portal-conversation{gap:15px;padding:17px 12px}.d1ph-chat-avatar{width:30px;height:30px;margin-top:17px;border-radius:10px;font-size:10px}.d1ph-chat-row{gap:7px}.d1ph-chat-bubble{max-width:calc(100% - 48px);padding:10px 12px 7px!important}.d1ph-chat-bubble>header{align-items:flex-start;flex-direction:column;gap:1px;margin-bottom:5px}.d1ph-chat-message{font-size:13px}.d1ph-portal-message-form{gap:8px;padding:10px!important}.d1ph-portal-message-form button{width:48px;min-width:48px;padding:0!important}.d1ph-portal-message-form button span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.d1ph-portal-message-form button b{font-size:17px}}
@media(max-width:420px){.d1ph-portal-chat{height:calc(100dvh - 92px);min-height:460px}.d1ph-chat-row .d1ph-chat-avatar{display:none}.d1ph-chat-bubble{max-width:88%}}

/* 6.3.0-alpha.3 — AJAX e emojis no Portal */
.d1ph-chat-input{display:flex;flex:1;min-width:0;flex-direction:column;border:1px solid #ddd5e8;border-radius:13px;background:#f9f7fb;overflow:hidden}.d1ph-chat-input:focus-within{border-color:#8b62bd;box-shadow:0 0 0 3px rgba(90,62,154,.11)}.d1ph-chat-input .d1ph-chat-emojis{display:flex;gap:2px;padding:5px 8px 0}.d1ph-portal-message-form .d1ph-chat-emojis button{width:28px;min-width:28px;height:25px;min-height:25px;padding:0!important;border:0;border-radius:7px;background:transparent;color:inherit;box-shadow:none;cursor:pointer;font-size:15px;line-height:1}.d1ph-chat-emojis button:hover,.d1ph-chat-emojis button:focus{background:#eee7f6!important;outline:0}.d1ph-chat-input textarea{width:100%;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}.d1ph-portal-message-form.is-busy{opacity:.72;pointer-events:none}.d1ph-portal-chat-feedback{position:absolute;right:16px;bottom:74px;padding:5px 9px;border-radius:8px;background:#eaf8ef;color:#247142;font-size:10px;box-shadow:0 4px 13px rgba(24,69,39,.08)}.d1ph-portal-chat-feedback:empty{display:none}.d1ph-portal-chat-feedback.is-error{background:#fff0f0;color:#a62e2e}
.d1ph-chat-delivery.is-read,.d1ph-chat-delivery.is-read span{color:#1688c2}.d1ph-chat-delivery time{margin-left:3px;color:#8b8298}
.d1ph-app-brand img{display:block;width:auto;max-width:190px;max-height:44px;object-fit:contain}.d1ph-app-brand:has(img) small{padding-left:8px;border-left:1px solid rgba(255,255,255,.18)}

/* 6.3.0-alpha.9 — Anexos no Chat */
.d1ph-chat-tools{display:flex;align-items:center;justify-content:space-between;padding-right:8px}.d1ph-chat-attach{display:grid;width:30px;height:28px;place-items:center;border-radius:8px;color:#655676;cursor:pointer;font-size:16px}.d1ph-chat-attach:hover,.d1ph-chat-attach:focus-within{background:#eee7f6}.d1ph-chat-attach input{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0}.d1ph-chat-file-list{display:flex;gap:5px;flex-wrap:wrap;padding:6px 9px 0}.d1ph-chat-file-list span{display:inline-flex;align-items:center;gap:5px;max-width:220px;padding:5px 8px;border-radius:8px;background:#ece6f4;color:#514260;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.d1ph-chat-file-list small{color:#897b96}.d1ph-chat-attachments{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px;padding-top:9px;border-top:1px solid rgba(80,60,110,.12)}.d1ph-chat-attachments a{display:inline-flex;align-items:center;gap:5px;max-width:240px;padding:6px 9px;border-radius:8px;background:rgba(255,255,255,.68);color:#57417a;text-decoration:none;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.d1ph-chat-attachments a:hover{text-decoration:underline}
.d1ph-chat-input{position:relative}.d1ph-chat-drop-hint{position:absolute;z-index:5;inset:0;display:none;align-items:center;justify-content:center;gap:8px;border:2px dashed #7653aa;border-radius:12px;background:rgba(247,243,251,.96);color:#5a3e9a;font-size:13px;font-weight:800;pointer-events:none}.d1ph-chat-drop-hint span{font-size:23px}.d1ph-chat-input.is-dragging .d1ph-chat-drop-hint{display:flex}
.d1ph-portal-toast{position:fixed;z-index:1000;right:22px;bottom:22px;display:flex;align-items:center;gap:12px;min-width:290px;padding:14px 17px;border:0;border-radius:15px;background:linear-gradient(135deg,#21183f,#5a3e9a);color:#fff;box-shadow:0 18px 48px rgba(24,16,49,.32);cursor:pointer;text-align:left;opacity:0;visibility:hidden;transform:translateY(16px);transition:.22s ease}.d1ph-portal-toast.is-visible{opacity:1;visibility:visible;transform:translateY(0)}.d1ph-portal-toast>b{display:grid;width:36px;height:36px;place-items:center;border-radius:11px;background:rgba(255,255,255,.13);font-size:18px}.d1ph-portal-toast strong,.d1ph-portal-toast small{display:block;color:#fff}.d1ph-portal-toast small{margin-top:3px;opacity:.72}@media(max-width:600px){.d1ph-portal-toast{right:12px;bottom:12px;left:12px;min-width:0}}
.d1ph-portal-alert.is-error{background:#fff0f0;color:#a62e2e;border:1px solid #f2caca}
