/* Shared frame geometry for every management page, in both themes. */
body[data-workbench=management] #workspace.app-frame {
 padding:12px!important;gap:12px!important;max-width:none!important;
 width:100%!important;height:100dvh!important;margin:0!important;
 border:0!important;border-radius:0!important;box-shadow:none!important;
 background:var(--ui-bg)!important;box-sizing:border-box;
}
body[data-workbench=management] #workspace .sidebar,
body[data-workbench=management] #workspace .workspace-region {
 border:1px solid var(--ui-line)!important;border-radius:16px!important;
}
body[data-workbench=management] #workspace .work-card {
 background:var(--ui-surface)!important;padding:26px 32px!important;
}
body[data-workbench=personal] .personal-account-picker-controls {display:flex;align-items:center;gap:10px;min-width:0}
body[data-workbench=personal] .personal-account-picker-controls>.personal-avatar {width:36px;height:36px;flex:none}
body[data-workbench=personal] .personal-account-picker-controls>label {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
body[data-workbench=personal] .personal-account-picker-controls>select {flex:1;min-width:0;width:auto;max-width:540px;font-size:14px;font-weight:600;border-color:var(--ui-line);border-radius:10px;background:var(--ui-soft)}
body[data-workbench=personal] .personal-account-picker-controls>button {flex:none;border-radius:10px}
body[data-workbench=personal] .personal-account-summary {padding-left:46px}
body[data-workbench=personal] .personal-account-line {margin:0}
body[data-workbench=personal] .personal-account-line>button {border:0;background:transparent}
body[data-workbench=personal] .personal-account-line>button:hover {background:var(--ui-hover)}
body #workspace .message-chat .chat-group-search {display:flex;flex-wrap:nowrap;align-items:center;gap:8px}
body #workspace .message-chat .chat-group-search input {width:0;min-width:0;flex:1}
body #workspace .message-chat .chat-group-search button {flex:none;white-space:nowrap;width:auto}
body #workspace .message-chat .chat-room-identity>.chat-avatar {display:flex}
body #workspace .message-chat .chat-room-identity h3 {grid-column:2}
body #workspace .message-chat .chat-room-identity .chat-count {grid-column:2}
/* Official records use the same list/conversation pattern; remain read-only. */
body #workspace .message-chat.messages-dashboard {
 display:grid;grid-template-columns:clamp(260px,25vw,350px) minmax(0,1fr);
 grid-template-rows:auto minmax(0,1fr);height:calc(100dvh - 250px);
 min-height:360px;border:1px solid var(--ui-line);border-radius:14px;
 overflow:hidden;gap:0;background:var(--ui-surface);
}
body #workspace .message-chat>.dp-message-toolbar {grid-column:1/-1;padding:8px 14px;margin:0;border-bottom:1px solid var(--ui-line);min-height:42px}
body #workspace .message-chat>.dp-message-toolbar>select {max-width:330px;margin:0}
body #workspace .message-chat>.chat-groups {display:flex;flex-direction:column;min-width:0;min-height:0;max-height:none;overflow-y:auto;border:0;border-right:1px solid var(--ui-line);border-radius:0;margin:0;padding:14px;background:var(--ui-surface)}
body #workspace .message-chat .chat-group-list {display:flex;flex:0 0 auto;flex-direction:column;gap:4px;overflow:visible;max-height:none}
body #workspace .message-chat .chat-group {width:100%;display:flex;text-align:left;gap:10px;align-items:center;border:0;border-radius:10px;padding:12px 8px;background:transparent;color:var(--ui-text)}
body #workspace .message-chat .chat-group[aria-pressed=true] {background:var(--ui-accent-soft);color:var(--ui-ink)}
body #workspace .message-chat .chat-group-label {display:flex;flex-direction:column;min-width:0;gap:5px}
body #workspace .message-chat .chat-group-label strong {white-space:normal;overflow-wrap:anywhere}
body #workspace .message-chat .chat-group-label small {font-size:11px;color:var(--ui-muted)}
body #workspace .message-chat>.chat-room {display:flex;flex-direction:column;min-height:0;min-width:0;border:0;border-radius:0!important;padding:0;margin:0;overflow:hidden;background:var(--ui-soft)}
body #workspace .message-chat .chat-room-header {display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 16px;flex:none;min-height:68px;background:var(--ui-surface)}
body #workspace .message-chat .chat-room-identity {flex:1;min-width:120px;display:grid;grid-template-columns:auto 1fr;column-gap:10px}
body #workspace .message-chat .chat-room-identity>.chat-avatar {grid-row:1/3}
body #workspace .message-chat .chat-room-identity h3 {margin:0;font-size:16px;overflow-wrap:anywhere}
body #workspace .message-chat .chat-count {margin:4px 0 0;font-size:11px}
body #workspace .message-chat .chat-back {display:none}
body #workspace .message-chat .chat-search {margin:0;padding:10px 16px;background:var(--ui-surface);border:0;border-bottom:1px solid var(--ui-line);border-radius:0}
body #workspace .message-chat .chat-search>summary {font-size:12px;cursor:pointer}
body #workspace .message-chat .chat-search:not([open])>:not(summary) {display:none}
body #workspace .message-chat .chat-search form {margin-top:10px;display:flex;flex-wrap:wrap;align-items:end;gap:8px}
body #workspace .message-chat .chat-search label {flex:1;min-width:110px}
body #workspace .message-chat .chat-search input {width:100%}
body #workspace .message-chat .chat-scroll {flex:1;min-height:0;height:auto;overflow-y:auto;padding:16px 20px;overscroll-behavior:contain}
body #workspace .message-chat .chat-history {display:flex;flex-direction:column;gap:16px;padding:0;max-width:none}
body #workspace .message-chat .chat-day {align-self:center;border:1px solid var(--ui-line);border-radius:20px;padding:4px 12px;font-size:11px;color:var(--ui-muted)}
body #workspace .message-chat .log-record.chat-message {align-self:flex-start;display:flex;flex-direction:column;align-items:flex-start;width:auto;max-width:85%;padding:0;border:0;background:transparent;gap:5px;margin:0}
body #workspace .message-chat .log-record.chat-message.is-bot {align-self:flex-end;align-items:flex-end}
body #workspace .message-chat .log-record-header {display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:0}
body #workspace .message-chat .log-record-header>.chat-avatar {width:30px;height:30px;flex:none}
body #workspace .message-chat .log-record-header .dp-badge {display:none}
body #workspace .message-chat .log-record-header time {font-size:11px;color:var(--ui-muted)}
body #workspace .message-chat .chat-message-body {padding:0;min-width:0;max-width:100%}
body #workspace .message-chat .chat-bubble {padding:12px 15px;border:1px solid var(--ui-line);border-radius:4px 16px 16px 16px;background:var(--ui-surface);color:var(--ui-ink);min-width:0;max-width:100%;overflow-wrap:anywhere;line-height:1.75}
body #workspace .message-chat .is-bot .chat-bubble {border-radius:16px 4px 16px 16px;background:var(--ui-accent-soft)}
body #workspace .message-chat .chat-content {white-space:pre-wrap}
body #workspace .message-chat .chat-quote {margin:0 0 10px;padding:10px;border-left:3px solid var(--ui-accent);background:var(--ui-soft);display:flex;flex-direction:column;gap:5px}
body #workspace .message-chat .log-meta {display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:0;font-size:11px;color:var(--ui-muted)}
body #workspace .message-chat .log-meta>span {display:none}
body #workspace .message-chat .chat-message-more {font-size:11px;padding:2px;background:transparent;border:0}
body #workspace .message-chat .chat-footer {flex:none;font-size:11px;padding:8px 14px;background:var(--ui-surface)}
body #workspace .message-chat>section:not(.chat-room) {grid-column:1/-1;min-height:0;overflow:auto}
body #workspace .message-chat [hidden] {display:none!important}
.knowledge-read-status {padding:12px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-soft);font-size:12px;overflow-wrap:anywhere}
.knowledge-read-status p {margin:5px 0}
@media(max-width:760px),(max-width:900px) and (max-height:500px) {
 body[data-workbench=management] #workspace.app-frame {padding:0!important;gap:0!important}
 body[data-workbench=management] #workspace .workspace-region {border:0!important;border-radius:0!important}
 body[data-workbench=management] #workspace .work-card {padding:18px 12px!important}
 body[data-workbench=personal] .personal-account-picker-controls {flex-wrap:nowrap;gap:6px}
 body[data-workbench=personal] .personal-account-picker-controls>select {font-size:16px;max-width:none}
 body[data-workbench=personal] .personal-account-picker-controls>button {font-size:12px;padding:8px}
 body[data-workbench=personal] .personal-account-summary {font-size:10px;padding-left:42px}
 body[data-page="訊息紀錄"] #workspace .page-heading {padding:0 0 10px;margin:0 0 12px}
 body[data-page="訊息紀錄"] #workspace .page-heading .eyebrow,
 body[data-page="訊息紀錄"] #workspace .page-heading p {display:none}
 body[data-page="訊息紀錄"] #workspace .page-heading h2 {font-size:22px;margin:0}
 body #workspace .message-chat.messages-dashboard {grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);height:calc(100dvh - 180px);min-height:340px}
 body #workspace .message-chat>.dp-message-toolbar {display:none}
 body #workspace .message-chat>.dp-message-toolbar>select {display:none}
 body #workspace .message-chat[data-mobile=conversation]>.chat-groups,
 body #workspace .message-chat[data-mobile=groups]>.chat-room {display:none}
 body #workspace .message-chat>.chat-groups {border-right:0}
 body #workspace .message-chat .chat-back {display:inline-block}
 body #workspace .message-chat .chat-room-header {display:grid;grid-template-columns:50px minmax(0,1fr) 66px;padding:8px;gap:6px}
 body #workspace .message-chat .chat-room-identity {min-width:0;grid-template-columns:28px minmax(0,1fr);column-gap:6px}
 body #workspace .message-chat .chat-room-identity>.chat-avatar {width:28px;height:28px}
 body #workspace .message-chat .chat-room-identity h3 {font-size:14px}
 body #workspace .message-chat .chat-count {white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body #workspace .message-chat .chat-room-header>button:last-child {grid-column:1/-1;justify-self:end;padding:4px 8px}
 body #workspace .message-chat .chat-room-header>button {font-size:11px;padding:6px}
 body #workspace .message-chat .chat-scroll {padding:12px}
 body #workspace .message-chat .log-record.chat-message {max-width:94%}
 body #workspace .message-chat .chat-search {padding:8px}
}
