/* A single, consistent detail surface on phone and desktop. */
dialog.customer-detail-sheet{--detail-pink:#bf3565;--detail-purple:#6651b9;--detail-muted:#8c7d87;width:min(680px,calc(100vw - 48px));height:82dvh;max-height:880px;margin:auto;padding:16px 26px 28px;border:1px solid #eee5ec;border-radius:28px;background:#fffbfe;color:#302830;box-shadow:0 24px 90px #34243130;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#dcd0da transparent;scroll-padding-top:92px}
.customer-detail-sheet::backdrop{background:#33243266;backdrop-filter:blur(3px)}
.customer-detail-sheet::before{content:'';display:block;width:38px;height:4px;margin:0 auto 13px;border-radius:3px;background:#e0d8df}
.customer-detail-sheet .modal-head{position:sticky;top:-16px;z-index:5;display:flex;align-items:center;justify-content:space-between;margin:0 -2px 24px;padding:14px 2px 16px;background:#fffbfef5;backdrop-filter:blur(14px);border:0}
.customer-detail-sheet .modal-head h2{font-size:21px;font-weight:700;letter-spacing:.02em;line-height:1.4;margin:0}.customer-detail-sheet .modal-head button{width:40px;height:40px;min-height:40px;padding:0;border:0;border-radius:50%;background:#f3edf2;color:#7a6c78;font-weight:400;font-size:26px;display:grid;place-items:center}
.detail-icon{width:19px;height:19px;flex:none;vertical-align:middle}
.detail-identity{display:flex;align-items:center;gap:15px;margin:0 0 25px}.detail-avatar{width:54px;height:54px;flex:none;border-radius:50%;background:#f1ecf0;border:1px solid #e5dce3;color:#6b5b67;display:grid;place-items:center;font-size:24px;font-weight:650;position:relative}.detail-avatar.female{background:#fcecf2;border-color:#f6cadb;color:#be3564}.detail-avatar i{position:absolute;right:-1px;bottom:0;width:13px;height:13px;background:#3ea875;border:2.5px solid #fffbfe;border-radius:50%}.detail-avatar i.overdue{background:#df4175}.detail-identity>div:last-child{min-width:0}.detail-identity h3{font-size:21px;line-height:1.55;margin:0 0 5px;letter-spacing:.015em}.detail-identity small{font-size:14px;font-weight:400;color:var(--detail-muted);margin-left:5px;white-space:nowrap}.detail-identity p{font-size:12px;color:var(--detail-muted);line-height:1.8;margin:0;overflow-wrap:anywhere}
.detail-advice{background:#fbedf3;border:1px solid #f2dfe8;border-left:4px solid #d94276;border-radius:20px;padding:19px 18px 17px;margin-bottom:20px}.detail-advice>div{display:flex;align-items:center;justify-content:space-between;gap:12px}.detail-advice b{display:flex;align-items:center;gap:8px;color:var(--detail-pink);font-size:15px;font-weight:650}.detail-advice span{font-size:11px;border-radius:20px;background:#f4edf2;color:#8d7c87;padding:5px 9px;max-width:55%;text-align:right}.detail-advice p{font-size:15px;color:#766471;line-height:1.9;margin:14px 0 15px}.detail-advice button{display:inline-flex;align-items:center;gap:8px;border-radius:24px;padding:10px 14px;min-height:40px;background:var(--detail-pink);color:#fff;border:0;font-size:13px;box-shadow:0 6px 15px #bd35651c}.detail-advice button .detail-icon{width:15px;height:15px}.detail-advice small{display:block;margin-top:11px;font-size:10px;color:#a18a98}
.customer-detail-sheet .detail-facts{background:#fffbfe;border:1px solid #eae2e9;border-radius:20px;padding:0;margin:0 0 27px;white-space:normal;box-shadow:0 3px 10px #39203104;overflow:hidden}.detail-phone{display:flex;align-items:center;gap:10px;padding:17px 16px 4px;font-size:13px}.detail-phone>span{color:var(--detail-muted);width:53px;flex:none}.detail-phone b{font-size:17px;font-weight:650;letter-spacing:.055em;flex:1;font-variant-numeric:tabular-nums}.detail-phone button{display:grid;place-items:center;width:36px;min-height:36px;padding:6px;background:transparent;color:#94818e;border:0;border-radius:50%}.detail-phone .detail-icon{width:21px;height:21px}.detail-facts>.detail-hint{padding:0 16px;margin:4px 0 12px;font-size:12px}.detail-hint{font-size:12px;color:#a08e9b;line-height:1.8;margin:8px 0 13px}.detail-facts dl{margin:0}.detail-facts dl>div{display:grid;grid-template-columns:63px minmax(0,1fr);gap:10px;padding:14px 16px;border-top:1px solid #eee8ed;font-size:14px;line-height:1.8}.detail-facts dt{color:var(--detail-muted);font-size:12px;align-self:start;padding-top:2px}.detail-facts dd{margin:0;overflow-wrap:anywhere;white-space:pre-wrap;color:#544751}.detail-privacy{border-top:1px solid #eee8ed;padding:12px 16px;margin:0;font-size:11px;color:#a08e9b;line-height:1.8}.detail-privacy p{margin:8px 0 0}.detail-privacy summary,.detail-ai-hint summary,.detail-more summary{cursor:pointer;list-style:none}.detail-privacy summary:after,.detail-ai-hint summary:after,.detail-more summary:after{content:'⌄';float:right;margin-left:8px}.detail-privacy[open] summary:after,.detail-ai-hint[open] summary:after,.detail-more[open] summary:after{transform:rotate(180deg)}.customer-detail-sheet summary::-webkit-details-marker{display:none}
.detail-section-title{font-size:18px;font-weight:650;margin:0 0 15px;letter-spacing:.025em}.detail-section-title small{font-size:13px;color:#9e8e99;font-weight:400;margin-left:8px}.detail-follow{border:0;padding:0;background:transparent}.detail-follow>.detail-hint:first-child{margin:0;border:1px solid #ebe3ea;border-bottom:0;border-radius:19px 19px 0 0;padding:15px 15px 0;background:#fffbfe;font-size:12px}.detail-selects{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:10px;padding:9px 15px 15px;border:1px solid #ebe3ea;border-top:0;border-radius:0 0 19px 19px;box-shadow:0 3px 10px #39203104}.detail-selects label{margin:0;color:#8f7f8b;font-size:11px;line-height:1.9}.detail-selects select{font-size:13px;padding:9px 26px 9px 10px;background-color:#fffbfe;border:1px solid #e5dde5;border-radius:12px;min-width:0;min-height:43px;width:100%;color:#594b57}
.detail-timeline{margin:23px 5px 23px 7px}.detail-timeline article{border-left:1px solid #ecd7e2;padding:0 0 20px 16px;position:relative}.detail-timeline article:last-child{padding-bottom:0;border-color:transparent}.detail-timeline article:before{content:'';position:absolute;left:-4px;top:5px;width:7px;height:7px;border-radius:50%;background:#dd4379;box-shadow:0 0 0 4px #fbeaf2}.detail-timeline time{font-size:12px;color:#947f8c;font-weight:600}.detail-timeline p{font-size:14px;line-height:1.9;margin:7px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;color:#75616f}.detail-note{display:flex;gap:8px;align-items:stretch}.detail-note textarea{min-height:46px;height:48px;flex:1;min-width:0;font-size:14px;line-height:1.6;padding:11px 13px;border:1px solid #e4dce4;background:#fffbfe;border-radius:15px;resize:vertical;margin:0}.detail-note textarea::placeholder{color:#a28e9c}.detail-note textarea:focus{min-height:84px}.detail-note button{padding:10px 17px;border-radius:24px;font-size:14px;flex:none;background:var(--detail-pink);box-shadow:0 6px 15px #bd35651c;min-width:62px;border:0}.detail-follow .detail-ai{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;border:1px solid #d5ccef;background:#f0ecfa;color:var(--detail-purple);border-radius:26px;min-height:46px;font-size:14px;font-weight:600;margin:12px 0 0;padding:10px 8px}.detail-ai-hint{font-size:10px;margin:8px 3px 19px}.detail-ai-hint p{margin:6px 0 0}.detail-date{display:flex;align-items:flex-end;gap:9px}.detail-date label{flex:1;min-width:0;margin:0;font-size:12px;color:#8d7b88}.detail-date input{min-width:0;width:100%;font-size:14px;background:#fffbfe;min-height:43px;border-radius:22px;border:1px solid #e5dde5;padding:9px 13px;color:#70606b}.detail-date button{min-height:43px;background:#f3edf2;color:#84717f;padding:9px 14px;border:0;border-radius:22px;font-size:12px}.detail-follow>.detail-hint:last-child{font-size:11px;margin:10px 0 0}
.detail-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:23px 0 16px}.detail-actions button,.detail-actions .button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:47px;border:1px solid #d5ccef;border-radius:25px;padding:12px 8px;background:#f0ecfa;color:var(--detail-purple);font-size:14px;font-weight:600;line-height:1.35;text-decoration:none;margin:0;white-space:nowrap}.detail-actions .detail-call{background:var(--detail-pink);color:#fff;border-color:var(--detail-pink);box-shadow:0 6px 16px #bd35651c}.detail-actions button.neutral{background:#f3edf2;color:#7a6674;border-color:transparent}.detail-more{border-top:1px solid #eee6ed;padding-top:13px;font-size:12px;color:#a18b9a}.detail-more summary{padding:3px 5px}.detail-extra{margin:13px 0}.detail-footer{display:flex;justify-content:space-between;gap:12px;margin-top:12px;padding-top:7px}.detail-footer button{background:transparent;border:0;color:#a18496;padding:10px 5px;font-size:12px;min-height:40px}.detail-footer button.danger{color:#c65b7c}.customer-detail-sheet button{transition:background .15s,box-shadow .15s}.customer-detail-sheet button:active{filter:brightness(.97)}.customer-detail-sheet button:focus-visible,.customer-detail-sheet summary:focus-visible{outline:2px solid #a786cb;outline-offset:3px}.detail-follow :disabled{opacity:.55}
@media(max-width:760px){dialog.customer-detail-sheet{position:fixed;inset:auto 0 0;width:100%;height:80dvh;max-height:calc(100dvh - 28px);margin:0;border:0;border-radius:26px 26px 0 0;padding:12px 18px calc(23px + env(safe-area-inset-bottom));box-shadow:0 -14px 65px #34243124}.customer-detail-sheet .modal-head{top:-12px;padding-top:13px;padding-bottom:14px;margin-bottom:22px}.detail-actions .detail-icon{width:17px;height:17px}}
@media(min-width:761px){.detail-identity{gap:18px}.detail-identity h3{font-size:24px}.detail-identity p{font-size:13px}.detail-facts dl>div{padding:14px 19px;grid-template-columns:90px 1fr}.detail-actions{grid-template-columns:repeat(3,minmax(0,1fr))}.detail-follow .detail-note textarea{height:60px}.detail-actions button:hover{background:#e9e1f8}.detail-actions .detail-call:hover{background:#af2858}}
@media(max-width:360px){dialog.customer-detail-sheet{padding-left:15px;padding-right:15px}.detail-identity{gap:11px}.detail-identity h3{font-size:19px}.detail-identity small{font-size:12px}.detail-actions button,.detail-actions .button{font-size:12px;gap:5px}.detail-selects{padding-left:11px;padding-right:11px;gap:8px}.detail-selects select{font-size:12px;padding-left:7px}.detail-phone b{font-size:15px}}
@media(prefers-reduced-motion:reduce){.customer-detail-sheet button{transition:none}}

.detail-tidy-sheet{color:#282329}.tidy-intro{font-size:17px;line-height:1.8;margin:12px 0 20px}.tidy-voice{padding:18px;border:1px solid #d0c8ef;background:#f0edf8;border-radius:12px;color:#716671;line-height:1.8;margin-bottom:16px}.detail-tidy-sheet textarea{display:block;box-sizing:border-box;width:100%;min-height:210px;padding:16px;border:1px solid #e6dfe5;border-radius:18px;background:#fdfbfc;font:inherit;line-height:1.8;resize:vertical}.detail-tidy-sheet .detail-ai{width:100%;margin-top:18px;justify-content:center}.tidy-privacy{color:#584cc2;font-size:14px;line-height:1.7}.tidy-privacy svg{width:18px;height:18px;vertical-align:middle}#tidy-error{color:#b93160;line-height:1.7}#tidy-result button{width:100%;margin-top:12px}#tidy-result p{font-size:14px;color:#827480}#tidy-back{width:100%;margin-top:12px}

.customer-detail-sheet #follow-form select,.customer-detail-sheet #follow-form input,.customer-detail-sheet #follow-form textarea{box-sizing:border-box;min-height:46px;border:1px solid #e4dce4;border-radius:16px;background:#fffbfe;color:#70606b;font-size:16px;line-height:1.5;padding:10px 13px;box-shadow:none}.customer-detail-sheet #follow-form select{width:100%;height:46px;padding-right:30px}.customer-detail-sheet .detail-selects label{min-width:0}.customer-detail-sheet .detail-note textarea{height:46px;min-height:46px}.customer-detail-sheet .detail-note textarea:focus{min-height:84px}.customer-detail-sheet .detail-date{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px}.customer-detail-sheet .detail-date label{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px;width:100%;min-width:0}.customer-detail-sheet .detail-date input[type=date]{display:block;width:100%;min-width:0;height:46px;max-width:100%;-webkit-appearance:none;appearance:none}.customer-detail-sheet .detail-date input::-webkit-date-and-time-value{text-align:left;min-height:24px}.customer-detail-sheet .detail-date button{min-height:46px;margin:0}.customer-detail-sheet #follow-form select:focus,.customer-detail-sheet #follow-form input:focus,.customer-detail-sheet #follow-form textarea:focus{outline:2px solid #b5a3df;outline-offset:2px}@media(max-width:360px){.customer-detail-sheet .detail-date label{grid-template-columns:1fr;gap:6px}}

.customer-detail-sheet .detail-advice{border-radius:24px;padding:18px;border:1px solid #eee3df;border-left:4px solid #bd791b;margin:16px 0;background:#fbefdc}.customer-detail-sheet .detail-advice>div>b{display:flex;gap:8px;align-items:center;color:#945d14}.customer-detail-sheet .detail-advice>div>span{border-radius:22px;background:#f5edf1;padding:6px 10px;color:#877680;font-size:13px}.customer-detail-sheet .detail-advice p{font-size:16px;line-height:1.8;margin:12px 0;color:#6d5b67}.customer-detail-sheet .detail-advice button,.customer-detail-sheet .detail-advice a.button{display:inline-flex;border-radius:24px;padding:10px 16px;background:#bf3566;color:white;font-size:14px;width:auto;text-decoration:none}.customer-detail-sheet .detail-advice-pink{background:#faedf2;border-left-color:#e43d76}.customer-detail-sheet .detail-advice-pink>div>b{color:#bc2e60}.customer-detail-sheet .detail-advice-green{background:#eaf3df;border-left-color:#19915b}.customer-detail-sheet .detail-advice-green>div>b{color:#19915b}.customer-detail-sheet .detail-advice-green button{background:#f3edf1;color:#73606c}

/* Stable detail scrolling: one vertical surface, an opaque stationary heading. */
html:has(dialog.customer-detail-sheet[open]),body:has(dialog.customer-detail-sheet[open]){overflow:hidden;overscroll-behavior:none}
dialog.customer-detail-sheet{box-sizing:border-box;overflow-y:auto;overflow-x:hidden;overscroll-behavior:none;touch-action:pan-y;scroll-behavior:auto;scrollbar-gutter:stable;height:82svh;max-height:880px}
.customer-detail-sheet #modal-content{min-width:0;overflow-wrap:anywhere}
.customer-detail-sheet .modal-head{background:#fffbfe;backdrop-filter:none;isolation:isolate;box-shadow:0 8px 0 #fffbfe}
.customer-detail-sheet .detail-selects{grid-template-columns:minmax(0,1fr);padding:14px;border:1px solid #ebe3ea;border-radius:20px;gap:10px}
.customer-detail-sheet .detail-selects label:first-child{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);align-items:center;gap:12px;font-size:13px}
.customer-detail-sheet .detail-selects label:first-child span{line-height:1.7}
.customer-detail-sheet .detail-note textarea,.customer-detail-sheet .detail-note textarea:focus{height:54px;min-height:54px;resize:none;overflow-y:auto}
.customer-detail-sheet .detail-note button{min-height:54px}
.customer-detail-sheet .detail-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:22px}
.customer-detail-sheet .detail-actions button,.customer-detail-sheet .detail-actions .button{min-height:48px;white-space:normal;text-align:center}
.customer-detail-sheet .detail-section-title{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px;line-height:1.6}
.customer-detail-sheet .detail-section-title small{margin-left:0}
.customer-detail-sheet .detail-date{margin-top:16px}
.customer-detail-sheet .detail-footer button{padding:10px 14px;border-radius:24px;background:#f3edf2}
@media(max-width:760px){dialog.customer-detail-sheet{height:86svh;max-height:calc(100svh - 20px);width:100%;max-width:100%;scrollbar-gutter:auto;padding:12px 18px calc(24px + env(safe-area-inset-bottom))}.customer-detail-sheet .modal-head{top:-12px;margin:0 -18px 20px;padding:12px 18px 14px}.customer-detail-sheet .detail-identity small{white-space:normal}}
@media(max-width:360px){.customer-detail-sheet .detail-selects label:first-child{grid-template-columns:1fr;gap:6px}}

.detail-client-photo{margin:16px 0 20px;text-align:center}.detail-client-photo img{display:block;max-width:100%;max-height:320px;object-fit:contain;border-radius:18px;margin:auto}.detail-client-photo figcaption{font-size:12px;color:#8c7d87;margin-top:8px}

.customer-detail-sheet .detail-profile-group{margin-top:20px;min-width:0}.customer-detail-sheet .detail-profile-group h4{font-size:16px;color:#b93160;margin:0;padding:12px 16px;background:#fff0f5;border-radius:12px}.customer-detail-sheet .detail-profile-group dl{margin:4px 0 0}.customer-detail-sheet .detail-profile-group dl>div{display:grid;grid-template-columns:110px minmax(0,1fr);gap:14px;padding:13px 16px;align-items:start}.customer-detail-sheet .detail-profile-group dt{font-size:13px;line-height:1.7}.customer-detail-sheet .detail-profile-group dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7;font-size:15px}.customer-detail-sheet .detail-unfilled{color:#a594a0}@media(max-width:380px){.customer-detail-sheet .detail-profile-group dl>div{grid-template-columns:88px minmax(0,1fr);gap:10px;padding:12px 8px}}
