.doctor-app { background:#f7f5fa; }
.doctor-app .office-header { background:#fff; padding:18px max(24px,calc((100vw - 1320px)/2)); }
.doctor-app .office-brand { font-size:20px; letter-spacing:-.5px; }
.doctor-app .office-brand span { margin-top:3px; }
.doctor-app .office-container { max-width:1320px; padding-top:34px; }
.doctor-app .page-heading { margin-bottom:24px; }
.doctor-app .page-heading h1 { font-size:34px; font-weight:750; }
.doctor-app .page-heading .eyebrow { display:none; }
.doctor-app .page-heading p { max-width:620px; font-size:14px; }
.doctor-app .stats { display:flex; flex-wrap:wrap; gap:12px 32px; padding:0 0 26px; border-bottom:1px solid var(--line); }
.doctor-app .stat { display:flex; align-items:baseline; gap:9px; padding:0; background:none; border:0; border-radius:0; }
.doctor-app .stat strong { font-size:25px; font-weight:750; }
.doctor-app .stat span { font-size:12px; font-weight:600; }
.doctor-app .stat.is-alert strong { color:#a34e3c; }
.inbox-layout { display:grid; grid-template-columns:210px minmax(0,1fr); gap:26px; align-items:start; }
.inbox-sidebar { position:sticky; top:20px; }
.sidebar-label { display:block; font-size:10px; font-weight:800; color:var(--muted); letter-spacing:1.2px; padding:9px 13px 13px; }
#folder-list { display:grid; gap:5px; }
#folder-list button { width:100%; display:flex; align-items:center; gap:11px; min-height:47px; padding:11px 13px; border:1px solid transparent; background:transparent; text-align:left; border-radius:13px; color:#51465f; font-size:13px; font-weight:650; transition:background .15s,transform .15s; }
#folder-list button[aria-current] { background:#eae1f4; color:#67468e; }
#folder-list button:hover { background:#eee8f4; }
#folder-list button:active { transform:scale(.98); }
.folder-dot { width:9px; height:9px; border-radius:3px; background:#ad9abd; flex:none; }
.folder-dot[data-kind=new] { background:#9980c1; }
.folder-dot[data-kind=urgent] { background:#c47a5e; }
.folder-dot[data-kind=working] { background:#7c9d92; }
.folder-dot[data-kind=payment] { background:#b79c63; }
.folder-dot[data-kind=archive] { background:#b5afb9; }
.folder-count { margin-left:auto; font-size:12px; font-variant-numeric:tabular-nums; opacity:.8; }
.sidebar-form-link { display:block; margin:24px 13px 10px; font-size:12px; font-weight:700; text-decoration:none; }
.sidebar-help { font-size:11px; line-height:1.7; margin:0 13px; color:#8a8194; }
.inbox-main { min-width:0; }
.doctor-app .list-toolbar { gap:9px; }
.doctor-app .list-toolbar input,.doctor-app .list-toolbar select { min-height:44px; font-size:13px; background:#fff; border-color:#e2dbe9; border-radius:12px; }
.doctor-app .filter-label { width:170px; }
.doctor-app .list-toolbar .button { min-height:44px; padding:9px 15px; font-size:12px; }
.doctor-app .request-grid { display:grid; grid-template-columns:1fr; gap:9px; }
.doctor-app .request-card { display:grid; grid-template-columns:42px minmax(150px,1fr) minmax(120px,.75fr) 95px; gap:16px; min-height:125px; align-items:center; padding:21px; border:1px solid #e8e1ee; border-radius:18px; box-shadow:0 2px 8px #36244403; }
.doctor-app .request-card:hover { border-color:#b5a0cb; box-shadow:0 5px 18px #36244409; }
.doctor-app .request-card:active { transform:scale(.995); }
.doctor-app .request-card.is-urgent { border-left:3px solid #cf947a; padding-left:19px; }
.client-avatar { display:grid; place-items:center; width:42px; height:46px; border-radius:15px; background:#eee8f6; color:#7d5da1; font-size:19px; font-weight:700; }
.is-urgent .client-avatar { background:#f9e9df; color:#a86d50; }
.request-identity,.request-state,.request-payment { display:flex; flex-direction:column; align-items:flex-start; gap:5px; min-width:0; }
.request-identity strong { font-size:15px; color:#342c43; overflow-wrap:anywhere; }
.request-identity>span { color:var(--muted); font-size:12px; }
.request-identity .request-origin { font-size:10px; color:#908697; }
.request-state { gap:7px; }
.request-deadline,.request-state .deadline-warning { font-size:10px; line-height:1.5; }
.request-deadline { color:#82768d; }
.urgent-label { color:#a45e42; font-size:10px; font-weight:700; }
.request-payment { text-align:right; align-items:flex-end; }
.request-payment strong { font-size:16px; font-weight:700; white-space:nowrap; }
.request-payment>span { font-size:11px; color:var(--muted); }
.request-payment .payment-paid { color:#4a7f69; }
.doctor-app #list-summary { font-size:11px; padding:2px 1px; margin-bottom:11px; }
.doctor-app .empty-state { background:#fff; border:1px dashed #dcd1e6; border-radius:20px; }
.doctor-app dialog { box-shadow:0 24px 80px #29203430; }
.doctor-app dialog::backdrop { background:#28213055; backdrop-filter:blur(3px); }
@media(max-width:1000px) {
  .inbox-layout { grid-template-columns:180px minmax(0,1fr); gap:17px; }
  .doctor-app .request-card { grid-template-columns:36px minmax(0,1fr) 95px; gap:12px; }
  .request-state { grid-column:2; grid-row:2; flex-direction:row; flex-wrap:wrap; align-items:center; }
  .request-payment { grid-column:3; grid-row:1 / 3; }
  .client-avatar { width:36px; height:40px; font-size:16px; }
}
@media(max-width:680px) {
  .doctor-app .office-header { padding:16px 18px; }
  .doctor-app .office-container { padding:25px 16px 45px; }
  .doctor-app .page-heading h1 { font-size:29px; }
  .doctor-app .page-heading { display:flex; flex-direction:row; align-items:center; gap:12px; margin-bottom:20px; }
  .doctor-app .page-heading h1 { font-size:25px; }
  .doctor-app .page-heading p { display:none; }
  .doctor-app .page-heading>.button { width:auto; padding:9px 12px; min-height:41px; font-size:11px; margin:0; flex-shrink:0; }
  .doctor-app .stats { display:none; }
  .doctor-app .stat strong { font-size:22px; }
  .doctor-app .stat span { font-size:10px; }
  .inbox-layout { display:block; }
  .inbox-sidebar { position:static; margin-bottom:22px; }
  .sidebar-label,.sidebar-help,.sidebar-form-link { display:none; }
  #folder-list { display:flex; flex-wrap:wrap; gap:7px; }
  #folder-list button { width:auto; min-height:40px; padding:8px 12px; font-size:12px; background:#fff; border-color:#e8e1ee; border-radius:12px; gap:8px; }
  .folder-dot { display:none; }
  .folder-count { font-size:10px; }
  .doctor-app .filter-label { width:auto; }
  .doctor-app .request-card { padding:16px; gap:10px; border-radius:17px; grid-template-columns:32px minmax(0,1fr) 76px; }
  .doctor-app .request-card.is-urgent { padding-left:14px; }
  .client-avatar { width:32px; height:36px; border-radius:12px; }
  .request-identity strong { font-size:14px; }
  .request-identity>span { font-size:12px; }
  .request-identity .request-origin { font-size:10px; }
  .request-payment strong { font-size:14px; }
  .request-payment>span { font-size:10px; }
  .request-state { grid-column:2 / -1; }
  .request-payment { grid-row:1; }
  .request-state .badge { font-size:10px; }
}

/* Scrollbars stay inside the rounded card. Background does not scroll. */
body:has(dialog[open]) { overflow:hidden; }
.doctor-app dialog { scrollbar-width:thin; scrollbar-color:#b8a8c9 transparent; clip-path:inset(0 round 24px); overscroll-behavior:contain; }
.doctor-app dialog::-webkit-scrollbar { width:6px; }
.doctor-app dialog::-webkit-scrollbar-track { background:transparent; margin:22px 0; }
.doctor-app dialog::-webkit-scrollbar-thumb { background:#b8a8c9; border-radius:10px; }
.doctor-app dialog::-webkit-scrollbar-button { display:none; }
#folder-form { display:flex; gap:6px; margin-top:16px; }
#folder-form input { min-width:0; width:100%; font-size:12px; }
#folder-form button { padding:8px 12px; font-size:12px; }
.demo-messages { display:grid; gap:12px; margin:20px 0; }
.demo-bubble { max-width:90%; padding:14px 16px; border-radius:18px 18px 18px 4px; background:#f1ecf6; }
.demo-bubble.from-doctor { justify-self:end; background:#eaf1ed; border-radius:18px 18px 4px 18px; }
.demo-bubble strong,.demo-bubble small { font-size:11px; color:var(--muted); }
.demo-bubble p { margin:5px 0; white-space:pre-wrap; overflow-wrap:anywhere; }
#demo-reply textarea { width:100%; padding:12px; border:1px solid var(--line); border-radius:14px; resize:vertical; }
#demo-incoming { margin-top:18px; }
/* Messenger-first demo: folders, conversations, active thread. */
.chat-preview .office-container { max-width:1600px; padding:22px 20px; }
.chat-preview .page-heading { margin-bottom:18px; }
.chat-preview .page-heading h1 { font-size:26px; }
.chat-preview .page-heading p,.chat-preview #stats,.chat-preview .sidebar-help { display:none; }
.chat-preview .inbox-layout { grid-template-columns:185px 320px minmax(0,1fr); gap:16px; height:calc(100dvh - 225px); min-height:460px; }
.chat-preview .inbox-sidebar,.chat-preview .inbox-main { overflow:auto; height:100%; scrollbar-width:thin; }
.chat-preview .list-toolbar { flex-wrap:wrap; }
.chat-preview .search-label { flex-basis:100%; }
.chat-preview .filter-label { flex:1; }
.chat-preview .request-card { grid-template-columns:34px minmax(0,1fr); padding:14px; gap:10px; min-height:110px; border-radius:14px; }
.chat-preview .request-state { grid-column:2; grid-row:auto; flex-direction:row; flex-wrap:wrap; }
.chat-preview .request-payment { display:none; }
.chat-preview .request-identity strong { font-size:14px; }
.chat-preview .request-origin { font-size:10px; }
.chat-preview .chat-selected { background:#eee6f7; border-color:#a58bbb; }
.conversation-panel { display:flex; flex-direction:column; min-height:0; overflow:hidden; background:#fff; border:1px solid #e5dced; border-radius:22px; }
.conversation-empty { margin:auto; padding:30px; text-align:center; color:#80738e; }
.conversation-empty p { font-size:14px; }
.conversation-empty small { font-size:11px; }
.conversation-header { display:flex; align-items:center; gap:12px; padding:20px; border-bottom:1px solid #eee8f2; }
.conversation-header>div { flex:1; min-width:0; }
.conversation-header h2 { font-size:19px; margin:0 0 4px; overflow-wrap:anywhere; }
.conversation-header span { color:#81748d; font-size:11px; }
.conversation-header .button { min-height:38px; padding:8px 14px; font-size:12px; }
#chat-back { display:none; }
.conversation-demo { background:#faf7fc; color:#887591; padding:9px 18px; font-size:11px; }
.conversation-messages { flex:1; min-height:0; overflow:auto; padding:22px; display:flex; flex-direction:column; gap:16px; scrollbar-width:thin; }
.conversation-messages .demo-bubble { align-self:flex-start; }
.conversation-messages .from-doctor { align-self:flex-end; }
.conversation-compose { padding:14px 18px; border-top:1px solid #eee8f2; }
.conversation-compose #demo-incoming { margin:0 0 12px; font-size:11px; }
#chat-reply { display:flex; align-items:flex-end; gap:10px; }
#chat-text { flex:1; min-width:0; resize:none; border:1px solid #e5dced; background:#faf8fc; border-radius:16px; padding:12px; font-size:14px; }
#chat-reply .button { padding:10px 16px; font-size:12px; }
@media(max-width:1100px) and (min-width:761px){.chat-preview .inbox-layout{grid-template-columns:155px 260px minmax(0,1fr);gap:10px}.conversation-header{padding:14px}.chat-preview .office-container{padding:16px 10px}}
@media(max-width:760px){
 .chat-preview .inbox-layout{display:block;height:auto;min-height:0}
 .chat-preview .inbox-sidebar,.chat-preview .inbox-main{height:auto;overflow:visible}
 .chat-preview .conversation-panel{display:none}
 .chat-preview.conversation-open .conversation-panel{display:flex;position:fixed;inset:0;z-index:12;border:0;border-radius:0;height:100dvh}
 .conversation-open{overflow:hidden}
 .conversation-header{padding:16px 12px}.conversation-header h2{font-size:17px}
 #chat-back{display:block;font-size:12px;white-space:nowrap}
 .conversation-messages{padding:16px}.conversation-compose{padding-bottom:max(14px,env(safe-area-inset-bottom))}
}

.review-moderation{max-width:800px;margin:0 0 20px}.review-body{white-space:pre-wrap;overflow-wrap:anywhere}
.conversation-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:12px 18px;border-bottom:1px solid #eee8f2}
.conversation-actions>.small-text{margin:0}.conversation-actions .button{min-height:38px;padding:8px 14px;font-size:12px}
.chat-folder-label{display:flex;align-items:center;gap:8px;font-size:12px}.chat-folder-label select{max-width:170px;padding:8px;border:1px solid #e5dced;border-radius:12px;background:#faf8fc;font:inherit}
.conversation-actions>[role=status]:empty{display:none}.conversation-actions>[role=status]{flex-basis:100%}
#journey-dialog{max-width:540px;width:calc(100% - 32px)}
.private-chat-layout{display:grid;grid-template-columns:300px minmax(0,1fr);gap:20px;min-height:520px;height:calc(100dvh - 240px)}
.private-chat-list,.private-thread{border:1px solid var(--line);border-radius:22px;background:white;min-height:0;overflow:auto;scrollbar-width:thin}
.private-chat-list{padding:18px}.private-thread{display:flex;flex-direction:column;overflow:hidden}
.private-chat-row{display:block;width:100%;text-align:left;border:1px solid transparent;border-radius:14px;background:white;padding:16px;margin:8px 0;color:inherit}
.private-chat-row span{display:block;font-size:12px;color:var(--muted);margin-top:5px}.private-chat-row[aria-current]{background:var(--lavender);border-color:#baa5d0}
.private-chat-tools{padding:12px 20px;border-bottom:1px solid var(--line);max-height:40vh;overflow:auto}.private-chat-tools summary{cursor:pointer;font-size:14px;font-weight:650}.private-chat-tools label{margin-top:16px}
.private-messages{flex:1;min-height:0;overflow:auto;padding:20px;display:flex;flex-direction:column;gap:16px;scrollbar-width:thin}
.private-bubble{align-self:flex-start;max-width:85%;padding:14px 18px;border-radius:18px;background:#f6f3f8;overflow-wrap:anywhere}.private-bubble.outgoing{align-self:flex-end;background:var(--lavender)}.private-bubble p{margin:0;white-space:pre-wrap}.private-bubble small{display:block;font-size:11px;color:var(--muted);margin-top:10px}
.private-compose{padding:16px;border-top:1px solid var(--line)}.private-compose textarea{resize:none;max-height:180px}.private-compose .button{margin-top:10px}#pc-back{display:none}#pc-error{color:#a24235}#pc-error:empty{display:none}
@media(max-width:760px){.private-chat-layout{display:block;height:auto}.private-thread{display:none}.has-private-thread .private-thread{display:flex;position:fixed;inset:0;height:100dvh;border:0;border-radius:0;z-index:12;background:white}.private-compose{padding-bottom:max(16px,env(safe-area-inset-bottom))}#pc-back{display:block}.private-chat-list{padding:14px}}
#pc-chat-search{margin-bottom:18px}.reply-templates{margin-bottom:12px}.reply-templates summary{cursor:pointer;color:var(--purple);font-size:13px;font-weight:650}#pc-templates{display:flex;gap:10px 18px;flex-wrap:wrap;padding:12px 0}#pc-templates button{font-size:12px}
.private-attachment{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:14px}.private-attachment button{font-size:13px}.private-attachment span{font-size:11px}.private-bubble a{display:block;margin-top:8px;overflow-wrap:anywhere}
.voice-recorder{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:0 0 14px}.voice-recorder audio,.private-bubble audio{width:100%;max-width:340px;min-width:0}.voice-recorder audio{flex-basis:100%}.voice-actions{display:flex;gap:14px;align-items:center;flex-wrap:wrap}.voice-recorder [role=status]{font-size:12px}.voice-actions .button{margin:0}.private-bubble:has(audio){width:min(340px,85%)}
@media(max-width:600px){.office-header nav{flex-wrap:wrap}.office-header nav button:last-child{margin-left:0}.office-header{max-width:100%}}
/* Compact messenger composer: icon row, optional controls above it. */
.private-thread .conversation-header,.private-chat-tools,.private-compose{flex-shrink:0}.private-chat-tools:not([open]){overflow:visible;max-height:none}.private-chat-layout{height:calc(100dvh - 225px);min-height:420px}.private-messages{flex:1 1 0;min-height:160px}
.compact-compose{position:relative;padding:8px 10px;background:#fff}.composer-bar{display:flex;align-items:flex-end;gap:3px;min-height:46px}
.compact-compose .composer-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 42px;width:42px;height:44px;min-height:0;padding:0;border:0;border-radius:12px;background:transparent;color:#84748f;cursor:pointer;margin:0}
.compact-compose .composer-icon:hover{background:#f2ecf7;color:#76549b}.composer-icon svg{width:22px;height:22px;flex-shrink:0}.composer-icon:disabled{opacity:.45;cursor:default}.compact-compose .composer-send{color:#76549b}
.compact-compose #pc-text{flex:1;min-width:0;min-height:44px;height:44px;max-height:120px;resize:none;border:0;border-radius:0;background:transparent;padding:12px 6px;font-size:15px;line-height:20px;box-shadow:none;margin:0;overflow-y:auto;font-family:inherit}
.compact-compose #pc-text:focus{outline:none}.compact-compose:focus-within{box-shadow:inset 0 -2px #c7b1da}.compact-compose #pc-status{font-size:11px;margin:4px 10px 0}.compact-compose #pc-status:empty{display:none}
.composer-popover{position:absolute;bottom:100%;left:10px;z-index:3;background:white;border:1px solid var(--line);box-shadow:0 8px 35px #342c4318;border-radius:18px;padding:16px;max-width:calc(100% - 20px);width:300px;display:grid;gap:12px}.composer-popover>button{border:0;background:var(--lavender);border-radius:10px;padding:12px;text-align:left;color:inherit}.composer-popover strong{font-size:12px}.composer-popover #pc-templates{display:grid;padding:0;gap:12px}.composer-popover #pc-templates button{text-align:left}.emoji-popover{left:auto;right:10px;display:flex;width:auto;gap:4px;flex-wrap:wrap}.emoji-popover button{font-size:23px;background:transparent;padding:7px}
.record-stop{display:none;width:14px;height:14px;background:#b0525c;border-radius:3px}#pc-record[data-recording=true] svg{display:none}#pc-record[data-recording=true] .record-stop{display:block}.compact-compose .voice-recorder{padding:10px 8px;margin:0;border-bottom:1px solid var(--line)}
@media(max-width:760px){.private-chat-layout{height:auto;min-height:0}.private-messages{min-height:90px}.compact-compose{padding-bottom:max(8px,env(safe-area-inset-bottom))}.compact-compose .composer-icon{flex-basis:36px;width:36px}.composer-bar{gap:0}}
.composer-popover#pc-attach-menu{width:220px;padding:7px;gap:2px;border-radius:14px}
.composer-popover#pc-attach-menu>button{display:flex;align-items:center;gap:13px;background:transparent;padding:12px;border-radius:9px;font-size:14px;font-weight:500}
.composer-popover#pc-attach-menu>button:hover,.composer-popover#pc-attach-menu>button:focus-visible{background:var(--lavender)}
.composer-popover#pc-attach-menu svg{flex:none;width:21px;height:21px}

.composer-popover #pc-templates{gap:2px}.composer-popover #pc-templates .template-choice{display:flex;align-items:center;gap:13px;padding:12px;border:0;border-radius:9px;background:transparent;color:var(--ink);font:inherit;font-size:14px;text-decoration:none}.composer-popover #pc-templates .template-choice:hover,.composer-popover #pc-templates .template-choice:focus-visible{background:var(--lavender)}.template-choice svg{width:21px;height:21px;flex:none}#pc-template-menu{padding:7px;gap:3px}#pc-template-back{background:transparent;font-size:12px;color:var(--muted);padding:8px 12px}
