/* Layout overrides: preserve existing controls and data, give reading space priority. */
:root { --app-height: 100dvh; --app-top: 0px; --ink: #152b24; }
html { background: #f4f7f6; }
body.h-screen { height: var(--app-height); position: relative; top: var(--app-top); }
body > main, #content-chat, #content-chat > section, #content-admin { min-height: 0; min-width: 0; }
#app-header { border-bottom-width: 1px; border-color: rgba(255,255,255,.16); background: #075337; }
#app-header > div:first-child { min-width: 0; }
#app-header h1 { letter-spacing: .04em; }
#main-nav-tabs { max-width: 100%; }
@keyframes legal-work-deadline-pulse { 50% { opacity: .35; } }
.work-deadline-blink { animation: legal-work-deadline-pulse 1s ease-in-out infinite; }
.notification-trigger { position:relative; display:flex; align-items:center; gap:6px; border:1px solid #ffffff38; border-radius:9px; padding:6px 9px; color:#fff; font-weight:700; white-space:nowrap; transition:background .15s; }
.notification-trigger.hidden,.notification-count.hidden { display:none !important; }
.notification-trigger:hover { background:#ffffff18; }
.notification-count { position:absolute; top:-5px; right:-5px; min-width:17px; height:17px; display:flex; align-items:center; justify-content:center; padding:0 4px; border:1px solid #173b2b; border-radius:999px; color:#fff; background:#dc2626; font:700 9px/1 sans-serif; }
#legal-notifications-panel { position:fixed; z-index:100; top:76px; right:18px; width:min(390px,calc(100vw - 24px)); max-height:min(520px,calc(100vh - 100px)); overflow:hidden; border:1px solid #dbe5de; border-radius:14px; background:#fff; box-shadow:0 16px 44px #09251330; }
.notification-panel-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 15px; border-bottom:1px solid #e8eee9; color:#173b2b; }
.notification-panel-heading button { color:#17633d; font-size:11px; font-weight:700; }
.notification-list { max-height:min(450px,calc(100vh - 155px)); overflow-y:auto; }
.notification-item { display:block; width:100%; padding:12px 15px; border-bottom:1px solid #eef2ef; text-align:left; color:#405248; }
.notification-item:hover { background:#f5faf6; }
.notification-item.unread { background:#f1f8f3; }
.notification-item strong { display:block; margin-bottom:3px; color:#173b2b; font-size:12px; }
.notification-item span { display:block; font-size:11px; line-height:1.45; }
.notification-item small { display:block; margin-top:5px; color:#89948d; font-size:9px; }
.notification-empty { margin:0; padding:22px 15px; color:#7b8880; text-align:center; font-size:12px; }
@media(max-width:767px) { #legal-notifications-panel { top:58px; right:8px; } }
@media (prefers-reduced-motion: reduce) {
    .work-deadline-blink { animation: none; }
}
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid #14b88a; outline-offset: 3px;
}
#chat-sidebar { width: 276px; }
#session-list { overscroll-behavior: contain; }
#session-search-input { font-size: 14px; }
#chat-workspace-toolbar { min-height: 62px; gap: 12px; }
#chat-workspace-toolbar > div:first-child { flex: 1; }
#current-session-title { max-width: min(32vw,420px); flex: 0 1 auto; }
#chat-workspace-toolbar > div:first-child > div:last-child { flex: 1; }
#messages-container { scroll-behavior: smooth; overscroll-behavior: contain; background: #f5f8f7; }
#messages-container > * { max-width: 920px; margin-left: auto; margin-right: auto; }
#messages-container .welcome-screen { padding: 32px 16px; height: auto; min-height: 100%; }
#messages-container .welcome-screen h3 { font-size: clamp(22px, 2.1vw, 30px); line-height: 1.3; letter-spacing: -.035em; }
#messages-container .welcome-screen > p { font-size: 14px; line-height: 1.7; margin-top: 12px; }
.prose-legal { font-size: 14px; overflow-wrap: anywhere; }
.prose-legal pre { max-width: 100%; overflow-x: auto; white-space: pre; }
.prose-legal img { max-width: 100%; height: auto; }
#chat-composer { padding: 16px 24px; background: #fff; border-top: 1px solid #e0e9e4; }
#chat-form { max-width: 920px; }
#chat-form > div:last-child { gap: 8px; }
#chat-form > div:last-child > div:nth-child(2) { min-width: 0; background: #f7faf8; border-color: #d7e3dc; border-radius: 16px; }
#chat-input { font-size: 15px; line-height: 1.6; min-height: 44px; max-height: 160px; }
#btn-send, #btn-chat-upload-menu { width: 46px; height: 46px; border-radius: 14px; }
#right-sidebar-panel { width: 340px; min-height: 0; }
#right-panel-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(12,34,25,.42); backdrop-filter: blur(3px); }
#chat-sidebar-backdrop { z-index: 45; }
#content-admin { padding: clamp(16px,2vw,32px); }
#content-admin table { min-width: 620px; }
[id*="modal"].fixed { overflow-y: auto; overscroll-behavior: contain; }
[id*="modal"].fixed > div { max-height: calc(var(--app-height) - 32px); overflow-y: auto; }
#auth-modal > div { width: min(100%,460px); border-radius: 24px; }
#auth-modal label { font-size: 13px; }
#app-footer { font-size: 11px; background: #fff; color: #62766c; border-top: 1px solid #e0e9e4; box-shadow: none; padding: 8px; }
#app-footer span { color: inherit; }
@media (min-width: 1100px) {
    #chat-sidebar { position: static; transform: none !important; z-index: auto; box-shadow: none; }
    #chat-sidebar.is-collapsed { display: none; }
    #close-chat-drawer { display: none; }
}
@media (max-width: 1439px) and (min-width: 768px) {
    #app-header { flex-wrap: wrap; flex-direction: row; gap: 12px; }
    #app-header > div:first-child { width: auto; flex: 1; }
    #app-header > div:last-child { margin-left: auto; }
    #main-nav-tabs:not(.hidden) { order: 3; width: 100%; justify-content: flex-start; }
    #token-cost-center-box { min-width: 130px; padding-inline: 10px; }
    #status-api-badge { display: none; }
    #user-info-box { max-width: 130px; }
}
@media (max-width: 1099px) {
    #chat-sidebar { position: fixed; inset: 0 auto 0 0; width: min(320px,calc(100vw - 44px)); height: var(--app-height); top: var(--app-top); z-index: 50; transform: translateX(-110%) !important; box-shadow: 12px 0 50px rgba(20,40,30,.16); }
    #chat-sidebar.is-open { transform: translateX(0) !important; }
    #chat-sidebar-backdrop:not(.hidden) { display: block; }
    #close-chat-drawer { display: flex; align-items: center; justify-content: center; }
}
@media (max-width: 1439px) {
    #right-sidebar-panel:not(.hidden) { display: flex; position: fixed; inset: 0 0 0 auto; top: var(--app-top); height: var(--app-height); width: min(400px,calc(100vw - 24px)); z-index: 50; box-shadow: -12px 0 50px rgba(20,40,30,.16); }
}
@media (min-width: 1440px) {
    #right-sidebar-panel:not(.hidden) { display: flex; position: static; }
    #right-panel-backdrop { display: none; }
}
@media (max-width: 767px) {
    #app-header { padding: max(10px,env(safe-area-inset-top)) 14px 10px; gap: 8px; }
    #app-header img { max-width: 94px; height: auto; }
    #app-header h1 { font-size: 13px; }
    #app-header > div:first-child > div:first-child { gap: 10px; }
    #app-header .tracking-wider { font-size: 8px; letter-spacing: .04em; }
    #btn-mobile-login { display: none; }
    #mobile-status-bar { padding: 6px 12px; gap: 6px; }
    #mobile-status-bar > * { min-width: 0; }
    #mobile-status-bar label, #btn-mobile-auth { min-height: 36px; padding: 6px 10px; }
    #mobile-status-bar > div:nth-child(2) { flex: 1; justify-content: center; white-space: nowrap; padding-inline: 6px; font-size: 10px; }
    #user-mobile-name { max-width: 86px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    #main-nav-tabs button { min-height: 40px; }
    #chat-workspace-toolbar { min-height: 56px; padding: 6px 10px; gap: 6px; }
    #chat-workspace-toolbar button { min-width: 40px; min-height: 40px; padding: 8px; }
    #chat-workspace-toolbar > div:first-child { gap: 6px; }
    #chat-workspace-toolbar > div:first-child > div:last-child { gap: 0; }
    #btn-copy-session-link { display: none; }
    #current-session-title { font-size: 13px; }
    #btn-export-detailed-report span { display: none; }
    #header-citations-count-badge { display: inline-flex; }
    #messages-container { padding: 16px 12px; }
    #messages-container .welcome-screen { padding: 24px 10px; }
    #messages-container .welcome-screen h3 { font-size: 24px; }
    #messages-container .welcome-screen > p { font-size: 14px; }
    #messages-container .welcome-screen button { min-height: 44px; }
    .prose-legal { font-size: 14px; line-height: 1.8; }
    #chat-composer { padding: 10px 12px max(10px,env(safe-area-inset-bottom)); }
    #chat-input { font-size: 16px; padding: 0; min-height: 44px; }
    #chat-form > div:last-child { gap: 6px; }
    #chat-form > div:last-child > div:nth-child(2) { padding: 8px 10px; }
    #chat-quick-hints > div:first-child { min-width: 0; }
    #chat-quick-hints > div:first-child > span { display: none; }
    #chat-quick-hints button { min-height: 34px; font-size: 11px; }
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea { font-size: 16px !important; }
    #content-admin { padding: 14px 12px; }
    #content-admin button { min-height: 40px; }
    #content-admin > div:first-child { flex-wrap: wrap; gap: 12px; }
    #content-admin .flex.justify-between { flex-wrap: wrap; gap: 8px; }
    [id*="modal"].fixed { padding: 12px; }
    [id*="modal"].fixed > div { max-height: calc(var(--app-height) - 24px); }
    #auth-modal > div > div { padding: 20px; }
    #auth-modal button { min-height: 40px; }
    #app-footer { display: none; }
    body.keyboard-open #mobile-status-bar, body.keyboard-open #chat-quick-hints { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media(max-width:767px) { #current-session-title { max-width: none; flex: 1; } }

#messages-container .welcome-screen > div:last-child { max-width: 560px; }
#admin-view-system table td { white-space: nowrap; }
#admin-view-system table td:first-child { min-width: 160px; }
@media (max-width: 767px) {
    #admin-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
    #admin-kpi-grid > div { padding: 14px; flex-direction: column; align-items: flex-start; gap: 8px; }
    #admin-kpi-grid > div > div:last-child { margin-left: 0; }
    #admin-kpi-grid > div > div:first-child { padding: 8px; }
    #admin-kpi-grid svg { width: 20px; height: 20px; }
    #admin-kpi-grid .text-xs { font-size: 11px; }
    #chat-sidebar button, #right-sidebar-panel button { min-height: 44px; }
}

@media (pointer: coarse) {
    #chat-input, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea { font-size: 16px !important; }
}
@media (max-width: 767px) and (max-height: 520px) {
    #mobile-status-bar, #chat-quick-hints { display: none; }
    #chat-composer { padding-top: 8px; }
}

/* Keep credential replacement inputs within their cards on narrow screens. */
#input-api-key, #input-claude-api-key, #input-dlpl-api-key { min-width: 0; width: 100%; }

/* Header: equal outer columns keep navigation at the viewport midpoint. */
#app-header {
    display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    align-items: center; gap: 10px 16px; padding: 12px 24px;
    background: #075337; box-shadow: 0 2px 12px rgb(0 30 20 / 12%);
}
#header-brand { grid-column: 1; grid-row: 1; width: auto !important; min-width: 0; }
#header-brand > div:first-child { min-width: 0; gap: 12px; }
#header-brand .tracking-wider { background: none; color: #c7ded3; padding: 0; font-size: 9px; letter-spacing: .05em; }
#app-header h1 { font-size: 15px; letter-spacing: .06em; line-height: 1.6; }
#header-home { padding: 7px 9px; border-radius: 12px; min-height: 44px; }
#header-home img { width: 88px; height: 28px; max-width: 88px; object-fit: contain; }
#main-nav-tabs:not(.hidden) {
    grid-column: 1 / -1; grid-row: 2; justify-self: center;
    width: max-content; max-width: 100%; justify-content: center;
    margin: 0; padding: 4px; gap: 4px; overflow: visible;
    background: rgb(0 30 20 / 28%); border: 1px solid rgb(255 255 255 / 12%);
}
#main-nav-tabs button { min-height: 44px; padding: 10px 16px; font-size: 12px; margin: 0; gap: 8px; }
#main-nav-tabs svg { width: 16px; height: 16px; flex-shrink: 0; }
#header-actions { grid-column: 2; grid-row: 1; justify-self: end; margin: 0 !important; gap: 12px; min-width: 0; }
#header-actions > div:first-child { gap: 8px; }
#status-api-badge, #status-api-badge-mobile, #btn-mobile-login { display: none !important; }
#token-cost-center-box { min-width: 128px; height: 44px; padding: 6px 10px; border-radius: 12px; background: rgb(0 30 20 / 28%); border-color: rgb(255 255 255 / 16%); box-shadow: none; }
#claude-toggle-label { min-width: 102px; height: 44px; padding: 8px 10px; border-radius: 12px; box-shadow: none; }
#user-profile-section { min-width: 0; padding-left: 12px; }
#logged-user-box { gap: 8px; }
#user-avatar { width: 32px; height: 32px; flex-shrink: 0; }
#user-display-name { max-width: 136px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 28px; text-align: left; }
#user-department { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#logged-user-box > button[title="Cài đặt thông tin cán bộ"] { display: none; }
#logged-user-box > button[title="Đăng xuất"] { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; margin: 0; border-radius: 12px; }
#btn-open-login { min-height: 44px; }
@media (min-width: 1024px) {
    #app-header { grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); }
    #main-nav-tabs:not(.hidden) { grid-column: 2; grid-row: 1; }
    #header-actions { grid-column: 3; }
}
@media (max-width: 1023px) {
    #header-actions { display: none !important; }
    #app-header { grid-template-columns: minmax(0,1fr); padding: max(10px,env(safe-area-inset-top)) 16px 10px; gap: 10px; }
    #header-brand { justify-self: center; }
    #mobile-status-bar { display: flex !important; align-items: center; justify-content: space-between; padding: 8px 16px; gap: 8px; border-color: rgb(255 255 255 / 12%); }
    #mobile-status-bar > * { min-width: 0; }
    #mobile-status-bar label, #btn-mobile-auth { min-height: 44px; border-radius: 12px; padding: 8px; }
    #mobile-status-bar > div:nth-child(2) { flex: 0 1 auto; font-size: 10px; min-height: 44px; padding: 6px 8px; border-radius: 12px; display: flex; flex-wrap: wrap; justify-content: center; }
    #user-mobile-name { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 479px) {
    #app-header { padding-inline: 12px; }
    #header-home img { width: 70px; max-width: 70px; height: 24px; }
    #header-brand > div:first-child { gap: 10px; }
    #app-header h1 { font-size: 13px; }
    #header-brand .tracking-wider { font-size: 8px; letter-spacing: .02em; }
    #main-nav-tabs button { padding-inline: 12px; font-size: 11px; gap: 6px; }
    #mobile-status-bar { padding: 6px 12px; gap: 6px; }
    #mobile-status-bar label svg { display: none; }
    #btn-mobile-auth { padding-inline: 6px; }
}
@media (max-width: 359px) {
    #mobile-status-bar { flex-wrap: wrap; }
    #mobile-status-bar > div:nth-child(2) { order: 3; flex: 1 0 100%; min-height: 30px; }
    #user-mobile-box { margin-left: auto; }
}

/* Compact desktop controls keep every header group on one centered row. */
@media (min-width: 1024px) and (max-width: 1699px) {
    #app-header { padding: 10px 16px; column-gap: 8px; }
    #header-brand > div:first-child { gap: 10px; }
    #header-home img { width: 70px; max-width: 70px; height: 24px; }
    #header-brand .tracking-wider { font-size: 8px; letter-spacing: .02em; }
    #app-header h1 { font-size: 13px; }
    #main-nav-tabs button { padding-inline: 12px; font-size: 11px; gap: 6px; }
    #header-actions { display: flex !important; gap: 8px; }
    #header-actions > div:first-child { gap: 6px; }
    #header-actions > div, #header-actions > div:first-child > *, #logged-user-box > * { margin-left: 0; }
    #token-cost-center-box { min-width: 108px; padding-inline: 6px; }
    #claude-toggle-label { min-width: 88px; padding-inline: 6px; font-size: 11px; }
    #claude-toggle-text > svg { display: none; }
    #user-profile-section { padding-left: 8px; }
    #logged-user-box { gap: 6px; }
    #logged-user-box > .text-left { display: none; }
    #user-avatar { width: 44px; height: 44px; }
    #mobile-status-bar { display: none !important; }
}

/* Persisted research progress stays visible without obscuring the conversation. */
.chat-job-status { border:1px solid #bfdbfe; background:#eff6ff; color:#1e40af; border-radius:10px; padding:9px 12px; font-size:12px; line-height:1.55; }
#btn-send:disabled { opacity:.45; cursor:wait; box-shadow:none; }
#chat-form button:focus-visible { outline:3px solid #60a5fa; outline-offset:3px; }
@media (prefers-reduced-motion: reduce) { .animate-ping, .animate-pulse, .animate-spin { animation:none !important; } }

.chat-new-answer { align-self:center; padding:8px 16px; border-radius:999px; color:#fff; background:#075337; font-size:12px; font-weight:600; box-shadow:0 3px 12px #07533722; }
@media (max-width:767px) { .chat-job-status { font-size:11px; padding:7px 10px; } }

.legal-start-card { display:flex; flex-direction:column; align-items:flex-start; gap:8px; background:#fff; border:1px solid #e2e8f0; border-radius:14px; padding:16px; text-align:left; transition:background .15s,border-color .15s; }
.legal-start-card:hover { border-color:#86b79b; background:#f6faf7; }
.legal-start-card strong { font-size:13px; color:#1e293b; }
.legal-start-card span { font-size:12px; line-height:1.6; color:#64748b; }
.legal-start-card:focus-visible { outline:3px solid #60a5fa; outline-offset:3px; }

#messages-container .welcome-screen { height:auto; min-height:100%; }
@media (max-width:767px) {
    #messages-container .welcome-screen { padding:18px 10px; }
    #messages-container .welcome-screen > div:first-child { display:none; }
    .legal-start-card { display:grid; grid-template-columns:24px minmax(0,1fr); gap:3px 8px; padding:10px 12px; }
    .legal-start-card > svg { grid-row:1 / 3; margin-top:2px; }
    .legal-start-card > span { grid-column:2; font-size:11px; }
}
@media (min-width:480px) and (max-width:767px) {
    #messages-container .welcome-screen .grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:16px; }
    .legal-start-card { display:flex; padding:12px 10px; gap:7px; }
    .legal-start-card strong { font-size:12px; }
}

/* Source catalog: compact desktop rows and labelled mobile cards. */
.catalog-toolbar {align-items:flex-start}
.catalog-maintenance {position:relative}
.catalog-maintenance>summary {cursor:pointer;padding:8px 12px;border:1px solid #cbd5e1;border-radius:12px;font-size:12px;list-style:none}
.catalog-maintenance-menu {display:flex;flex-direction:column;gap:8px;padding:12px;background:#f8fafc;border:1px solid #cbd5e1;border-radius:12px;margin-top:8px;max-width:360px}
.catalog-maintenance-menu button {white-space:normal;text-align:left}
.catalog-danger {border-top:1px solid #fecaca;padding-top:12px;margin-top:4px}
.catalog-danger p {font-size:11px;color:#9f1239;margin-bottom:8px}
#catalog-space-summary {display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.catalog-space-card {display:flex;justify-content:space-between;gap:8px;padding:12px;border:1px solid #e2e8f0;border-radius:12px;font-size:12px;text-align:left}
.catalog-space-card[aria-pressed=true],.catalog-health-summary button[aria-pressed=true] {background:#eff6ff;border-color:#2563eb;color:#1d4ed8}
.catalog-health-summary {display:flex;gap:8px;flex-wrap:wrap;padding:12px;border-bottom:1px solid #e2e8f0}
.catalog-health-summary button {padding:8px 12px;border:1px solid #cbd5e1;border-radius:20px;font-size:12px}
.catalog-health-summary b {margin-left:6px}
.catalog-keywords summary {cursor:pointer;color:#475569;font-size:12px;padding:4px 0 8px}
.catalog-readiness {font-size:11px;font-weight:600;color:#475569;white-space:normal}
.catalog-readiness[data-status=ready] {color:#047857}
.catalog-readiness[data-status=warning],.catalog-readiness[data-status=missing_text],.catalog-readiness[data-status=unindexed] {color:#92400e}
#catalog-pagination,#catalog-pagination>div {display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;font-size:12px}
#catalog-pagination button {padding:8px 12px;background:white;border:1px solid #cbd5e1;border-radius:8px}
#catalog-pagination button:disabled {opacity:.4;cursor:not-allowed}
#catalog-table-body[aria-busy=true] {opacity:.55;pointer-events:none}
#source-catalog-table td {overflow-wrap:anywhere}
@media (max-width:767px) {
 #catalog-space-summary {grid-template-columns:1fr}
 #catalog-search-input {min-height:44px}
 #catalog-group-filter,#catalog-status-filter,#catalog-sort,#catalog-page-size {max-width:100%;min-height:40px}
 #catalog-search-input~* {flex-wrap:wrap}
 #source-catalog-table,#source-catalog-table tbody {display:block;width:100%}
 #source-catalog-table thead {display:none}
 #source-catalog-table tbody tr {display:grid;grid-template-columns:1fr 1fr;border:1px solid #e2e8f0;border-radius:12px;margin:12px;overflow:hidden;background:white}
 #source-catalog-table td {display:block;min-width:0;white-space:normal;padding:10px}
 #source-catalog-table td:nth-child(1),#source-catalog-table td:nth-child(2) {grid-column:1/-1}
 #source-catalog-table td:before {content:attr(data-label);display:block;font-size:10px;color:#64748b;font-weight:500;margin-bottom:6px}
 #source-catalog-table td:last-child {grid-column:1/-1;text-align:left}
 #source-catalog-table td button {min-height:36px;min-width:36px}
 .catalog-toolbar {width:100%}
 .catalog-maintenance {width:100%}
 .catalog-maintenance-menu {max-width:none}
}
@media (max-width:767px) {
 #catalog-space-filter {display:block;width:100%;max-width:100%;margin:8px 0 0}
 #catalog-unit-picker {display:block;margin:8px 0 0}
 #catalog-unit-picker.hidden {display:none}
 #catalog-unit-filter {width:100%;max-width:100%}
 #catalog-space-summary {grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 .catalog-space-card {flex-direction:column;align-items:flex-start;padding:10px 8px;gap:6px}
 .catalog-space-card b {font-size:16px}
}
@media (max-width:767px) {
 .catalog-health-summary {flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin}
 .catalog-health-summary button {white-space:nowrap;flex-shrink:0}
 .catalog-filter-controls {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;margin:0}
 .catalog-filter-controls select {width:100%;min-width:0}
 #source-catalog-table td[colspan] {grid-column:1/-1}
}

.catalog-source-note {grid-column:1/-1;font-size:11px;color:#64748b}
@media (max-width:767px) {#source-catalog-table td button {min-height:44px;min-width:44px}}

/* Legal department work area */
#content-work { background:#f3f6f4; }
.work-page { max-width:1440px; padding:4px 0 28px; color:#172b22; }
.work-page-header { display:flex; align-items:center; justify-content:space-between; gap:18px; min-height:0; padding:12px 16px; border:1px solid #dce8df; border-radius:14px; color:#173c2c; background:#fff; box-shadow:0 2px 8px #183b2908; }
.work-page-heading { display:flex; align-items:center; gap:12px; min-width:0; }
.work-page-heading h1 { margin:0; font-size:20px; line-height:1.25; letter-spacing:-.025em; font-weight:700; }
.work-page-heading p { min-height:0; margin:2px 0 0; color:#64756c; font-size:11px; }
.work-eyebrow { display:inline-flex; align-items:center; gap:7px; flex:none; border:1px solid #dcebe1; border-radius:999px; padding:4px 8px; color:#256b4e; background:#f5faf6; font-size:9px; font-weight:700; letter-spacing:.06em; }
.work-eyebrow-dot { width:6px; height:6px; border-radius:50%; background:#42a575; }
.work-header-controls { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:7px; }
.work-alert-setting { display:flex; align-items:center; gap:7px; padding:5px 8px; border:1px solid #e0e9e3; border-radius:9px; color:#42574b; font-size:10px; }
.work-alert-setting select { border:0; border-radius:7px; padding:5px 7px; color:#173c2c; background:#fff; font-weight:650; }
.work-primary-button,.work-refresh-button,.work-secondary-button,.work-icon-button { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:34px; border-radius:9px; padding:7px 11px; font-size:11px; font-weight:700; transition:transform .16s,box-shadow .16s,background .16s; }
.work-primary-button { border:1px solid #cfe4d6; color:#075337; background:#f3fbf6; }
.work-primary-button.hidden,.work-list-empty.hidden { display:none; }
.work-primary-button:hover { transform:translateY(-1px); background:#fff; box-shadow:0 7px 18px #00281735; }
.work-refresh-button { border:1px solid #e0e9e3; color:#3f5a4a; background:#fff; }
.work-refresh-button:hover { background:#f5faf6; }
.work-form-panel,.work-task-section,.work-calendar-section { border:1px solid #e1eae4; border-radius:20px; background:#fff; box-shadow:0 4px 16px #183b2910; }
.work-form-panel { padding:22px; }
.work-form-heading,.work-task-section-heading,.work-calendar-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.work-task-heading-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex:none; }
.work-form-heading { margin-bottom:18px; }
.work-section-kicker { display:block; margin-bottom:4px; color:#438466; font-size:9px; font-weight:800; letter-spacing:.13em; }
.work-form-heading h2,.work-task-section-heading h2,.work-calendar-heading h2 { margin:0; color:#173b2b; font-size:19px; line-height:1.25; font-weight:750; letter-spacing:-.02em; }
.work-task-section-heading p,.work-calendar-heading p { margin:5px 0 0; color:#738279; font-size:12px; }
.work-icon-button { min-width:38px; min-height:38px; border:1px solid #e2e9e4; color:#64756a; background:#f8faf8; }
.work-icon-button:hover { background:#edf5ef; }
.work-create-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.work-field { display:flex; min-width:0; flex-direction:column; gap:6px; color:#45594c; font-size:11px; font-weight:650; }
.work-field-wide { grid-column:1/-1; }
.work-field input,.work-field select,.work-field textarea { width:100%; border:1px solid #dce6df; border-radius:10px; padding:10px 11px; color:#20382a; background:#fbfdfb; font-size:12px; font-weight:450; outline:none; }
.work-field input:focus,.work-field select:focus,.work-field textarea:focus { border-color:#4b9872; box-shadow:0 0 0 3px #16804d18; background:#fff; }
.work-field-help { color:#829087; font-size:10px; font-weight:400; }
.work-form-actions { grid-column:1/-1; display:flex; justify-content:flex-end; gap:8px; padding-top:2px; }
.work-form-actions .work-primary-button { color:#fff; border-color:#075337; background:#075337; }
.work-form-actions .work-primary-button:hover { background:#096442; }
.work-secondary-button { border:1px solid #dce6df; color:#4f6156; background:#fff; }
.work-form-error { grid-column:1/-1; padding:10px 12px; border-radius:10px; color:#991b1b; background:#fef2f2; font-size:12px; }
.work-kpi-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
.work-kpi-card { position:relative; display:flex; align-items:center; gap:13px; min-height:96px; overflow:hidden; padding:17px; border:1px solid #e3ebe5; border-radius:17px; background:#fff; box-shadow:0 3px 12px #173d2a09; }
button.work-kpi-card { width:100%; text-align:left; cursor:pointer; }
button.work-kpi-card:hover,button.work-kpi-card[aria-pressed="true"] { border-color:#438364; background:#f0f8f2; }
button.work-kpi-card:focus-visible { outline:2px solid #17643e; outline-offset:2px; }
button.work-kpi-card .work-kpi-label,button.work-kpi-card .work-kpi-value { display:block; }
.work-kpi-card:after { position:absolute; right:-18px; bottom:-32px; width:82px; height:82px; border-radius:50%; background:currentColor; content:""; opacity:.035; }
.work-kpi-icon { display:grid; width:39px; height:39px; flex:0 0 39px; place-items:center; border-radius:13px; font-size:20px; font-weight:700; }
.work-kpi-label { color:#7b8980; font-size:10px; font-weight:600; line-height:1.35; }
.work-kpi-value { margin-top:4px; color:#1b3326; font-size:26px; font-weight:780; line-height:1; letter-spacing:-.04em; }
.work-kpi-green { color:#15803d; }.work-kpi-green .work-kpi-icon { color:#15803d; background:#eaf7ee; }
.work-kpi-blue { color:#2563eb; }.work-kpi-blue .work-kpi-icon { color:#2563eb; background:#edf3ff; }
.work-kpi-teal { color:#0f766e; }.work-kpi-teal .work-kpi-icon { color:#0f766e; background:#e8f7f4; }
.work-kpi-red { color:#dc2626; }.work-kpi-red .work-kpi-icon { color:#dc2626; background:#fff0ef; }
.work-kpi-gold { color:#b77908; }.work-kpi-gold .work-kpi-icon { color:#b77908; background:#fff7df; }
.work-task-section,.work-calendar-section { overflow:hidden; }
.work-task-section-heading,.work-calendar-heading { padding:21px 22px 17px; }
.work-task-count { flex:0 0 auto; border:1px solid #dcebe1; border-radius:999px; padding:7px 11px; color:#337553; background:#f2f8f4; font-size:11px; font-weight:700; }
.work-filter-toolbar { display:grid; grid-template-columns:minmax(200px,1fr) minmax(170px,.45fr) minmax(170px,.45fr); align-items:end; gap:10px; margin:0 22px 16px; padding:12px; border:1px solid #e8eee9; border-radius:14px; background:#f8faf8; }
.work-search-box,.work-filter-control { display:flex; min-width:0; flex-direction:column; gap:5px; color:#66776b; font-size:10px; font-weight:650; }
.work-search-box { position:relative; display:block; }
.work-search-box>span { position:absolute; top:7px; left:10px; color:#819087; font-size:21px; }
.work-search-box input,.work-filter-control select { width:100%; min-height:36px; border:1px solid #dfe8e1; border-radius:9px; padding:8px 10px; color:#34483b; background:white; font-size:11px; outline:none; }
.work-search-box input { padding-left:34px; }
.work-search-box input:focus,.work-filter-control select:focus { border-color:#62a27e; box-shadow:0 0 0 3px #16804d14; }
.work-task-list { display:grid; gap:10px; padding:0 22px 20px; }
.work-task-card { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:18px; padding:17px 18px; border:1px solid #e2eae4; border-radius:15px; background:#fff; transition:border-color .16s,box-shadow .16s,transform .16s; }
.work-task-card:hover { transform:translateY(-1px); border-color:#b8d5c2; box-shadow:0 8px 22px #173d2a0c; }
.work-task-card-content { min-width:0; }
.work-task-card-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.work-task-title-block { display:flex; min-width:0; align-items:center; flex-wrap:wrap; gap:8px; }
.work-task-title { overflow:hidden; max-width:100%; color:#1b3828; font-size:14px; font-weight:750; text-align:left; text-overflow:ellipsis; white-space:nowrap; }
.work-task-title:hover { color:#087044; text-decoration:underline; }
.work-priority-chip,.work-status-chip { display:inline-flex; flex:0 0 auto; align-items:center; border-radius:999px; padding:5px 8px; font-size:9px; font-weight:700; white-space:nowrap; }
.work-priority-chip[data-priority=normal] { color:#627267; background:#f0f3f1; }
.work-priority-chip[data-priority=high] { color:#9a6207; background:#fff5d8; }
.work-priority-chip[data-priority=urgent] { color:#b42318; background:#fff0ed; }
.work-status-chip[data-status=new] { color:#285da8; background:#edf4ff; }
.work-status-chip[data-status=in_progress] { color:#12654e; background:#e8f6ef; }
.work-status-chip[data-status=waiting] { color:#9a6207; background:#fff6dc; }
.work-status-chip[data-status=completed] { color:#147044; background:#e9f7ee; }
.work-status-chip[data-status=cancelled] { color:#68736c; background:#f0f2f0; }
.work-task-description { display:-webkit-box; overflow:hidden; margin:7px 0 11px; color:#728078; font-size:11px; line-height:1.55; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.work-task-meta { display:grid; grid-template-columns:minmax(150px,1.15fr) minmax(120px,.9fr) minmax(150px,1.1fr) minmax(115px,.8fr); align-items:center; gap:12px; }
.work-meta-person { display:flex; min-width:0; align-items:center; gap:8px; }
.work-avatar { display:grid; width:31px; height:31px; flex:0 0 31px; place-items:center; border-radius:11px; color:#24724a; background:#e9f5ed; font-size:10px; font-weight:750; }
.work-meta-person>span:last-child,.work-meta-item { display:flex; min-width:0; flex-direction:column; gap:3px; }
.work-task-meta small { color:#8a978e; font-size:9px; }
.work-task-meta strong { overflow:hidden; color:#405248; font-size:10px; font-weight:650; text-overflow:ellipsis; white-space:nowrap; }
.work-task-meta .work-meta-overdue { color:#c02626; }
.work-meta-progress>div:first-child { display:flex; justify-content:space-between; gap:8px; }
.work-progress-track { height:5px; overflow:hidden; margin-top:7px; border-radius:99px; background:#e9efeb; }
.work-progress-track span { display:block; height:100%; border-radius:inherit; background:#5ca77a; transition:width .2s; }
.work-progress-track span.is-complete { background:#15803d; }
.work-deadline-note { display:flex; align-items:center; gap:6px; margin-top:10px; color:#9a6709; font-size:10px; font-weight:650; }
.work-deadline-note.is-urgent { color:#c32727; }
.work-deadline-blink { animation:work-deadline-pulse 1.35s ease-in-out infinite; }
@keyframes work-deadline-pulse { 50% { opacity:.48; } }
.work-task-actions { display:flex; align-items:center; gap:7px; }
.work-row-order-cell{display:flex;align-items:center;justify-content:center;gap:4px}
.work-row-select{display:inline-flex;align-items:center;justify-content:center;min-width:16px;min-height:24px;cursor:pointer}
.work-row-select input{width:15px;height:15px;margin:0;accent-color:#28734a;cursor:pointer}
.work-row-select input:disabled{cursor:not-allowed;opacity:.45}
.work-bulk-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin:-4px 22px 12px;padding:8px 11px;border:1px solid #f0d8d5;border-radius:10px;background:#fff9f8;color:#7b342d;font-size:11px;font-weight:700}
.work-bulk-actions button{border:1px solid #e8c2bd;border-radius:7px;padding:6px 10px;background:#fff;color:#a52b20;font-size:10px;font-weight:750}
.work-bulk-actions button:hover{background:#fff0ee}
.work-detail-button,.work-finish-button { display:inline-flex; min-height:36px; align-items:center; justify-content:center; gap:5px; border:1px solid #dce7df; border-radius:9px; padding:7px 10px; color:#4d6254; background:#fff; font-size:10px; font-weight:700; white-space:nowrap; }
.work-detail-button:hover { color:#075337; border-color:#9bc5a9; background:#f4faf5; }
.work-finish-button { color:#fff; border-color:#087044; background:#087044; }
.work-finish-button:hover { background:#075337; box-shadow:0 4px 12px #07533722; }
.work-list-empty { display:flex; flex-direction:column; align-items:center; gap:7px; padding:40px 16px 44px; color:#839087; font-size:11px; }
.work-list-empty strong { color:#344b3c; font-size:13px; }
.work-empty-icon { display:grid; width:42px; height:42px; place-items:center; border-radius:15px; color:#3d8d5e; background:#ebf6ee; font-size:19px; }
.work-calendar-section { padding-bottom:18px; }
.work-calendar-heading { align-items:flex-start; }
.work-calendar-controls { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:7px; }
.work-calendar-controls select,.work-calendar-controls button { min-height:34px; border:1px solid #dce6df; border-radius:9px; padding:7px 9px; color:#4b5d51; background:#fff; font-size:10px; }
.work-calendar-controls button { font-weight:650; }
.work-calendar-controls button:hover { border-color:#a9cbb4; color:#075337; background:#f4faf5; }
.work-calendar-controls #work-calendar-title { min-width:120px; color:#355242; font-size:11px; font-weight:700; text-align:center; }
.work-calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); margin:0 20px; overflow:hidden; border:1px solid #e3ebe5; border-radius:13px; }
.work-calendar-weekday { padding:9px 7px; color:#738178; background:#f7faf7; font-size:9px; font-weight:750; text-align:center; }
.work-calendar-day { min-width:0; min-height:112px; padding:8px; border-top:1px solid #e8eee9; border-right:1px solid #e8eee9; background:#fff; }
.work-calendar-day.is-outside { background:#fafcfb; }
.work-calendar-day.is-today { background:#f1faf4; box-shadow:inset 0 0 0 1px #6caf83; }
.work-calendar-date { display:grid; width:24px; height:24px; place-items:center; border-radius:8px; color:#57675c; font-size:10px; font-weight:700; }
.work-calendar-day.is-today .work-calendar-date { color:#fff; background:#16804d; }
.work-calendar-items { display:grid; gap:4px; margin-top:5px; }
.work-calendar-task { display:-webkit-box; overflow:hidden; width:100%; border-left:2px solid #4c9a6c; border-radius:4px; padding:4px 5px; color:#2e6444; background:#edf7f0; font-size:9px; line-height:1.35; text-align:left; text-overflow:ellipsis; white-space:normal; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.work-calendar-task:hover { background:#dff0e4; }
.work-calendar-task.is-due { border-color:#d53d35; color:#a52c28; background:#fff0ee; }
.work-calendar-more { color:#76857a; font-size:9px; }
@media (max-width:1100px) {
 .work-kpi-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .work-task-meta { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .work-calendar-heading { flex-direction:column; }
 .work-calendar-controls { justify-content:flex-start; }
}
@media (max-width:767px) {
 .work-page { padding:0 0 22px; }
 .work-page-header { min-height:0; align-items:center; flex-direction:row; gap:10px; padding:10px 12px; border-radius:12px; }
 .work-page-heading { flex:1; gap:8px; }
 .work-page-heading h1 { margin:0; font-size:17px; }
 .work-page-heading p { display:none; }
 .work-eyebrow { gap:5px; padding:4px 6px; font-size:8px; }
 .work-eyebrow-dot { width:5px; height:5px; }
 .work-header-controls { width:auto; justify-content:flex-end; gap:5px; }
 .work-alert-setting { order:0; gap:4px; padding:4px 6px; font-size:9px; }
 .work-alert-setting select { padding:4px; }
 .work-primary-button,.work-refresh-button { min-height:32px; gap:4px; padding:6px 8px; font-size:10px; }
 .work-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
 .work-kpi-card { min-height:78px; gap:9px; padding:12px 10px; border-radius:14px; }
 .work-kpi-icon { width:33px; height:33px; flex-basis:33px; border-radius:11px; font-size:17px; }
 .work-kpi-label { font-size:9px; }
 .work-kpi-value { font-size:22px; }
 .work-form-panel { padding:16px; }
 .work-create-grid { grid-template-columns:1fr; gap:11px; }
 .work-field-wide,.work-form-actions,.work-form-error { grid-column:1; }
 .work-task-section-heading,.work-calendar-heading { align-items:flex-start; padding:17px 15px 14px; }
 .work-task-heading-actions { gap:7px; }
 .work-filter-toolbar { grid-template-columns:1fr 1fr; margin:0 14px 12px; padding:9px; }
 .work-bulk-actions{margin:0 14px 10px}
 .work-search-box { grid-column:1/-1; }
 .work-task-list { gap:9px; padding:0 12px 15px; }
 .work-task-card { grid-template-columns:1fr; gap:12px; padding:14px; }
 .work-task-card-heading { align-items:flex-start; }
 .work-task-title-block { align-items:flex-start; flex-direction:column; gap:5px; }
 .work-task-title { overflow:visible; white-space:normal; line-height:1.4; }
 .work-task-meta { gap:11px 8px; }
 .work-task-actions { justify-content:flex-end; }
 .work-detail-button,.work-finish-button { min-height:39px; }
 .work-calendar-controls { gap:5px; }
 .work-calendar-controls select { max-width:calc(50vw - 24px); }
 .work-calendar-controls #work-calendar-title { min-width:100px; }
 .work-calendar-grid { min-width:700px; margin:0 12px; }
 .work-calendar-section { overflow-x:auto; }
 .work-calendar-heading { position:sticky; left:0; width:calc(100vw - 32px); }
 .work-calendar-day { min-height:92px; padding:6px; }
}
@media (max-width:390px) {
 .work-kpi-card { align-items:flex-start; flex-direction:column; gap:7px; }
 .work-filter-toolbar { grid-template-columns:1fr; }
 .work-search-box { grid-column:auto; }
 .work-task-meta { grid-template-columns:1fr 1fr; }
 .work-finish-button span { display:none; }
}
@media (prefers-reduced-motion:reduce) { .work-deadline-blink { animation:none; } }

/* Work sub-tabs, compact numbered rows and paging */
.work-subtabs { display:flex; align-items:center; gap:5px; width:max-content; max-width:100%; padding:5px; border:1px solid #e2ebe4; border-radius:13px; background:#fff; box-shadow:0 3px 12px #173d2a08; }
.work-subtabs button { min-height:36px; border:0; border-radius:9px; padding:8px 14px; color:#64756a; background:transparent; font-size:11px; font-weight:700; white-space:nowrap; }
.work-subtabs button[aria-selected=true] { color:#fff; background:#075337; box-shadow:0 3px 9px #07533722; }
.work-subtabs button:focus-visible { outline-offset:2px; }
.work-task-columns,.work-task-row { display:grid; grid-template-columns:48px minmax(260px,2fr) minmax(120px,.85fr) minmax(120px,.85fr) minmax(98px,.65fr) minmax(110px,.7fr) minmax(115px,.75fr) minmax(145px,1fr); align-items:center; gap:9px; }
.work-task-columns { margin:0 20px 4px; border:0; border-radius:8px; padding:7px 10px; color:#68776d; background:#f4f7f5; font-size:9px; font-weight:750; letter-spacing:.025em; }
.work-task-columns span:first-child { text-align:center; }
.work-task-list { display:grid; gap:4px; padding:0 20px; }
.work-task-row { min-height:58px; padding:7px 9px; border:1px solid #e7ede8; border-radius:9px; color:#435349; background:#fff; transition:border-color .15s,background .15s,box-shadow .15s; }
.work-task-row:hover { border-color:#c9ddd0; background:#fcfefc; box-shadow:0 2px 9px #173d2a0a; }
.work-row-order { display:grid; width:25px; height:25px; place-items:center; border-radius:8px; color:#628070; background:#f0f5f1; font-size:10px; font-weight:750; }
.work-row-title-cell { min-width:0; }
.work-row-mobile-assignees { display:none; }
.work-row-title-line { display:flex; min-width:0; align-items:center; gap:7px; flex-wrap:wrap; }
.work-row-title-line .work-task-title { flex:0 1 auto; min-width:0; font-size:12px; line-height:1.35; }
.work-row-classification-line { display:flex; min-width:0; align-items:center; flex-wrap:wrap; gap:6px; margin-top:4px; }
.work-row-classification-line .work-report-category { white-space:normal; }
.work-report-category,.monthly-report-auto-badge { display:inline-flex; align-items:center; border:1px solid #d7e9dd; border-radius:999px; padding:3px 7px; color:#276242; background:#f1f8f3; font-size:8px; font-weight:700; line-height:1.2; white-space:nowrap; }
.work-report-category { font-family:inherit; cursor:default; }
.work-report-category.is-clickable,.work-priority-chip:not(:disabled) { cursor:pointer; }
.work-report-category.is-clickable:hover,.work-report-category.is-clickable:focus-visible { border-color:#9bc5a9; outline:0; background:#eaf5ed; }
.work-priority-chip:not(:disabled):hover,.work-priority-chip:not(:disabled):focus-visible { outline:2px solid #9bc5a9; outline-offset:1px; }
.work-priority-chip:disabled,.work-report-category:disabled { opacity:1; }
.monthly-report-auto-badge { border-color:#dbe6f3; color:#476587; background:#f3f7fc; }
.work-meta-picker-options { display:grid; gap:6px; }
.work-meta-picker-option { display:flex; align-items:flex-start; gap:10px; border:1px solid #e3ebe5; border-radius:10px; padding:10px 12px; color:#34483b; background:#fff; cursor:pointer; font-size:11px; }
.work-meta-picker-option:has(input:checked) { border-color:#6eaa83; background:#f1f8f3; color:#1d5d38; font-weight:700; }
.work-meta-picker-option input { margin-top:2px; accent-color:#176c3c; }
.work-row-subtitle { display:-webkit-box; overflow:hidden; margin-top:3px; color:#77847b; font-size:9px; line-height:1.35; text-overflow:ellipsis; white-space:normal; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.work-row-assignee { min-width:0; overflow:hidden; border:1px solid transparent; border-radius:7px; padding:4px 6px; color:#8a958d; background:#f7f9f7; font:inherit; font-size:10px; text-align:left; text-overflow:ellipsis; white-space:nowrap; }
.work-row-assignee.is-clickable { cursor:pointer; }
.work-row-assignee.is-clickable:hover,.work-row-assignee.is-clickable:focus-visible { border-color:#9bc5a9; outline:0; background:#eaf5ed; }
.work-row-assignee:disabled { cursor:default; }
.work-row-assignee.is-assigned { border-color:#e1eee4; color:#215b3a; background:#f0f7f2; font-weight:700; }
.work-row-due { color:#4e6255; font-size:10px; font-weight:650; white-space:nowrap; }
.work-row-due small { display:block; margin-top:2px; color:#9b6a12; font-size:9px; font-weight:600; }
.work-row-due.is-urgent,.work-row-due.is-urgent small { color:#bf2929; }
.work-row-due.is-clickable { position:relative; }
.work-row-due-button { border:1px solid transparent; border-radius:6px; padding:2px 4px; color:inherit; background:transparent; font:inherit; text-align:left; cursor:pointer; }
.work-row-due-button:hover,.work-row-due-button:focus-visible { border-color:#9bc5a9; outline:0; background:#eaf5ed; }
.work-due-calendar { position:fixed; z-index:1000; width:272px; max-width:calc(100vw - 16px); padding:12px; border:1px solid #d9e4dc; border-radius:12px; color:#183d2a; background:#fff; box-shadow:0 12px 32px rgba(18,52,34,.2); font-size:12px; }
.work-due-calendar button { cursor:pointer; }
.work-due-calendar-heading,.work-due-calendar-nav,.work-due-calendar-footer { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.work-due-calendar-heading { margin-bottom:10px; font-size:13px; }
.work-due-calendar-heading button { width:26px; height:26px; border:0; border-radius:6px; color:#52695a; background:transparent; font-size:20px; line-height:1; }
.work-due-calendar-nav { margin-bottom:8px; }
.work-due-calendar-nav button { width:30px; height:30px; border:1px solid #e1e9e3; border-radius:7px; color:#215b3a; background:#f7faf7; font-size:20px; line-height:1; }
.work-due-calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; }
.work-due-calendar-weekdays { margin-bottom:3px; color:#718176; text-align:center; font-size:10px; font-weight:700; }
.work-due-calendar-weekdays span { padding:5px 0; }
.work-due-calendar-day { min-height:30px; border:1px solid transparent; border-radius:7px; color:#294c37; background:#fff; font:inherit; }
.work-due-calendar-day:not(:disabled):hover,.work-due-calendar-day:focus-visible { border-color:#9bc5a9; outline:0; background:#eaf5ed; }
.work-due-calendar-day.is-selected { color:#fff; background:#17613b; font-weight:700; }
.work-due-calendar-day.is-outside { color:#bbc5bd; }
.work-due-calendar-day:disabled { cursor:default; }
.work-due-calendar-footer { margin-top:10px; padding-top:8px; border-top:1px solid #edf1ed; color:#748176; font-size:10px; }
.work-due-calendar-footer button { border:0; padding:5px 7px; border-radius:6px; color:#a32b2b; background:#fff2f2; font:inherit; font-weight:700; }
.work-due-calendar-footer button:disabled { opacity:.45; cursor:default; }
.work-row-progress { display:flex; min-width:0; align-items:center; gap:7px; color:#4c6254; font-size:10px; }
.work-row-progress>strong { font-size:10px; font-weight:700; }
.work-progress-menu-wrap { position:relative; display:inline-flex; min-width:0; }
.work-progress-status-button { max-width:100%; overflow:hidden; border:0; padding:4px 7px; font:inherit; font-weight:700; text-align:left; text-overflow:ellipsis; cursor:pointer; }
.work-progress-status-button:disabled { cursor:default; }
.work-task-row button.work-status-chip { border:0; font:inherit; cursor:pointer; }
.work-task-row button.work-status-chip:disabled { cursor:default; }
.work-progress-status-menu { position:absolute; top:calc(100% + 5px); left:0; z-index:35; display:grid; min-width:165px; overflow:hidden; border:1px solid #dce7df; border-radius:11px; padding:4px; background:#fff; box-shadow:0 12px 30px #173d2a24; }
.work-progress-status-menu button { display:flex; align-items:center; gap:7px; border:0; border-radius:7px; padding:8px 9px; color:#3f5548; background:transparent; font-size:10px; font-weight:650; text-align:left; white-space:nowrap; cursor:pointer; }
.work-progress-status-menu button:hover,.work-progress-status-menu button:focus-visible { outline:0; color:#075337; background:#eef7f0; }
.work-progress-status-menu button[aria-current=true] { color:#075337; background:#eef7f0; }
.work-mobile-status-host { display:none; }
.work-row-progress-dot { width:8px; height:8px; flex:none; border-radius:50%; background:#5e9a72; box-shadow:0 0 0 3px #eaf4ed; }
.work-row-progress-dot.is-complete { background:#1b7a4b; box-shadow:0 0 0 3px #dff1e5; }
.work-row-mobile-status { display:none; }
.work-task-row .work-status-chip { padding:4px 7px; font-size:8px; }
.work-task-row .work-task-actions { flex-wrap:wrap; justify-content:flex-end; gap:5px; }
.work-row-attachments { display:flex; min-width:0; flex-direction:column; align-items:flex-start; gap:3px; }
.work-attachment-preview-link { display:block; max-width:100%; overflow:hidden; border:0; padding:1px 0; color:#17643e; background:transparent; font-size:9px; font-weight:700; text-align:left; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
.work-attachment-preview-link:hover { color:#0a4229; text-decoration:underline; }
.work-attachment-preview-empty { color:#a0aaa3; font-size:10px; }
.work-attachment-upload-button { display:inline-flex; min-height:22px; width:max-content; align-items:center; justify-content:center; border:1px solid #cfe2d4; border-radius:7px; padding:3px 7px; color:#17643e; background:#f2f8f4; font-size:9px; font-weight:750; white-space:nowrap; cursor:pointer; }
.work-attachment-upload-button:hover { border-color:#8db89a; background:#e8f4ec; }
.work-attachment-type-panel { width:min(460px,100%); overflow:hidden; border:1px solid #e1e9e3; border-radius:17px; background:#fff; box-shadow:0 24px 80px #02061755; }
.work-attachment-type-panel>header { display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid #e8eee9; padding:15px 17px; background:#f8fbf8; }
.work-attachment-type-panel h2 { margin:2px 0 0; color:#173d2a; font-size:15px; font-weight:750; }
.work-attachment-type-panel>header button { width:30px; height:30px; border:1px solid #dce6df; border-radius:9px; color:#52675a; background:#fff; }
.work-attachment-type-options { display:grid; gap:9px; padding:16px 17px 9px; }
.work-attachment-type-options button { display:grid; gap:4px; border:1px solid #dce7df; border-radius:11px; padding:11px 13px; color:#375343; background:#fff; text-align:left; cursor:pointer; }
.work-attachment-type-options button:hover,.work-attachment-type-options button:focus-visible { border-color:#83b995; outline:0; background:#f1f8f3; }
.work-attachment-type-options strong { color:#17643e; font-size:12px; }
.work-attachment-type-options span,.work-attachment-type-panel>p { color:#718077; font-size:10px; }
.work-attachment-finish-option { grid-column:1/-1; display:flex; align-items:flex-start; gap:9px; border:1px solid #dce7df; border-radius:10px; padding:9px 11px; color:#375343; background:#f8fbf8; cursor:pointer; }
.work-attachment-finish-option input { width:16px; height:16px; flex:none; margin:1px 0 0; accent-color:#176c3c; }
.work-attachment-finish-option span { display:grid; gap:3px; }
.work-attachment-finish-option strong { color:#17643e; font-size:11px; }
.work-attachment-finish-option small { color:#718077; font-size:9px; line-height:1.4; }
.work-attachment-type-panel>p { margin:0; padding:0 17px 15px; }
.work-attachment-complete-panel { display:grid; justify-items:center; gap:8px; width:min(420px,100%); border:1px solid #dce7df; border-radius:18px; padding:23px; background:#fff; text-align:center; box-shadow:0 24px 80px #02061755; }
.work-attachment-complete-icon { display:grid; width:44px; height:44px; place-items:center; border-radius:15px; color:#147044; background:#e9f7ee; font-size:24px; font-weight:800; }
.work-attachment-complete-panel h2 { margin:0; color:#173d2a; font-size:16px; font-weight:750; }
.work-attachment-complete-panel p { margin:0; color:#4e6255; font-size:12px; }
.work-attachment-complete-panel>strong { max-width:100%; overflow-wrap:anywhere; color:#284c36; font-size:11px; }
.work-attachment-complete-panel>span { max-width:100%; overflow-wrap:anywhere; color:#718077; font-size:10px; }
.work-attachment-complete-panel>button { margin-top:7px; }
.work-task-row .work-detail-button,.work-task-row .work-finish-button { min-height:29px; padding:5px 7px; font-size:9px; }
.work-pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:7px; border-top:1px solid #edf1ee; padding:10px 20px 14px; color:#718077; font-size:10px; }
.work-page-size { display:flex; align-items:center; gap:6px; }
.work-page-size select { border:1px solid #dce6df; border-radius:7px; padding:5px 7px; color:#43594b; background:white; font-size:10px; }
.work-page-info { margin-left:auto; }
.work-page-buttons { display:flex; align-items:center; gap:8px; color:#52675a; font-size:10px; font-weight:650; }
.work-page-buttons button { display:grid; width:28px; height:28px; place-items:center; border:1px solid #dce6df; border-radius:8px; color:#365844; background:#fff; font-size:17px; }
.work-page-buttons button:hover:not(:disabled) { border-color:#8db89a; background:#f1f8f3; }
.work-page-buttons button:disabled { cursor:not-allowed; opacity:.4; }
.work-assignee-picker { min-width:0; }
.work-assignee-picker-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; color:#6c7b70; font-size:10px; }
.work-assignee-picker-heading button { border:1px solid #cfe2d4; border-radius:8px; padding:6px 9px; color:#17643e; background:#f2f8f4; font-size:10px; font-weight:700; white-space:nowrap; }
.work-assignee-picker-heading button:hover { border-color:#90bf9e; background:#e8f4ec; }
.work-assignee-picker-columns { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.work-assignee-picker-columns label { display:flex; min-width:0; flex-direction:column; gap:5px; color:#496052; font-size:10px; font-weight:700; }
.work-assignee-picker-columns select { width:100%; min-height:38px; border:1px solid #dce6df; border-radius:9px; padding:8px 10px; color:#34483b; background:#fff; font-size:11px; font-weight:450; }
.work-assignee-picker-columns select:focus { border-color:#62a27e; outline:0; box-shadow:0 0 0 3px #16804d14; }
.work-row-edit { display:inline-flex; min-height:29px; align-items:center; justify-content:center; border:1px solid #d6e5da; border-radius:8px; padding:5px 8px; color:#17643e; background:#f2f8f4; font-size:9px; font-weight:700; white-space:nowrap; }
.work-row-edit:hover { border-color:#8db89a; background:#e8f4ec; }
.work-task-columns,.work-task-row { grid-template-columns:56px minmax(210px,1.6fr) minmax(110px,.8fr) minmax(110px,.8fr) minmax(128px,.8fr) minmax(80px,.5fr) minmax(88px,.55fr) minmax(190px,auto); }
@media (max-width:1100px) {
 .work-task-columns,.work-task-row { grid-template-columns:52px minmax(150px,1.35fr) minmax(90px,.75fr) minmax(90px,.75fr) minmax(110px,.8fr) minmax(70px,.5fr) minmax(80px,.55fr) minmax(160px,auto); gap:7px; }
 .work-task-list { padding-inline:12px; }
 .work-task-columns { font-size:8px; }
 .work-task-row .work-detail-button,.work-task-row .work-finish-button { padding-inline:5px; }
}
@media (max-width:850px) {
 .work-task-columns { display:none; }
 .work-task-row { grid-template-columns:52px minmax(0,1fr) minmax(95px,auto) auto; gap:8px; min-height:62px; padding:8px 4px; }
 .work-task-row>.work-row-assignee,.work-row-progress { display:none; }
 .work-status-mobile { display:inline-flex; }
 .work-row-title-line { flex-wrap:wrap; }
 .work-row-mobile-status { display:inline-flex; }
 .work-mobile-status-host { display:inline-flex; }
 .work-task-row .work-task-actions { grid-column:4; grid-row:1/3; justify-content:flex-end; }
 .work-row-due { grid-column:3; grid-row:1/3; font-size:9px; }
 .work-row-title-cell { grid-column:2; grid-row:1/3; }
 .work-row-mobile-assignees { display:flex; flex-wrap:wrap; gap:3px 10px; margin-top:3px; color:#52695a; font-size:9px; line-height:1.4; }
 .work-row-mobile-assignees span { display:flex; max-width:100%; min-width:0; align-items:center; gap:3px; }
 .work-row-mobile-assignees .work-row-assignee { display:inline-block; max-width:min(62vw,270px); padding:1px 3px; color:#215b3a; background:transparent; font-size:9px; }
 .work-task-row .work-row-attachments { grid-column:2; grid-row:3; flex-direction:row; align-items:center; }
 .work-task-row .work-task-actions { grid-column:4; grid-row:1/4; }
 .work-row-subtitle { white-space:normal; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:1; }
 .work-pagination { padding-inline:14px; }
}
@media (max-width:520px) {
 .work-subtabs { width:100%; }
 .work-subtabs button { flex:1; }
 .work-task-section-heading { align-items:center; }
 .work-task-heading-actions { flex-direction:column-reverse; align-items:flex-end; gap:5px; }
 .work-task-section-heading h2 { font-size:16px; }
 .work-task-section-heading p { font-size:10px; }
 .work-filter-toolbar { grid-template-columns:1fr; }
 .work-search-box { grid-column:auto; }
 .work-task-row { grid-template-columns:52px minmax(0,1fr); gap:6px; }
 .work-row-title-cell { grid-column:2; grid-row:1; padding:0; }
 .work-row-title-line { padding-right:0; }
 .work-task-row .work-task-actions { grid-column:2; grid-row:3; justify-content:flex-start; }
 .work-task-row .work-task-actions { flex-wrap:wrap; }
 .work-row-due { grid-column:2; grid-row:2; margin-top:1px; }
 .work-task-row .work-row-attachments { grid-column:2; grid-row:3; }
 .work-task-row .work-task-actions { grid-column:2; grid-row:4; }
 .work-task-row .work-detail-button,.work-task-row .work-finish-button { min-height:28px; }
 .work-pagination { flex-wrap:wrap; gap:8px; }
 .work-page-info { order:3; width:100%; margin-left:0; }
 .work-page-buttons { margin-left:auto; }
}

.work-attachment-preview-panel { display:flex; width:min(1100px,100%); height:min(90vh,900px); flex-direction:column; overflow:hidden; border-radius:16px; background:#fff; box-shadow:0 24px 80px #02061755; }
.work-attachment-preview-header { display:flex; flex-wrap:nowrap; min-width:0; min-height:48px; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid #e5ece7; padding:10px 16px; color:#234532; font-size:13px; }
.work-attachment-preview-header strong { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.work-attachment-preview-header button { display:grid; width:30px; height:30px; flex:none; place-items:center; border-radius:8px; color:#53645a; background:#f1f5f2; }
.work-attachment-preview-actions { display:flex; flex:0 0 auto; flex-direction:row; align-items:center; gap:6px; white-space:nowrap; }
.work-attachment-preview-header .work-attachment-preview-action { display:inline-flex; flex:0 0 auto; width:auto; min-width:76px; height:32px; align-items:center; justify-content:center; gap:6px; padding:0 10px; border:1px solid #d8e3dc; color:#24543b; background:#f7faf8; font-size:11px; font-weight:650; white-space:nowrap; }
.work-attachment-preview-header .work-attachment-preview-action:hover:not(:disabled) { color:#fff; border-color:#005a32; background:#005a32; }
.work-attachment-preview-header .work-attachment-preview-action:disabled { cursor:not-allowed; opacity:.45; }
.work-attachment-preview-action svg { width:14px; height:14px; }
.work-attachment-preview-content { min-height:0; flex:1; overflow:auto; background:#f3f5f4; }
.work-attachment-preview-content iframe { width:100%; height:100%; border:0; background:#fff; }
.work-attachment-preview-content img { display:block; max-width:100%; max-height:100%; margin:auto; object-fit:contain; }
.work-attachment-preview-content pre { min-height:100%; margin:0; padding:20px; color:#26382d; background:#fff; font:12px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace; white-space:pre-wrap; overflow-wrap:anywhere; }
@media(max-width:520px) { .work-attachment-preview-panel { height:94vh; border-radius:12px; } .work-attachment-preview-header { gap:6px; padding:8px 10px; } .work-attachment-preview-header .work-attachment-preview-action { min-width:0; height:30px; gap:4px; padding:0 7px; font-size:10px; } .work-attachment-preview-content pre { padding:14px; font-size:11px; } }
@media (max-width:390px) { .work-assignee-picker-columns { grid-template-columns:1fr; } }
@media (max-width:520px) { .work-assignee-modal-form .work-assignee-picker-columns { grid-template-columns:1fr; } }

.work-assignee-picker-columns.is-single { grid-template-columns:1fr; }
.work-assignee-group { min-width:0; overflow:hidden; border:1px solid #e3ebe5; border-radius:11px; background:#fbfdfb; }
.work-assignee-group h3 { margin:0; padding:8px 10px; border-bottom:1px solid #e9efea; color:#385b45; font-size:10px; font-weight:750; }
.work-assignee-options { display:grid; max-height:180px; gap:2px; overflow:auto; padding:5px; }
.work-assignee-picker-columns .work-assignee-option,.work-assignee-self { display:flex; flex-direction:row; align-items:center; gap:8px; min-width:0; margin:0; border-radius:7px; padding:6px 7px; color:#405649; font-size:10px; font-weight:550; cursor:pointer; }
.work-assignee-picker-columns .work-assignee-option:hover,.work-assignee-self:hover { background:#f0f7f2; }
.work-assignee-picker-columns .work-assignee-option.is-disabled { opacity:.48; cursor:not-allowed; }
.work-assignee-picker-columns .work-assignee-option.is-disabled:hover { background:transparent; }
.work-assignee-option input,.work-assignee-self input { flex:0 0 auto; width:15px; height:15px; margin:0; accent-color:#187348; }
.work-assignee-option span,.work-assignee-self span { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.work-assignee-option span small { display:block; color:#8c968e; font-size:8px; font-weight:500; }
.work-assignee-picker-heading { align-items:flex-start; }
.work-assignee-picker-heading .work-assignee-self { border:1px solid #dce9df; background:#f6faf7; }
.work-assignee-none { padding:8px; color:#869289; font-size:10px; }
.work-assignee-modal-panel { width:min(720px,100%); max-height:min(90vh,780px); overflow:auto; border:1px solid #e1e9e3; border-radius:18px; background:#fff; box-shadow:0 24px 80px #02061755; }
.work-assignee-modal-panel>header { display:flex; align-items:center; justify-content:space-between; gap:14px; border-bottom:1px solid #e8eee9; padding:14px 18px; background:#f8fbf8; }
.work-assignee-modal-panel>header p { margin:3px 0 0; color:#4d6254; font-size:11px; font-weight:650; }
.work-assignee-modal-panel>header button { width:30px; height:30px; border:1px solid #dce6df; border-radius:9px; color:#52675a; background:#fff; }
.work-assignee-modal-form { display:grid; gap:14px; padding:18px; }
.work-assignee-modal-form h2 { margin:2px 0 3px; color:#173d2a; font-size:16px; font-weight:750; }
.work-assignee-modal-form p { margin:0; color:#718077; font-size:11px; }
.work-assignee-modal-form .work-assignee-picker-columns { grid-template-columns:repeat(2,minmax(0,1fr)); }
.work-assignee-current { margin-top:9px; border-radius:9px; padding:9px 10px; color:#385b45; background:#f1f8f3; font-size:10px; }
.work-assignee-modal-form footer { display:flex; justify-content:flex-end; gap:8px; border-top:1px solid #edf1ee; padding-top:12px; }

/* Compact, fully readable diagnostics. Keep the composer within the viewport. */
.job-progress { margin-top:5px; min-width:0; font-size:11px; line-height:1.3; color:#475569; }
.job-progress-summary { cursor:pointer; padding:3px 0; color:#475569; overflow-wrap:anywhere; }
.job-progress-summary:focus-visible,.job-progress-body:focus-visible { outline:2px solid #60a5fa; outline-offset:2px; }
.job-progress-summary span { font-weight:400; color:#64748b; }
.job-progress-body { max-height:min(36vh,280px); overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; padding:2px 5px 2px 0; min-width:0; }
.job-progress-stage { padding:4px 0; border-bottom:1px solid #e2e8f0; }
.job-progress-stage-head,.job-progress-total { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.job-progress-stage-head strong { min-width:0; font-weight:600; color:#334155; overflow-wrap:anywhere; }
.job-progress-stage-head>span,.job-progress-total>span:last-child { flex-shrink:0; text-align:right; font-variant-numeric:tabular-nums; }
.job-progress-description { color:#64748b; margin:1px 0 2px; overflow-wrap:anywhere; }
.job-progress-line { margin:1px 0; padding-left:8px; overflow-wrap:anywhere; white-space:normal; line-height:1.3; }
.job-progress-line>span { display:block; }
.job-progress-call-title { font-weight:500; color:#334155; }
.job-progress-error { color:#9a3412; }
.job-progress-total { padding-top:3px; }
.job-progress .job-progress-note { margin:3px 0 0; padding:0; font-size:10px; line-height:1.3; }
.job-progress ul,.job-progress ol { margin:2px 0; padding-left:14px; }
.job-progress li { padding:1px 0; margin:0; line-height:1.3; overflow-wrap:anywhere; }
@media(max-width:480px) {
 .job-progress-body { max-height:min(30dvh,220px); }
 .job-progress-stage-head { display:grid; grid-template-columns:minmax(0,1fr); gap:1px; }
 .job-progress-stage-head>span { text-align:left; color:#64748b; }
}
.job-progress-stage-time { margin-top:1px; text-align:right; color:#64748b; font-size:10px; font-variant-numeric:tabular-nums; }
.chat-job-status { max-height:min(45dvh,420px); overflow:auto; overscroll-behavior:contain; }
.chat-job-status:has(details[open] ~ details[open]) .job-progress-body { max-height:min(16dvh,150px); }

/* Monthly report ledger */
#work-panel-report{width:100%;min-width:0;max-width:100%;overflow-x:hidden}
.monthly-report-panel{width:100%;min-width:0;max-width:100%;box-sizing:border-box;border:1px solid #e1eae4;border-radius:20px;background:#fff;box-shadow:0 4px 16px #183b2910;overflow:hidden}
.monthly-report-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:21px 22px 17px}
.monthly-report-heading>div:first-child{min-width:0}
.monthly-report-heading h2{margin:0;color:#173b2b;font-size:20px;font-weight:750}
.monthly-report-heading p{margin:5px 0 0;color:#738279;font-size:13px}
.monthly-report-actions,.monthly-report-form-actions{display:flex;align-items:center;gap:8px}
.monthly-report-period{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) auto;align-items:end;gap:12px;padding:0 22px 18px}
.monthly-report-period label,.monthly-report-form-grid label{display:grid;gap:5px;color:#52645a;font-size:12px;font-weight:700}
.monthly-report-period input,.monthly-report-form-grid input,.monthly-report-form-grid select,.monthly-report-form-grid textarea{width:100%;border:1px solid #d8e2dc;border-radius:9px;padding:9px 10px;background:white;color:#25362c;font-size:13px;font-weight:400}
.monthly-report-entry-form{margin:0 22px 18px;border:1px solid #dce8df;border-radius:14px;background:#f8fbf9;padding:16px}
.monthly-report-form-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}
.monthly-report-wide{grid-column:span 2}
.monthly-report-form-actions{justify-content:flex-end;margin-top:12px}
.monthly-report-list-heading{display:flex;align-items:center;justify-content:space-between;border-top:1px solid #edf1ee;padding:15px 22px 9px}
.monthly-report-list-heading h3{margin:0;color:#233b2e;font-size:15px;font-weight:750}
.monthly-report-list-heading span{font-size:12px;color:#748278}
.monthly-report-entry-list{display:grid;gap:8px;padding:0 14px 16px}
.monthly-report-section-header{display:flex;align-items:center;gap:9px;margin-top:8px;border-bottom:1px solid #e3ebe5;padding:9px 2px 7px;color:#365745}
.monthly-report-section-header>span{display:grid;place-items:center;width:27px;height:27px;border-radius:8px;background:#eaf4ed;color:#1f6842;font-size:12px;font-weight:800}
.monthly-report-section-header>strong{font-size:13px;font-weight:800}
.monthly-report-section-header>small{margin-left:auto;color:#7b897f;font-size:11px;white-space:nowrap}
.monthly-report-section-group{width:100%;min-width:0;max-width:100%}
.monthly-report-section-table{width:100%;min-width:0;max-width:100%;overflow-x:hidden;border:1px solid #e7ede9;border-radius:9px;background:#fff}
.monthly-report-section-footer{display:flex;justify-content:flex-start;padding:3px 2px 0}
.monthly-report-add-button{border:0;border-radius:7px;padding:6px 10px;color:#286342;background:#f0f7f2;font-size:12px;font-weight:750;transition:background .15s,color .15s}
.monthly-report-add-button:hover{color:#174b30;background:#e2f0e7}
.monthly-report-add-button:focus-visible{outline:2px solid #80b597;outline-offset:2px}
.monthly-report-grid-columns,.monthly-report-row{display:grid;width:100%;max-width:100%;box-sizing:border-box;grid-template-columns:28px minmax(88px,.9fr) minmax(58px,.55fr) minmax(175px,2fr) minmax(62px,.65fr) minmax(62px,.65fr) minmax(92px,1fr) 32px minmax(96px,1fr) 58px;align-items:center;gap:4px;min-width:0}
.monthly-report-mobile-cell:not(.monthly-report-task-content):not(.monthly-report-row-category):not(.monthly-report-row-actions){display:contents}
.monthly-report-grid-columns{position:sticky;top:0;z-index:1;border-bottom:1px solid #e7ede9;padding:5px 6px;color:#718078;background:#f7faf8;font-size:9px;font-weight:750;letter-spacing:.015em;text-transform:uppercase;text-align:center}
.monthly-report-grid-columns>span{min-width:0;text-align:center;line-height:1.15;overflow-wrap:anywhere}
.monthly-report-section-empty{width:100%;min-width:0;padding:8px 12px 9px;color:#9aa59d;font-size:12px}
.monthly-report-row{min-height:38px;border-bottom:1px solid #edf1ee;padding:3px 7px;overflow:hidden}
.monthly-report-row:last-child{border-bottom:0}
.monthly-report-row-num{display:grid;place-items:center;width:26px;height:26px;border-radius:8px;background:#eef5f0;color:#337553;font-size:12px;font-weight:800}
.monthly-report-badge{border-radius:999px;background:#eff6f1;padding:3px 8px;color:#337553;font-size:10px;font-weight:750}
.monthly-report-cell{display:block;width:100%;max-width:100%;min-width:0;min-height:29px;box-sizing:border-box;border:1px solid transparent;border-radius:5px;padding:3px 4px;color:#304438;background:transparent;font:inherit;font-size:11px;line-height:1.3}
.monthly-report-cell[type=date]{min-width:0;padding-inline:1px;font-size:9px}
.monthly-report-cell:hover{border-color:#dbe7df;background:#fbfdfb}
.monthly-report-cell:focus{outline:2px solid #80b597;border-color:#80b597;background:#fff}
.monthly-report-cell:disabled{opacity:.78;cursor:not-allowed}
.monthly-report-cell.is-textarea{resize:none;overflow:hidden;white-space:pre-wrap}
.monthly-report-task-content{display:grid;min-width:0;gap:2px}
.monthly-report-row-category{display:grid;gap:3px}
.monthly-report-row-category select{font-size:11px}
.monthly-report-cvtx-heading{text-align:center}
.monthly-report-cvtx-cell{display:grid;place-items:center;min-height:27px}
.monthly-report-cvtx-cell input{width:14px;height:14px;margin:0;accent-color:#176c3c}
.monthly-report-custom-editor{min-height:25px;font-size:11px}
.monthly-report-row-actions{display:flex;min-width:0;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:4px}.monthly-report-row-actions button{max-width:100%;border:1px solid #dce7e0;border-radius:6px;padding:4px 5px;color:#286342;font-size:10px;font-weight:700;white-space:normal;overflow-wrap:anywhere}.monthly-report-row-actions button.is-delete{color:#b42318}
.monthly-report-save-status{color:#508262;font-size:10px;white-space:nowrap}
.monthly-report-cell-readonly{display:block;min-width:0;overflow-wrap:anywhere;color:#26382d;font-size:12px;line-height:1.35;white-space:normal}
.monthly-report-task-description{display:block;min-width:0;overflow-wrap:anywhere;color:#68776e;font-size:11px;line-height:1.3;white-space:normal}
.monthly-report-row.is-task-row{color:#78857d;background:#fcfdfc}
.monthly-report-row.is-task-row .monthly-report-auto-badge{display:inline-grid;place-items:center;justify-self:start;width:17px;height:17px;margin-left:3px;padding:0;font-size:10px;line-height:1}
.monthly-report-empty{padding:30px 12px;text-align:center;color:#75837a;font-size:12px}
#work-subtab-report[aria-selected="true"]{color:#fff}
@media(max-width:1200px){.monthly-report-period{grid-template-columns:repeat(2,minmax(0,1fr))}.monthly-report-period>button{grid-column:span 2}.monthly-report-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.monthly-report-heading{align-items:flex-start;flex-direction:column}.monthly-report-actions{width:100%}.monthly-report-period{grid-template-columns:1fr}.monthly-report-period>button{grid-column:auto}.monthly-report-form-grid{grid-template-columns:1fr}.monthly-report-wide{grid-column:auto}}
@media(max-width:1200px){
 .monthly-report-panel{border-radius:13px;box-shadow:none}
 .monthly-report-heading{padding:14px 14px 11px}
 .monthly-report-heading h2{font-size:17px}
 .monthly-report-heading p{max-width:58ch;font-size:11px;line-height:1.4}
 .monthly-report-actions{gap:6px}
 .monthly-report-actions button{flex:1;min-height:40px;padding:8px 9px;font-size:11px}
 .monthly-report-period{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 14px 13px}
 .monthly-report-period label{min-width:0;font-size:10px}
 .monthly-report-period input{min-height:39px;padding:7px;font-size:11px}
 .monthly-report-period>button{grid-column:1/-1;min-height:40px}
 .monthly-report-list-heading{padding:11px 14px 7px}
 .monthly-report-entry-list{gap:5px;padding:0 9px 12px}
 .monthly-report-section-header{gap:7px;margin-top:6px;padding:7px 2px 6px}
 .monthly-report-section-header>strong{font-size:12px;line-height:1.3}
 .monthly-report-section-header>small{font-size:10px}
 .monthly-report-section-table{overflow:visible;border:0;background:transparent}
 .monthly-report-grid-columns{display:none}
 .monthly-report-grid-columns,.monthly-report-row,.monthly-report-section-empty{width:100%;max-width:100%;min-width:0}
 .monthly-report-row{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:8px 10px;margin-bottom:6px;border:1px solid #e5ece7;border-radius:11px;padding:10px;background:#fff}
 .monthly-report-row-num{display:none}
 .monthly-report-mobile-cell:not(.monthly-report-task-content):not(.monthly-report-row-category):not(.monthly-report-row-actions){display:grid;min-width:0;gap:2px}
 .monthly-report-mobile-cell::before{content:attr(data-label);color:#718078;font-size:10px;font-weight:700;line-height:1.25}
 .monthly-report-mobile-cell[data-label="Nhóm"],.monthly-report-mobile-cell[data-label="Nội dung"],.monthly-report-mobile-cell[data-label="Tình hình thực hiện"],.monthly-report-mobile-cell[data-label="Ghi chú"],.monthly-report-mobile-cell[data-label="Thao tác"]{grid-column:1/-1}
 .monthly-report-row-category{min-width:0;gap:3px}
 .monthly-report-task-content{min-width:0;grid-template-columns:1fr;gap:2px}
 .monthly-report-cell{min-height:38px;border-color:#e7ede9;border-radius:7px;padding:7px 8px;background:#fff;font-size:13px}
 .monthly-report-cell:focus{outline-offset:0}
 .monthly-report-cvtx-cell{justify-content:start;min-height:35px}
 .monthly-report-cvtx-cell input{width:17px;height:17px}
 .monthly-report-row-actions{display:flex;justify-content:flex-start;min-height:34px}
 .monthly-report-row-actions button{min-height:32px;padding:6px 10px;font-size:10px}
 .monthly-report-section-footer{padding:2px 0 5px}
 .monthly-report-add-button{min-height:34px;padding:7px 10px;font-size:10px}
 .monthly-report-section-empty{padding:10px;border:1px dashed #e1e9e3;border-radius:9px;background:#fff}
 .monthly-report-entry-form{margin:0 12px 13px;padding:12px}
}
@media(max-width:390px){.monthly-report-period{grid-template-columns:1fr}.monthly-report-period>button{grid-column:auto}}

/* Keep the mobile identity and status rows compact so chat gets more height. */
@media (max-width:767px) {
    #app-header { padding-top:max(6px,env(safe-area-inset-top)); padding-bottom:6px; }
    #mobile-status-bar { height:44px; min-height:44px; box-sizing:border-box; padding:2px 12px; }
    #mobile-status-bar label, #btn-mobile-auth,
    #mobile-status-bar > div:nth-child(2) { min-height:40px; }
}

@media (max-width:359px) {
    #mobile-status-bar { height:auto; min-height:44px; }
}

/* Short mobile viewports must keep the composer above the fold. */
@media (max-width:767px) and (max-height:520px) {
    #mobile-status-bar { display:none !important; }
    #messages-container .welcome-screen { padding:8px 10px; }
    #messages-container .welcome-screen > p { display:none; }
    #chat-composer { padding-top:6px; padding-bottom:max(6px,env(safe-area-inset-bottom)); }
}
