/*===========================================
    COURTCHECK MAIN STYLE SHEET
=============================================*/

/*===========================================
    RESET
=============================================*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/*===========================================
    COLORS
=============================================*/

:root{
    --primary:#173B57;
    --primary-dark:#102B40;
    --background:#F4F6F8;
    --card:#FFFFFF;
    --border:#D8DDE3;
    --text:#1F2933;
    --text-light:#6B7785;
    --success:#1F8A4D;
    --warning:#D58C00;
    --danger:#C53939;
}

/*===========================================
    BODY
=============================================*/

body{
    font-family:Arial, Helvetica, sans-serif;
    background:var(--background);
    color:var(--text);
}

/*===========================================
    HEADER
=============================================*/

.app-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:20px;
    background:var(--primary);
    color:white;
}

.app-title-area h1{
    font-size:34px;
}

.app-subtitle{
    margin-top:5px;
    opacity:.85;
}

.session-information{
    text-align:right;
}
/*===========================================
    NAVIGATION
=============================================*/

.main-navigation{
    display:flex;
    gap:10px;
    padding:15px;
    background:white;
    border-bottom:1px solid var(--border);
}
.navigation-button{
  
    padding: 10px 18px;
    border: none;
    border-radius:8px;
    background:white;
    cursor:pointer; 
    font-weight:bold;
}

.navigation-button:hover{

    background:#ECECEC;
}

.navigation-button.active{
    
    background:var(--primary);
    color:white;
    
}

/*===========================================
    MAIN
=============================================*/

.app-main{
  width:95%;
  max-width:1300px;
  margin:25px auto;
}

.app-view{
  display:none;
}

.active-view{
  display:block;
}



/*===========================================
    DASHBOARD
=============================================*/

.summary-grid{
 
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:20px;
}

.summary-card{

  background:white;
  padding:25px;
  border-radius:10px;
  border: 1px solid var(--border);
}

/*.summary-label{}

.summary-card strong{} */

/*===========================================
    TOOLBAR
=============================================*/

.toolbar{

    display:flex;
    gap:20px;
    margin:20px 0;
}

.toolbar input{
    width:250px;
}

.toolbar select{

    width:170px;

}
/*===========================================
    INPUTS
=============================================*/

input,select{
    padding:10px;
    border:1px solid var(--border);
    border-radius:6px;
    font-size:15px;
}

input:focus,select:focus{
    outline:none;
    border-color:var(--primary);
}

/*===========================================
    BUTTONS
=============================================*/

.primary-button{
    background:var(--primary);
    color:white;
    border:none;
    padding:10px 18px;
    border-radius:8px;
    cursor:pointer;
}

.primary-button:hover{
    background:var(--primary-dark);

}

.secondary-button{
    background:white;
    color:var(--primary);
    border:1px solid var(--primary);
    padding:10px 18px;
    border-radius:8px;
    cursor:pointer;
}

.person-card{

    background:white;
    border:1px solid var(--border);
    border-radius:10px;
    padding:15px;
    margin-bottom:12px;
}

#addOffDocketButton {
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

/* =========================================================
   PDF IMPORT RESULTS
   ========================================================= */

.pdf-import-results {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.pdf-import-results h3 {
    margin-bottom: 15px;
}

.pdf-import-results p {
    margin-bottom: 10px;
}

.import-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
}

.import-message.success {
    color: var(--success);
    background: #e4f5ea;
}

.import-message.warning {
    color: var(--warning);
    background: #fff3d6;
}

#uploadDocketButton:disabled {
    cursor: wait;
    opacity: 0.65;
}
/* =========================================================
   OFFICER CHECK-IN VIEW
   ========================================================= */

   .officer-status-section {
    margin-bottom: 28px;
}

.officer-status-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.officer-status-heading h3 {
    margin: 0;
}

.section-count {
    min-width: 34px;
    padding: 5px 10px;
    text-align: center;
    color: white;
    background: var(--primary);
    border-radius: 999px;
    font-weight: bold;
}

.officer-status-list {
    display: grid;
    gap: 12px;
}

.officer-status-list[hidden] {
    display: none;
}

.check-in-details {
    margin-top: 8px;
    color: var(--success);
    font-weight: bold;
}

.check-in-button,
.undo-check-in-button {
    min-width: 140px;
}


/* =========================================================
   CASE READINESS
   ========================================================= */

.person-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.readiness-badge {
    display: inline-block;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: bold;
}

.readiness-badge.ready {
    color: var(--success);
    background: #e4f5ea;
}

.readiness-badge.partial {
    color: var(--warning);
    background: #fff3d6;
}

.readiness-badge.waiting {
    color: var(--danger);
    background: #f8dddd;
}

.case-details {
    margin-top: 16px;
}

.case-details summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: bold;
}

.case-party-row {
    margin-top: 12px;
    padding: 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.case-party-row p {
    margin: 4px 0;
}

/* =========================================================
   OFFICER VIEW SUB-NAVIGATION
   ========================================================= */

   .sub-navigation {
        display: flex;
        gap: 10px;
        margin: 20px 0;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border);
   }

   .sub-nav-button {
        padding: 10px 18px;
        color: var(--text);
        background: transparent;
        border: 1px solid var(--border);
        border-radius: 8px;
        cursor: pointer;
        font-weight: bold;
   }

   .sub-nav-button.active {
        color:white;
        background: var(--primary);
        border-color: var(--parimary);
   }

   .officer-tab-panel[hidden] {
        display: none;
   }
/* =========================================================
   CLERK ARRIVAL QUEUE
   ========================================================= */

.clerk-alert-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.alert-status {
    color: var(--text-light);
    font-size: 0.9rem;
}

.clerk-sub-navigation {
    align-items: center;
}

.arrival-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    margin-left: 7px;
    padding: 0 7px;
    color: white;
    background: var(--text-light);
    border-radius: 999px;
    font-size: 0.8rem;
}

.arrival-count-badge.has-arrivals {
    background: var(--danger);
}

.arrival-alert-banner {
    margin-bottom: 18px;
    padding: 16px 18px;
    color: #7a1d1d;
    background: #ffe4e4;
    border: 2px solid var(--danger);
    border-radius: 10px;
    animation: arrivalPulse 1.5s ease-in-out infinite;
}

.arrival-alert-banner strong,
.arrival-alert-banner span {
    display: block;
}

.arrival-alert-banner span {
    margin-top: 4px;
}

@keyframes arrivalPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(197, 57, 57, 0.15);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(197, 57, 57, 0.05);
    }
}

.clerk-tab-panel[hidden] {
    display: none;
}

.arrival-empty-message {
    display: grid;
    gap: 6px;
    min-height: 170px;
    place-content: center;
    text-align: center;
}

.arrival-empty-message span {
    color: var(--text-light);
}

.new-arrival-card {
    border: 2px solid var(--warning);
    box-shadow: 0 4px 12px rgba(31, 41, 51, 0.08);
}

.new-arrival-label {
    display: inline-block;
    margin-bottom: 10px;
    padding: 5px 9px;
    color: #6e4800;
    background: #fff0c2;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: bold;
    letter-spacing: 0.04em;
}

.arrival-time,
.acknowledgment-status {
    margin-top: 7px;
    font-weight: bold;
}

.arrival-time {
    color: var(--primary);
}

.acknowledgment-status {
    color: var(--text);
}

.acknowledge-arrival-button {
    min-width: 190px;
}

@media (max-width: 700px) {
    .clerk-alert-controls {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* =========================================================
   CLERK ARRIVAL SECTIONS
   ========================================================= */

.arrival-section {
    margin-bottom: 2rem;
}

.arrival-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.arrival-section-heading h3 {
    margin: 0 0 0.25rem;
}

.arrival-section-heading p {
    margin: 0;
}

.acknowledged-arrivals-section {
    border-top: 1px solid #d7dce2;
    padding-top: 1.5rem;
}

.acknowledged-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.6rem;
    border-radius: 999px;
    background: #e8edf3;
    font-weight: 700;
}

.acknowledged-arrival-card {
    opacity: 0.96;
}


/* =========================================================
   COLLAPSIBLE CLERK ARRIVAL SECTIONS
   ========================================================= */

button.arrival-alert-banner {
    width: 100%;
    border: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.arrival-banner-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.arrival-banner-toggle-text {
    margin-left: auto;
    white-space: nowrap;
    font-weight: 700;
    text-decoration: underline;
}

.collapse-section-button {
    flex: 0 0 auto;
}

.arrival-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 1rem;
    border: 1px solid #d7dce2;
    border-radius: 8px;
    background: #f7f9fb;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.arrival-section-toggle strong,
.arrival-section-toggle small {
    display: block;
}

.arrival-section-toggle small {
    margin-top: 0.2rem;
    color: #5d6670;
}

.arrival-toggle-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 700;
}

#acknowledgedArrivalContent {
    margin-top: 1rem;
}

@media (max-width: 700px) {
    button.arrival-alert-banner,
    .arrival-section-toggle {
        align-items: flex-start;
        flex-direction: column;
    }

    .arrival-banner-toggle-text {
        margin-left: 0;
    }
}


/* =========================================================
   ACKNOWLEDGED ARRIVAL ACTIONS
   ========================================================= */

.person-name-block {
    min-width: 0;
    flex: 1;
}

.person-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.return-waiting-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: underline;
}

.return-waiting-link:hover {
    color: var(--primary-dark);
}

.acknowledged-arrival-card .person-actions {
    margin-top: 18px;
}

.primary-dispose-button {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 9px;
    background: var(--danger);
    color: white;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 700;
}

.primary-dispose-button:hover {
    filter: brightness(0.9);
}

@media (max-width: 700px) {
    .person-name-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =========================================================
   PROFESSIONAL CLERK READINESS CARDS
   ========================================================= */

.clerk-person-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    border-top-width: 5px;
}

.clerk-person-card.readiness-card-ready {
    border-top-color: var(--success);
}

.clerk-person-card.readiness-card-partial {
    border-top-color: var(--warning);
}

.clerk-person-card.readiness-card-waiting {
    border-top-color: var(--danger);
}

.clerk-defendant-name {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: 0.01em;
}

.party-readiness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 16px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #f8fafc;
}

.party-readiness-item {
    display: grid;
    grid-template-columns: 15px minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 2px;
    align-items: center;
    min-width: 0;
}

.readiness-dot {
    grid-row: 1 / span 2;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px white;
}

.readiness-dot.complete {
    background: var(--success);
}

.readiness-dot.missing {
    background: var(--danger);
}

.readiness-dot.partial {
    background: var(--warning);
}

.readiness-dot.not-required {
    background: #9aa4af;
}

.party-readiness-label {
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 700;
}

.party-readiness-detail {
    min-width: 0;
    color: var(--text-light);
    font-size: 0.79rem;
}

.acknowledged-action-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

.acknowledged-action-bar button {
    min-height: 44px;
    width: 100%;
    font-size: 0.93rem;
    font-weight: 700;
}

.return-queue-button {
    background: white;
}

.disposed-action-button {
    background: var(--primary);
}

.disposed-action-button:hover {
    background: var(--primary-dark);
}

/* Supersedes the earlier full-width dispose treatment. */
.acknowledged-arrival-card .primary-dispose-button {
    width: auto;
    min-height: 44px;
}

@media (max-width: 760px) {
    .party-readiness-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .acknowledged-action-bar {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   REFINED CLERK CARD LAYOUT
   ========================================================= */

.clerk-name-and-readiness {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.clerk-name-and-readiness .readiness-badge {
    padding: 4px 9px;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
}

.clerk-person-card .person-details {
    margin-top: 7px;
}

.acknowledged-arrival-card .person-actions {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.acknowledged-action-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.acknowledged-action-bar button {
    width: auto;
    min-width: 170px;
    min-height: 44px;
    padding: 10px 22px;
}

@media (max-width: 520px) {
    .acknowledged-action-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .acknowledged-action-bar button {
        width: 100%;
    }
}


/* =========================================================
   OFFICER GLOBAL SEARCH
   ========================================================= */

.officer-global-search-toolbar {
    margin-top: 20px;
}

#officerGlobalSearchResults {
    margin-top: 16px;
}

/* =========================================================
   COURTCHECK IN-APP ARRIVAL NOTIFICATION
   ========================================================= */

.courtcheck-arrival-toast {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 3000;
    display: grid;
    grid-template-columns: 7px minmax(0, 1fr);
    width: min(390px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 14px;
    background: white;
    box-shadow:
        0 20px 48px rgba(15, 23, 42, 0.22),
        0 4px 12px rgba(15, 23, 42, 0.12);
    opacity: 0;
    transform: translateY(-12px) translateX(18px);
    transition:
        opacity 180ms ease,
        transform 220ms ease;
}

.courtcheck-arrival-toast[hidden] {
    display: none;
}

.courtcheck-arrival-toast.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

.arrival-toast-accent {
    background: var(--primary);
}

.arrival-toast-content {
    padding: 18px 18px 16px;
}

.arrival-toast-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.arrival-toast-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.arrival-toast-heading h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.08rem;
    line-height: 1.25;
}

.arrival-toast-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-light);
    font-size: 1.55rem;
    font-weight: 400;
    line-height: 1;
}

.arrival-toast-close:hover {
    background: rgba(15, 23, 42, 0.07);
    color: var(--text);
}

.arrival-toast-names {
    display: grid;
    gap: 5px;
    margin: 14px 0 10px;
    padding: 0;
    list-style: none;
}

.arrival-toast-names li {
    color: var(--text);
    font-size: 0.96rem;
    font-weight: 750;
}

.arrival-toast-names .arrival-toast-more {
    color: var(--text-light);
    font-size: 0.88rem;
    font-weight: 600;
}

.arrival-toast-summary {
    margin: 0 0 14px;
    color: var(--text-light);
    font-size: 0.86rem;
    line-height: 1.45;
}

.arrival-toast-action {
    width: 100%;
    min-height: 42px;
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    font-weight: 750;
}

.arrival-toast-action:hover {
    background: var(--primary-dark);
}

@media (max-width: 520px) {
    .courtcheck-arrival-toast {
        top: 12px;
        right: 12px;
        width: calc(100vw - 24px);
    }
}

/* =========================================================
   FULL DOCKET ACTION BAR
   ========================================================= */

.full-docket-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.full-docket-action-bar .primary-button,
.full-docket-action-bar .secondary-button {
    min-width: 150px;
}

/* =========================================================
   ARRIVALS TAB ATTENTION INDICATOR
   ========================================================= */

.arrival-count-badge.has-arrivals {
    animation: arrivalBadgeBreathe 2.4s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(198, 48, 48, 0.34);
}

@keyframes arrivalBadgeBreathe {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(198, 48, 48, 0.28);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 7px rgba(198, 48, 48, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .arrival-count-badge.has-arrivals {
        animation: none;
    }
}

/* =========================================================
   COURT MESSAGES SLIDE-OUT PANEL
   ========================================================= */

.messages-launcher {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1080;

    display: inline-flex;
    align-items: center;
    gap: 9px;

    min-height: 48px;
    padding: 11px 16px;

    border: 1px solid var(--primary);
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);

    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.messages-launcher:hover {
    background: var(--primary-dark);
}

.messages-launcher.has-unread-messages {
    animation: messageLauncherBreathe 2.6s ease-in-out infinite;
}

.messages-unread-badge {
    display: inline-grid;
    place-items: center;
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    border-radius: 999px;
    background: #c63030;
    color: #ffffff;
    font-size: 0.78rem;
    line-height: 1;
}

.messages-unread-badge[hidden] {
    display: none;
}

.messages-panel {
    position: fixed;
    z-index: 1100;

    width: min(390px, calc(100vw - 24px));
    height: min(620px, calc(100vh - 24px));
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #f7f9fb;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);

    opacity: 0;
    transform: translateY(-8px) scale(0.985);
    transform-origin: top left;
    transition: opacity 0.18s ease, transform 0.18s ease;
    visibility: hidden;
    overflow: hidden;
}

.messages-panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

.messages-panel.is-dragging {
    transition: none;
    user-select: none;
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.3);
}

.messages-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 20px;
    background: var(--primary);
    cursor: move;
    touch-action: none;
    color: #ffffff;
}

.messages-panel-header h2,
.messages-panel-header p {
    margin: 0;
}

.messages-panel-header p {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.82rem;
}

.messages-eyebrow {
    display: block;
    margin-bottom: 3px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.messages-close-button,
.message-toast-close {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
}

.messages-panel-body {
    height: calc(100% - 102px);
    padding: 16px;
    overflow-y: auto;
}

.message-composer,
.messages-section,
.resolved-messages-section {
    margin-bottom: 16px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #ffffff;
}

.message-composer label {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    font-weight: 700;
}

.message-composer input,
.message-composer select,
.message-composer textarea {
    width: 100%;
    box-sizing: border-box;
}

.message-composer textarea {
    resize: vertical;
}

.message-recipient-row,
.messages-section-heading,
.message-card-heading,
.message-card-actions,
.message-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.message-recipient-row {
    padding: 10px 12px;
    border-radius: 9px;
    background: #eef4f8;
}

.message-reply-context {
    margin-top: 10px;
    padding: 9px 11px;
    border-left: 4px solid var(--primary);
    background: #f2f6f9;
    color: var(--text-light);
    font-size: 0.82rem;
}

.message-composer-actions {
    justify-content: flex-end;
    margin-top: 13px;
}

.messages-section-heading h3 {
    margin: 0;
}

.messages-count {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #e7eef3;
    color: var(--primary-dark);
    font-weight: 800;
}

.messages-list {
    display: grid;
    gap: 11px;
    margin-top: 12px;
}

.court-message-card {
    padding: 13px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #ffffff;
}

.court-message-card.received-message {
    border-left: 5px solid var(--primary);
}

.court-message-card.sent-message {
    border-left: 5px solid #728391;
}

.court-message-card.unread-message {
    background: #f0f7fb;
    box-shadow: 0 0 0 2px rgba(24, 63, 91, 0.08);
}

.message-card-heading > div {
    display: grid;
    gap: 2px;
}

.message-card-heading span,
.message-direction,
.message-regarding {
    color: var(--text-light);
    font-size: 0.78rem;
}

.message-direction {
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.message-regarding {
    margin-top: 9px;
    font-weight: 750;
}

.court-message-card p {
    margin: 9px 0 12px;
    line-height: 1.45;
}

.message-card-actions {
    justify-content: flex-end;
}

.message-card-actions button {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 0.82rem;
}

.resolved-messages-section summary {
    cursor: pointer;
    font-weight: 800;
}

.court-message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1120;

    width: min(350px, calc(100vw - 40px));
    padding: 17px;
    border: 1px solid var(--border-color);
    border-left: 6px solid var(--primary);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.22);

    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.court-message-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.court-message-toast strong {
    display: block;
    margin-top: 4px;
}

.court-message-toast p {
    margin: 9px 0 14px;
    line-height: 1.45;
}

.message-toast-close {
    position: absolute;
    top: 9px;
    right: 11px;
    color: var(--text-light);
}

@keyframes messageLauncherBreathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
    }

    50% {
        transform: scale(1.045);
        box-shadow: 0 10px 34px rgba(198, 48, 48, 0.3);
    }
}

@media (max-width: 700px) {
    .messages-panel {
        left: 12px !important;
        top: auto !important;
        right: 12px;
        bottom: 12px;
        width: auto;
        height: min(78vh, 620px);
        transform-origin: bottom center;
    }

    .messages-panel-header {
        cursor: default;
        touch-action: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .messages-launcher.has-unread-messages {
        animation: none;
    }

    .messages-panel,
    .court-message-toast {
        transition: none;
    }
}

/* =========================================================
   HEADER MESSAGE BUTTONS
   ========================================================= */

.section-heading-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.section-heading-actions .messages-launcher {
    position: static;
    right: auto;
    bottom: auto;
    z-index: auto;

    min-height: 42px;
    padding: 9px 14px;
    border-radius: 9px;
    box-shadow: none;
}

.section-heading-actions .messages-launcher:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

@media (max-width: 700px) {
    .section-heading-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .section-heading-actions .messages-launcher {
        position: static;
    }
}

/* =========================================================
   LEFT-ALIGNED VIEW HEADER ACTIONS
   ========================================================= */

.section-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.section-heading-actions {
    width: 100%;
    justify-content: flex-start;
}

@media (max-width: 700px) {
    .section-heading-actions {
        gap: 8px;
    }

    .section-heading-actions > button {
        flex: 1 1 180px;
    }
}

/* =========================================================
   CONDENSED MESSAGE ALERT WINDOW
   ========================================================= */

.messages-panel.is-condensed {
    width: min(360px, calc(100vw - 24px));
    height: auto;
    max-height: none;
}

.messages-panel.is-condensed .messages-panel-header {
    padding: 14px 16px;
    align-items: center;
}

.messages-panel.is-condensed .messages-panel-header .messages-eyebrow,
.messages-panel.is-condensed .messages-panel-header p {
    display: none;
}

.messages-panel.is-condensed .messages-panel-header h2 {
    font-size: 1.05rem;
}

.message-condensed-preview {
    display: grid;
    width: 100%;
    padding: 16px;
    border: 0;
    border-top: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-color);
    text-align: left;
    cursor: pointer;
}

.message-condensed-preview[hidden] {
    display: none;
}

.message-condensed-preview:hover {
    background: #f3f7fa;
}

.message-condensed-preview strong {
    margin-top: 3px;
    color: var(--primary-dark);
}

.message-condensed-text {
    margin-top: 9px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message-condensed-additional {
    margin-top: 10px;
    color: var(--text-light);
    font-size: 0.82rem;
    font-weight: 700;
}

.message-condensed-instruction {
    margin-top: 13px;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
}

@media (max-width: 700px) {
    .messages-panel.is-condensed {
        width: calc(100vw - 24px);
        height: auto;
    }
}

/* =========================================================
   CLERK NOTES AND PAPERWORK TRACKING
   ========================================================= */

.clerk-work-section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.clerk-work-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.clerk-work-heading h4 {
    margin: 2px 0 0;
    color: var(--primary-dark);
    font-size: 1rem;
}

.clerk-work-eyebrow {
    color: var(--text-light);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.clerk-work-heading .secondary-button {
    width: auto;
    min-width: 110px;
}

.clerk-notes-display {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #f8fafb;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.clerk-notes-display.no-notes {
    color: var(--text-light);
    font-style: italic;
}

.clerk-notes-display.has-notes {
    color: var(--text-color);
    background: #fffdf6;
}

.clerk-notes-editor {
    margin-top: 12px;
}

.clerk-notes-editor[hidden] {
    display: none;
}

.clerk-notes-editor label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.clerk-notes-textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
}

.clerk-notes-actions,
.paperwork-action-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.clerk-notes-actions button,
.paperwork-action-row button {
    width: auto;
    min-width: 150px;
}

.paperwork-action-row {
    justify-content: space-between;
    padding-top: 12px;
}

.paperwork-complete-status {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #176b45;
}

.paperwork-complete-status span:last-child {
    display: grid;
}

.paperwork-complete-status small {
    margin-top: 2px;
    color: var(--text-light);
}

.paperwork-complete-check {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #dff3e8;
    font-weight: 900;
}

.paperwork-complete-card {
    box-shadow: inset 0 0 0 2px rgba(23, 107, 69, 0.14),
                0 4px 16px rgba(0, 0, 0, 0.06);
}

.paperwork-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.paperwork-summary[hidden] {
    display: none;
}

.paperwork-summary span {
    padding: 8px 11px;
    border-radius: 999px;
    background: #edf3f7;
    color: var(--primary-dark);
    font-size: 0.86rem;
}

@media (max-width: 700px) {
    .clerk-work-heading,
    .paperwork-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .clerk-work-heading .secondary-button,
    .clerk-notes-actions button,
    .paperwork-action-row button {
        width: 100%;
    }

    .paperwork-summary {
        width: 100%;
        margin-left: 0;
    }
}

/* =========================================================
   COLLAPSIBLE CLERK CARDS
   ========================================================= */

.clerk-person-card .clerk-card-summary {
    cursor: pointer;
    border-radius: 10px;
    transition:
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}

.clerk-person-card .clerk-card-summary:hover {
    background: rgba(24, 63, 91, 0.035);
}

.clerk-person-card .clerk-card-summary:focus-visible {
    outline: 3px solid rgba(24, 63, 91, 0.28);
    outline-offset: 4px;
}

.clerk-person-card:not(.is-expanded) {
    padding-bottom: 18px;
}

.clerk-person-card:not(.is-expanded) .person-information {
    margin-bottom: 0;
}

.clerk-person-card.is-expanded .clerk-card-expanded-content {
    animation: clerkCardReveal 0.2s ease-out;
}

@keyframes clerkCardReveal {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Waiting-for-acknowledgment cards are active work items. */
.clerk-person-card .clerk-card-summary-static {
    cursor: default;
}

.clerk-person-card .clerk-card-summary-static:hover {
    background: transparent;
}

/* =========================================================
   DIRECT CLERK NOTES ENTRY
   ========================================================= */

.clerk-notes-direct-entry {
    display: grid;
    gap: 10px;
}

.clerk-notes-direct-entry label {
    display: block;
}

.clerk-notes-direct-entry .clerk-notes-textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
}

.clerk-notes-direct-entry .clerk-notes-actions {
    justify-content: flex-start;
}

/* =========================================================
   CONTACT VERIFICATION
   ========================================================= */

body.contact-verification-open {
    overflow: hidden;
}

.contact-verification-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 24, 36, 0.72);
    backdrop-filter: blur(4px);
}

.contact-verification-overlay[hidden] {
    display: none;
}

.contact-verification-panel {
    position: relative;
    width: min(100%, 520px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 34px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.contact-verification-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #edf2f5;
    color: #183f5b;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.contact-verification-eyebrow {
    margin: 0 0 8px;
    color: #537083;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.contact-verification-panel h2 {
    margin: 0;
    color: #183f5b;
    font-size: clamp(1.65rem, 4vw, 2.2rem);
}

.contact-verification-instructions {
    max-width: 420px;
    margin: 14px auto 8px;
    color: #425866;
    font-size: 1.02rem;
    line-height: 1.5;
}

.contact-verification-name {
    margin: 16px 0 6px;
    color: #183f5b;
    font-weight: 800;
    font-size: 1.15rem;
}

.contact-phone-display {
    margin: 14px 0 20px;
    padding: 18px 14px;
    border: 2px solid #b9c8d2;
    border-radius: 14px;
    background: #f7fafb;
    color: #102c3f;
    font-size: clamp(1.75rem, 6vw, 2.65rem);
    font-weight: 800;
    letter-spacing: 0.05em;
}

.contact-keypad {
    display: grid;
    grid-template-columns: repeat(3, minmax(76px, 1fr));
    gap: 12px;
}

.contact-keypad button {
    min-height: 68px;
    border: 1px solid #b7c6d0;
    border-radius: 14px;
    background: #ffffff;
    color: #183f5b;
    font: inherit;
    font-size: 1.55rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(24, 63, 91, 0.08);
}

.contact-keypad button:hover,
.contact-keypad button:focus-visible {
    background: #edf5f8;
    border-color: #183f5b;
}

.contact-keypad button:active {
    transform: translateY(1px);
}

.contact-keypad .contact-keypad-secondary {
    background: #edf2f5;
    font-size: 1rem;
}

.contact-phone-save {
    width: 100%;
    min-height: 56px;
    margin-top: 18px;
    font-size: 1.05rem;
}

.contact-phone-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.contact-verification-privacy {
    margin: 14px 0 0;
    color: #6a7c87;
    font-size: 0.82rem;
}

.contact-verification-summary {
    margin-top: 8px;
    color: #425866;
    font-size: 0.92rem;
}

.contact-verification-summary strong {
    color: #183f5b;
}

@media (max-width: 600px) {
    .contact-verification-overlay {
        padding: 10px;
    }

    .contact-verification-panel {
        width: 100%;
        max-height: calc(100vh - 20px);
        padding: 28px 18px 22px;
        border-radius: 18px;
    }

    .contact-keypad {
        gap: 9px;
    }

    .contact-keypad button {
        min-height: 60px;
    }
}


/* =========================================================
   OFFICER MANUAL PHONE ENTRY
   ========================================================= */

.officer-phone-entry-dialog {
    width: min(92vw, 480px);
    padding: 0;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.officer-phone-entry-dialog::backdrop {
    background: rgba(8, 24, 36, 0.68);
    backdrop-filter: blur(3px);
}

.officer-phone-entry-dialog form {
    padding: 30px;
}

.officer-phone-entry-dialog h2 {
    margin: 0;
    color: #183f5b;
}

.officer-phone-entry-field {
    display: grid;
    gap: 8px;
    margin-top: 22px;
    color: #183f5b;
    font-weight: 700;
}

.officer-phone-entry-field input {
    width: 100%;
    padding: 15px 16px;
    border: 2px solid #b9c8d2;
    border-radius: 12px;
    color: #102c3f;
    font: inherit;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.officer-phone-entry-field input:focus {
    border-color: #183f5b;
    outline: 3px solid rgba(24, 63, 91, 0.14);
}

.officer-phone-entry-help {
    margin: 12px 0 0;
    color: #617684;
    font-size: 0.88rem;
    line-height: 1.45;
}

.contact-verification-summary span {
    color: #617684;
    font-size: 0.84rem;
}


/* =========================================================
   ACTIVE ALERT ENGINE
   ========================================================= */

.active-alerts-heading {
    align-items: flex-start;
}

.active-alert-warning,
.active-alert-confirmation-notice {
    padding: 14px 16px;
    border: 1px solid #b3261e;
    border-left-width: 6px;
    border-radius: 10px;
    background: #fff5f4;
    color: #601410;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 18px;
}

.active-alert-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
}

.active-alert-toolbar label,
.active-alert-form-grid label,
.active-alert-instructions-field,
.active-alert-ack-field {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.active-alert-toolbar input,
.active-alert-toolbar select,
.active-alert-form-grid input,
.active-alert-form-grid select,
.active-alert-instructions-field textarea,
.active-alert-ack-field input {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #9ba8b2;
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.active-alert-toolbar label:first-child {
    flex: 1 1 340px;
}

.active-alert-list {
    display: grid;
    gap: 14px;
}

.active-alert-card {
    border: 1px solid #c8d0d6;
    border-left: 6px solid #b3261e;
    border-radius: 12px;
    background: #fff;
    padding: 18px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .07);
}

.active-alert-card.inactive {
    border-left-color: #6b747c;
    opacity: .82;
}

.active-alert-card-top,
.active-alert-dialog-heading,
.active-alert-match-heading > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.active-alert-type,
.active-alert-eyebrow {
    margin: 0 0 4px;
    color: #b3261e;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.active-alert-card h3,
.active-alert-match-item h3 {
    margin: 0 0 8px;
}

.active-alert-status {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.active-alert-status.active { background: #fde8e7; color: #9d1c14; }
.active-alert-status.inactive { background: #eceff1; color: #4d555c; }

.active-alert-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 6px 20px;
    margin-top: 14px;
}

.active-alert-meta p { margin: 4px 0; }
.active-alert-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.active-alert-audit { margin-top: 12px; }
.active-alert-audit ul { margin-bottom: 0; }

.active-alert-dialog,
.active-alert-match-dialog {
    width: min(920px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);

    padding: 0;

    border: 0;
    border-radius: 14px;

    overflow: hidden;
    
    background: #ffffff;

    box-shadow: 0 18px 48px rgba(18, 43, 61, 0.22);
}

.active-alert-dialog > form {

    display: flex;
    flex-direction: column;
    height: 100%;
}

.active-alert-dialog .dialog-heading {
    padding: 22px 26px 18px;
    border-bottom: 1px solid #dbe3e9;
    background: #f7f9fb;
}

.active-alert-dialog .dialog-heading {
    position: relative;
    padding-right: 70px;
}

.active-alert-dialog .dialog-heading .icon-button {
    position: absolute;
    top: 18px;
    right: 26px;
}

.active-alert-dialog .admin-form-grid {
    padding: 22px 26px;
}

.active-alert-dialog .dialog-actions {
    padding: 18px 26px 22px;
    border-top: 1px solid #dbe3e9;
    background: #ffffff;
}

.active-alert-dialog::backdrop,
.active-alert-match-dialog::backdrop {
    background: rgba(12, 24, 33, .62);
}

.active-alert-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.active-alert-instructions-field { margin-bottom: 18px; }
.icon-button { border: 0; background: transparent; font-size: 2rem; line-height: 1; cursor: pointer; }

.active-alert-match-heading {
    margin: -22px -22px 18px;
    padding: 18px 22px;
    background: #8f1d16;
    color: #fff;
}

.active-alert-match-heading .active-alert-eyebrow { color: #ffd7d4; }
.active-alert-symbol {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
    background: #fff;
    color: #8f1d16;
    font-size: 1.5rem;
    font-weight: 900;
}

.active-alert-match-item {
    border: 1px solid #e1a7a3;
    border-left: 6px solid #b3261e;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    background: #fffafa;
}

.active-alert-match-item p { margin: 5px 0; }
.active-alert-match-strength { color: #8f1d16; font-weight: 800; }
.active-alert-ack-field { margin: 16px 0; }

.person-active-alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 7px 0 3px;
    padding: 6px 10px;
    border: 1px solid #b3261e;
    border-radius: 999px;
    background: #fde8e7;
    color: #8f1d16;
    font: inherit;
    font-size: .82rem;
    font-weight: 800;
    cursor: pointer;
}

.person-active-alert-badge span {
    display: grid;
    place-items: center;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #b3261e;
    color: #fff;
}

@media (max-width: 700px) {
    .active-alert-form-grid { grid-template-columns: 1fr; }
    .active-alert-dialog, .active-alert-match-dialog { width: calc(100vw - 18px); padding: 16px; }
    .active-alert-match-heading { margin: -16px -16px 16px; padding: 16px; }
}


/* =========================================================
   ACTIVE ALERT MATCH STRENGTH
   ========================================================= */

.person-active-alert-badge.possible {
    background: #fff3cd;
    border-color: #b58105;
    color: #6c4d00;
}

.person-active-alert-badge.confirmed {
    background: #8f1d16;
    border-color: #8f1d16;
    color: #ffffff;
}

.active-alert-match-item.possible {
    border-left: 5px solid #d49a0a;
}

.active-alert-match-item.confirmed {
    border-left: 5px solid #8f1d16;
}


/* =========================================================
   ACTIVE ALERT MATCH WINDOW CONTROLS
   ========================================================= */

.active-alert-match-heading,
.active-alert-clear-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.active-alert-close-button {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.active-alert-close-button:hover {
    background: rgba(255, 255, 255, 0.22);
}

.active-alert-clear-button {
    border-color: #8f1d16;
    color: #8f1d16;
}

.active-alert-clear-dialog {
    width: min(520px, calc(100vw - 32px));
    border: 0;
    border-radius: 16px;
    padding: 0 22px 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.active-alert-clear-dialog::backdrop {
    background: rgba(10, 20, 30, 0.58);
}

.active-alert-clear-heading {
    margin: 0 -22px 18px;
    padding: 18px 22px;
    border-radius: 16px 16px 0 0;
    background: #173f5f;
    color: #ffffff;
}

.active-alert-clear-heading h2 {
    margin: 2px 0 0;
}

.active-alert-clear-explanation {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-left: 4px solid #d99b19;
    background: #fff8e7;
    color: #493b1f;
}

.active-alert-clear-confirm-button {
    background: #8f1d16;
}


/* =========================================================
   CURRENT CHECK-IN WORKSPACE
   ========================================================= */

.current-check-in-panel {
    margin: 0 0 24px;
    padding: 20px;
    border: 2px solid #173f5f;
    border-radius: 16px;
    background: linear-gradient(180deg, #f7fbfe 0%, #ffffff 100%);
    box-shadow: 0 10px 28px rgba(23, 63, 95, 0.14);
}

.current-check-in-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.current-check-in-kicker {
    display: block;
    margin-bottom: 4px;
    color: #173f5f;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.current-check-in-heading h3 {
    margin: 0;
    font-size: 1.35rem;
}

.current-check-in-alerts:empty {
    display: none;
}

.current-check-in-alerts {
    margin-bottom: 14px;
}

.current-check-in-phone-status {
    display: grid;
    gap: 4px;
    margin-bottom: 16px;
    padding: 13px 15px;
    border-radius: 12px;
    background: #eef4f8;
}

.current-check-in-phone-status.awaiting {
    border-left: 5px solid #d59a13;
}

.current-check-in-phone-status.complete {
    border-left: 5px solid #2f7d4a;
}

.current-check-in-phone-status.skipped {
    border-left: 5px solid #697681;
}

.current-check-in-status-label {
    color: #52616d;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.current-check-in-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.current-check-in-actions button,
.current-check-in-finish-button {
    width: auto;
}

@media (max-width: 680px) {
    .current-check-in-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .current-check-in-actions button,
    .current-check-in-finish-button {
        width: 100%;
    }
}


/* =========================================================
   NEWLY ADDED OFF-DOCKET PERSON
   ========================================================= */

.officer-person-card.newly-added-person-card {
    animation: newly-added-person-highlight 2.2s ease-out;
}

@keyframes newly-added-person-highlight {
    0%, 35% {
        border-color: #d59a13;
        background: #fff8dc;
        box-shadow: 0 0 0 4px rgba(213, 154, 19, 0.22);
    }

    100% {
        border-color: transparent;
        background: #ffffff;
        box-shadow: none;
    }
}


/* =========================================================
   OFFICER CHECKED-IN WARRANT FILTERS
   ========================================================= */

.officer-warrant-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 20px;
    padding: 12px;
    border: 1px solid #d8e2e9;
    border-radius: 14px;
    background: #f7fafc;
}


.officer-warrant-filter-label {
    display: flex;
    align-items: center;
    margin-right: 4px;
    color: #4f6270;
    font-size: 0.9rem;
    font-weight: 700;
}

.officer-warrant-filter-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: auto;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid #9eb2c1;
    border-radius: 999px;
    background: #ffffff;
    color: #173f5f;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.officer-warrant-filter-button strong {
    display: inline-grid;
    min-width: 25px;
    min-height: 25px;
    place-items: center;
    padding: 0 7px;
    border-radius: 999px;
    background: #e8eff4;
    color: #173f5f;
    font-size: 0.82rem;
}

.officer-warrant-filter-button:hover {
    border-color: #173f5f;
    box-shadow: 0 4px 12px rgba(23, 63, 95, 0.12);
    transform: translateY(-1px);
}

.officer-warrant-filter-button.active {
    border-color: #173f5f;
    background: #173f5f;
    color: #ffffff;
}

.officer-warrant-filter-button.active strong {
    background: #ffffff;
    color: #173f5f;
}

@media (max-width: 680px) {
    .officer-warrant-filter-button {
        justify-content: space-between;
        width: 100%;
    }
}

/* =========================================================
   RETURN TO WAITING NAVIGATION BAR
   ========================================================= */

.officer-back-to-waiting-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 100%;
    margin: 22px 0 14px;
    padding: 13px 18px;

    border: 1px solid #b8c8d4;
    border-radius: 10px;

    background-color: #f4f7f9;
    color: #183f5b;

    font: inherit;
    font-weight: 700;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.officer-back-to-waiting-bar:hover {
    background-color: #eaf0f4;
    border-color: #8fa9bb;

    box-shadow:
        0 3px 9px
        rgba(0, 0, 0, 0.1);

    transform: translateY(-1px);
}

.officer-back-to-waiting-bar:active {
    transform: translateY(0);
    box-shadow: none;
}

.officer-back-arrow {
    font-size: 1.15rem;
    line-height: 1;
}

.officer-back-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 28px;
    height: 28px;
    padding: 0 8px;

    border-radius: 999px;

    background-color: #183f5b;
    color: #ffffff;

    font-size: 0.85rem;
}
/* =========================================================
   OFFICER COLLAPSIBLE SECTION HEADING
   ========================================================= */

.officer-status-heading {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 11px 14px;

    background-color: #f5f8fa;
    border-bottom: 1px solid #d7e0e7;
    border-radius: 10px;

    cursor: pointer;
    user-select: none;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.officer-status-heading:hover {
    background-color: #edf3f7;
    border-bottom-color: #b8c9d5;

    box-shadow:
        0 2px 6px
        rgba(0, 0, 0, 0.08);
}

.officer-status-heading h3 {
    flex: 1;
    margin: 0;

    font-size: 1.05rem;
    font-weight: 700;
}

.section-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 18px;

    font-size: 0.9rem;
    line-height: 1;

    transition:
        transform 0.2s ease;
}

.officer-status-heading.expanded
.section-arrow {
    transform: rotate(90deg);
}

.section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 32px;
    height: 28px;
    padding: 0 9px;

    border-radius: 999px;

    background-color: #183f5b;
    color: #ffffff;

    font-size: 0.82rem;
    font-weight: 700;
}

/* =========================================================
   CURRENT CHECK-IN FOCUS MODE
   ========================================================= */

#officerPersonList.check-in-focus-mode
.officer-person-card:not(.current-check-in-card) {
    filter: blur(2px);
    opacity: 0.42;
    pointer-events: none;
}

#officerPersonList.check-in-focus-mode
.officer-status-heading {
    filter: blur(1.5px);
    opacity: 0.55;
    pointer-events: none;
}

#officerPersonList.check-in-focus-mode
.current-check-in-card {
    position: relative;
    z-index: 2;

    filter: none;
    opacity: 1;
}


/* Keep the officer focused on the unfinished check-in. */
#officerPersonList.check-in-focus-mode
.officer-warrant-filter-bar {
    filter: blur(1.5px);
    opacity: 0.55;
    pointer-events: none;
}

#officerPersonList.check-in-focus-mode
.current-check-in-card > .person-information > :not(h3),
#officerPersonList.check-in-focus-mode
.current-check-in-card > .person-actions {
    filter: blur(1.5px);
    opacity: 0.45;
    pointer-events: none;
}

#officerPersonList.check-in-focus-mode
.current-check-in-card > .person-information > h3,
#officerPersonList.check-in-focus-mode
.current-check-in-card > .current-check-in-panel {
    filter: none;
    opacity: 1;
    pointer-events: auto;
}


/* Context-aware focus for Associated People and Witnesses. */
#associatedPeopleTodayList.check-in-focus-mode .officer-person-card:not(.current-check-in-card),
#witnessList.check-in-focus-mode .officer-person-card:not(.current-check-in-card) {
    filter: blur(2px);
    opacity: 0.42;
    pointer-events: none;
}

#associatedPeopleTodayList.check-in-focus-mode .current-check-in-card,
#witnessList.check-in-focus-mode .current-check-in-card {
    position: relative;
    z-index: 2;
    filter: none;
    opacity: 1;
}

#associatedPeopleTodayList.check-in-focus-mode .current-check-in-card > .person-information > :not(h3),
#associatedPeopleTodayList.check-in-focus-mode .current-check-in-card > .person-actions,
#witnessList.check-in-focus-mode .current-check-in-card > .person-information > :not(h3),
#witnessList.check-in-focus-mode .current-check-in-card > .person-actions {
    filter: blur(1.5px);
    opacity: 0.45;
    pointer-events: none;
}

#associatedPeopleTodayList.check-in-focus-mode .current-check-in-card > .person-information > h3,
#associatedPeopleTodayList.check-in-focus-mode .current-check-in-card > .current-check-in-panel,
#witnessList.check-in-focus-mode .current-check-in-card > .person-information > h3,
#witnessList.check-in-focus-mode .current-check-in-card > .current-check-in-panel {
    filter: none;
    opacity: 1;
    pointer-events: auto;
}

/* =========================================================
   ADMINISTRATION / CONNECTED COURT FOUNDATION
   ========================================================= */

.admin-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 22px;
}

.admin-navigation {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: start;
    position: sticky;
    top: 16px;
}

.admin-nav-button {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d8e1e8;
    border-radius: 9px;
    background: #f7f9fb;
    color: #173f5c;
    text-align: left;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.admin-nav-button:hover,
.admin-nav-button.active {
    background: #eaf2f7;
    border-color: #9fb8c9;
}

.admin-panel { display: none; }
.admin-panel.active-admin-panel { display: block; }

.admin-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-panel-heading.compact { margin-bottom: 12px; }
.admin-panel-heading h3 { margin: 0 0 4px; }
.admin-panel-heading p { margin: 0; color: #5e6d78; }

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 32px;
    row-gap: 20px;
}

#offDocketDialog {
    width: min(760px, calc(100vw - 32px));
    max-width: 760px;
    padding: 0;
}

/* Keep the controls that depend on “Why is this person here?” directly beneath it. */
#offDocketPhoneNumberField { grid-column: 1; }
#offDocketCourtRoleField,
#offDocketWitnessDefendantField,
#offDocketLinkedDefendantField,
#offDocketRelationshipField { grid-column: 2; }

#offDocketDialog > form {
    padding: 24px;
    box-sizing: border-box;
}

#personDialog .form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#personDialog .form-field span {
    font-weight: 600;
}

#personDialog .form-field imput,
#personDialog .form-field select {
    width: 100%;
    box-sizing: border-box;
}

.admin-form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

#personDialog {
    width: min(620px, calc(100vw - 32px));
    max-width: 620px;
    padding: 0;
}

#personDialog > form {
    padding: 24px;
    box-sizing: border-box;
}

#personDialog,
#offDocketDialog,
.officer-profile-dialog {
    border: 0;
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    background: #ffffff;    
    box-shadow: 0 18px 48px rgba(18, 43, 61, 0.22);
}

#personDialog > form,
#offDocketDialog > form,
.officer-profile-dialog > form {
    display: flex;
    flex-direction: column;
}

.officer-profile-dialog > form {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

#personDialog .dialog-heading,
#offDocketDialog .dialog-heading,
.officer-profile-dialog .dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding: 22px 26px 18px;

    border-bottom: 1px solid #dbe3e9;
    background: #f7f9fb;
}

#personDialog .dialog-heading h2,
#offDocketDialog .dialog-heading h2,
.officer-profile-dialog .dialog-heading h2 {
    margin: 0 0 5px;
}

#personDialog .dialog-heading p,
#offDocketDialog .dialog-heading p,
.officer-profile-dialog .dialog-heading p {
    margin: 0;
    color: #5e6d78;
}

#personDialog .admin-form-grid,
#offDocketDialog .admin-form-grid,
.officer-profile-dialog .admin-form-grid {
    padding: 24px 26px 10px;
    gap: 18px 22px;
}

#personDialog .dialog-actions,
#offDocketDialog .dialog-actions,
.officer-profile-dialog .dialog-actions {
    margin-top: 0;
    padding: 16px 26px 20px;

    border-top: 1px solid #dbe3e9;
    background: #ffffff;
}

#personDialog .icon-button,
#offDocketDialog .icon-button,
.officer-profile-dialog .icon-button {
    flex: 0 0 auto;

    width: 38px;
    height: 38px;

    border: 1px solid #cfd9e0;
    border-radius: 9px;

    background: #ffffff;

    font-size: 1.35rem;
    line-height: 1;

    cursor: pointer;
}
.admin-record-list { display: grid; gap: 12px; }

.admin-record-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 16px;
    border: 1px solid #dbe3e9;
    border-radius: 10px;
    background: #fff;
}

.admin-record-card h4 { margin: 0 0 5px; }
.admin-record-card p { margin: 2px 0; color: #5e6d78; }
.admin-record-status { display: grid; justify-items: end; gap: 10px; }
.admin-inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field span {
    font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    box-sizing: border-box;
}

.officer-presence-badge {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
}
.officer-presence-badge.present { background: #e3f4e8; color: #176232; }
.officer-presence-badge.away { background: #edf1f4; color: #586771; }

.admin-fieldset {
    margin: 18px 0 0;
    padding: 14px;
    border: 1px solid #d8e1e8;
    border-radius: 10px;
}
.settings-check { display: inline-flex; align-items: center; gap: 8px; margin: 7px 18px 7px 0; }

.notification-rules-grid { display: grid; gap: 8px; }
.notification-rule-header,
.notification-rule-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) repeat(4, 80px);
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 8px;
}
.notification-rule-header { background: #eaf1f5; font-weight: 800; }
.notification-rule-row { border: 1px solid #dfe6eb; }
.notification-rule-row label { display: flex; justify-content: center; }

.officer-checkin-grid {
    display: grid;
    grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
    gap: 20px;
}

.courtroom-qr-card,
.active-officer-card {
    padding: 18px;
    border: 1px solid #d8e1e8;
    border-radius: 12px;
    background: #fff;
}

.qr-status-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.qr-status-row span { color: #62717b; font-size: .9rem; }
.courtroom-qr-image { display: block; width: min(100%, 320px); aspect-ratio: 1; margin: 0 auto 14px; border: 10px solid #fff; }
.qr-link-box { margin: 12px 0; padding: 10px; border-radius: 8px; background: #f3f6f8; overflow-wrap: anywhere; }
.admin-helper-text { color: #5e6d78; }
.prototype-warning { margin-top: 18px; padding: 13px 15px; border-left: 4px solid #b57a00; background: #fff8e7; }

.officer-profile-dialog { 
    width: min(760px, calc(100vw - 32px));
    max-width: 760px;
    padding: 0;

}

.mobile-officer-view { min-height: 70vh; }
.mobile-officer-shell { width: min(480px, 100%); margin: 0 auto; padding: 18px 0 36px; }
.mobile-officer-brand { display: grid; gap: 3px; margin-bottom: 20px; text-align: center; }
.mobile-officer-brand span { color: #5e6d78; }
.mobile-officer-brand strong { font-size: 1.45rem; color: #173f5c; }
.mobile-courtroom-summary,
.mobile-officer-form,
.mobile-checkin-result {
    padding: 22px;
    border: 1px solid #d8e1e8;
    border-radius: 14px;
    background: #fff;
}
.mobile-courtroom-summary { display: grid; gap: 5px; margin-bottom: 14px; text-align: center; }
.mobile-officer-form { display: grid; gap: 16px; }
.mobile-primary-button { width: 100%; margin-top: 6px; }
.mobile-form-error { margin: 0; color: #9f1c1c; font-weight: 700; }
.mobile-checkin-result { text-align: center; }
.mobile-checkin-result.error { border-color: #d9a3a3; }
.mobile-success-mark { display: inline-grid; place-items: center; width: 54px; height: 54px; margin-bottom: 10px; border-radius: 50%; background: #e2f4e8; color: #176232; font-size: 1.8rem; font-weight: 900; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
    .admin-layout,
    .officer-checkin-grid { grid-template-columns: 1fr; }
    .admin-navigation { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-form-grid { grid-template-columns: 1fr; }
    #offDocketPhoneNumberField,
    #offDocketCourtRoleField,
    #offDocketWitnessDefendantField,
    #offDocketLinkedDefendantField,
    #offDocketRelationshipField { grid-column: auto; }
}

@media (max-width: 560px) {
    .notification-rule-header,
    .notification-rule-row { grid-template-columns: minmax(130px, 1fr) repeat(4, 48px); font-size: .86rem; }
    .admin-record-card { align-items: flex-start; flex-direction: column; }
    .admin-record-status { justify-items: start; }
}

/* =========================================================
   WATCH LISTS
   ========================================================= */
.watch-list-card-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.watch-list-card-heading h4 { margin: 0; }
.watch-priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #e8eef3;
    color: #26445a;
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.watch-priority-badge.priority { background: #fff1c9; color: #795700; }
.watch-priority-badge.urgent { background: #f9d7dc; color: #8c1829; }
.watch-history-heading { margin-top: 28px; }
.watch-history-list { display: grid; gap: 10px; }
.watch-history-item {
    padding: 12px 14px;
    border: 1px solid #d8e1e8;
    border-radius: 10px;
    background: #fff;
}
.watch-history-item > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.watch-history-item p { margin: 6px 0 0; color: #536675; }
.watch-match-item {
    margin: 12px 0;
    padding: 16px;
    border: 1px solid #d8e1e8;
    border-radius: 12px;
    background: #f8fafb;
}
.watch-match-item h3 { margin: 10px 0; }
.watch-match-item p { margin: 7px 0; }
.admin-grid-wide { grid-column: 1 / -1; }
.form-field small { color: #607381; }

/* =========================================================
   ACTIVE ALERTS HUB / FEATURE LICENSING
   ========================================================= */

.alert-hub-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
    padding: 8px;
    border: 1px solid #d7e0e7;
    border-radius: 12px;
    background: #f5f8fa;
}

.alert-hub-tab {
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 10px 15px;
    background: transparent;
    color: #183f5b;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.alert-hub-tab:hover:not(:disabled) {
    background: #e8f0f5;
}

.alert-hub-tab.active {
    background: #183f5b;
    color: #ffffff;
}

.alert-hub-tab.feature-disabled,
.alert-hub-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.alert-hub-tab.feature-disabled::after {
    content: "  🔒";
    font-size: 0.85em;
}

.alert-hub-panel {
    display: none;
}

.alert-hub-panel.active-alert-hub-panel {
    display: block;
}

.alert-subheading {
    margin-bottom: 14px;
}

.feature-locked-message {
    padding: 22px;
    border: 1px solid #d7e0e7;
    border-radius: 12px;
    background: #f7f9fb;
}

.feature-locked-message h3 {
    margin-top: 0;
}

@media (max-width: 650px) {
    .alert-hub-tab {
        flex: 1 1 100%;
    }
}


/* =========================================================
   WATCH-LIST ENTRY DIALOG POLISH
   ========================================================= */

.watch-list-entry-dialog {
    width: min(920px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    padding: 0;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(18, 43, 61, 0.22);
}

.watch-list-entry-dialog::backdrop {
    background: rgba(20, 38, 52, 0.46);
}

.watch-list-entry-dialog > form {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
}

.watch-list-entry-dialog .dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px 18px;
    border-bottom: 1px solid #dbe3e9;
    background: #f7f9fb;
}

.watch-list-entry-dialog .dialog-heading h2 {
    margin: 0 0 5px;
}

.watch-list-entry-dialog .dialog-heading p {
    margin: 0;
    color: #5e6d78;
}

.watch-list-entry-dialog .icon-button {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid #cfd9e0;
    border-radius: 9px;
    background: #ffffff;
    font-size: 1.35rem;
    cursor: pointer;
}

.watch-list-entry-dialog .admin-form-grid {
    overflow-y: auto;
    padding: 24px 26px 10px;
    gap: 18px 22px;
}

.watch-list-entry-dialog .form-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.watch-list-entry-dialog .form-field > span,
.watch-list-entry-dialog .admin-fieldset legend {
    font-weight: 700;
    color: #253746;
}

.watch-list-entry-dialog .form-field input,
.watch-list-entry-dialog .form-field select,
.watch-list-entry-dialog .form-field textarea {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #aebbc5;
    border-radius: 8px;
    background: #ffffff;
    font: inherit;
    box-sizing: border-box;
}

.watch-list-entry-dialog .form-field textarea {
    resize: vertical;
    min-height: 88px;
}

.watch-list-entry-dialog .admin-fieldset {
    margin: 0;
    padding: 16px 18px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.watch-list-entry-dialog .dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 26px 20px;
    border-top: 1px solid #dbe3e9;
    background: #ffffff;
}

.watch-recipient-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: 210px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #cfd9e0;
    border-radius: 10px;
    background: #f8fafb;
}

.watch-recipient-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 11px;
    border: 1px solid #dce4ea;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
}

.watch-recipient-option:hover {
    border-color: #9fb8c9;
    background: #f1f6f9;
}

.watch-recipient-option input {
    margin-top: 3px;
}

.watch-recipient-option span {
    display: grid;
    gap: 2px;
}

.watch-recipient-option small,
.watch-recipient-empty {
    color: #607381;
}

.watch-recipient-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 14px;
    text-align: center;
}

@media (max-width: 720px) {
    .watch-list-entry-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .watch-list-entry-dialog > form {
        max-height: calc(100vh - 20px);
    }

    .watch-list-entry-dialog .dialog-heading,
    .watch-list-entry-dialog .admin-form-grid,
    .watch-list-entry-dialog .dialog-actions {
        padding-left: 18px;
        padding-right: 18px;
    }

    .watch-recipient-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Conference Log Dialog
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

#pdConferenceDialog,
#pdPleaDialog {
    width: min(620px, calc(100vw - 32px));
    max-width: 620px;

    padding: 0;

    border: 0;
    border-radius: 14px;

    overflow: hidden;

    background: #ffffff;

    box-shadow:
        0 18px 48px
        rgba(18, 43, 61, 0.22);
}

#pdConferenceDialog > form,
#pdPleaDialog > form {
    display: flex;
    flex-direction: column;

    max-height: calc(100vh - 40px);
}

#pdConferenceDialog .dialog-heading, 
#pdPleaDialog .dialog-heading {
    position: relative;

    padding:
        22px
        70px
        18px
        26px;

    border-bottom:
        1px solid #dbe3e9;

    background:
        #f7f9fb;
}

#pdConferenceDialog .dialog-heading h2,
#pdPleaDialog .dialog-heading h2 {
    margin: 0 0 5px;
}

#pdConferenceDialog .dialog-heading p,
#pdPleaDialog .dialog-heading p {
    margin: 0;

    color: #5e6d78;
}

#pdConferenceDialog .dialog-heading .icon-button,
#pdPleaDialog .dialog-heading .icon-button {
    position: absolute;

    top: 18px;
    right: 26px;
}

#pdConferenceDialog .admin-form-grid,
#pdPleaDialog .admin-form-grid {
    padding: 22px 26px;
}

#pdConferenceDialog .dialog-actions,
#pdPleaDialog .dialog-actions {
    margin-top: 0;

    padding: 16px 26px 20px;

    border-top:
        1px solid #dbe3e9;

    background:
        #ffffff;
}

#pdConferenceDialog textarea,
#pdPleaDialog textarea {
    width: 100%;

    box-sizing: border-box;

    resize: vertical;
}

#pdConferenceDialog .admin-form-grid,
#pdPleaDialog .admin-form-grid {
    gap: 18px 28px;
}

#pdConferenceDialog textarea,
#pdPleaDialog textarea {
    min-height: 110px;
}

/* =========================================================
   Summary Box
   ========================================================= */

#pdPleaDialog .pd-plea-summary {
    min-height: 90px;

    padding: 14px 16px;

    border: 1px solid #cfd9e0;
    border-radius: 10px;

    background: #f3f6f8;

    color: #334955;

    line-height: 1.5;

    cursor: default;
}

#pdPleaDialog .pd-plea-summary-field {
    grid-column: 1 / -1;
}

#pdPleaDialog .pd-plea-summary-field small {
    color: #687985;
    font-style: italic;
}   

/* =========================================================
   PD PLEA DIALOG SCROLLING
   ========================================================= */

#pdPleaDialog > form {
    height: min(850px, calc(100vh - 40px));
    display: flex;
    flex-direction: column;
}

#pdPleaDialog .pd-plea-dialog-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#pdPleaDialog .dialog-heading,
#pdPleaDialog .dialog-actions {
    flex-shrink: 0;
}

#pdPleaDialog .pd-plea-case-results {
    padding: 0 26px 26px;
}

/* =========================================================
   PANIC & EMERGENCY
   ========================================================= */

.panic-launch-button {
    position: fixed;
    top: auto;
    right: 28px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 4500;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-width: 220px;
    min-height: 70px;
    padding: 14px 22px;

    border: 2px solid #76140f;
    border-radius: 14px;
    background: #a5231b;
    color: #ffffff;

    font: inherit;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: .01em;

    box-shadow: 0 12px 28px rgba(84, 18, 13, .28);
    cursor: pointer;
}

.panic-launch-button span:first-child {
    font-size: 1.45rem;
}

.panic-launch-button:hover {
    background: #861a14;
}

.panic-launch-button[hidden] {
    display: none;
}

.panic-confirm-dialog {
    width: min(620px, calc(100vw - 32px));
    max-width: 620px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(18, 43, 61, 0.24);
}

.panic-confirm-dialog::backdrop {
    background: rgba(12, 24, 33, 0.66);
}

.panic-confirm-dialog .dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px 18px;
    border-bottom: 1px solid #dbe3e9;
    background: #fff5f4;
}

.panic-confirm-dialog .dialog-heading h2 {
    margin: 0 0 5px;
    color: #8f1d16;
}

.panic-confirm-dialog .dialog-heading p {
    margin: 0;
    color: #5e6d78;
}

.panic-dialog-body {
    display: grid;
    gap: 18px;
    padding: 22px 26px;
}

.panic-confirm-warning {
    padding: 14px 16px;
    border: 1px solid #e4b8b3;
    border-radius: 10px;
    background: #fff7f6;
    color: #6f211b;
}

.panic-confirm-dialog .dialog-actions {
    margin: 0;
    padding: 16px 26px 20px;
    border-top: 1px solid #dbe3e9;
    background: #ffffff;
}

.panic-confirm-button,
.panic-clear-button {
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    background: #a5231b;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.panic-confirm-button:hover,
.panic-clear-button:hover {
    background: #861a14;
}

.panic-incident-banner {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    border: 2px solid #7f1712;
    border-radius: 12px;
    background: #a5231b;
    color: #ffffff;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.panic-incident-banner[hidden] {
    display: none;
}

.panic-incident-banner > div {
    display: grid;
    gap: 2px;
}

.panic-banner-eyebrow {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .75rem;
    font-weight: 800;
}

.panic-banner-action {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 8px;
    padding: 9px 14px;
    background: #ffffff;
    color: #8f1d16;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.panic-incident-summary {
    padding: 14px 16px;
    border: 1px solid #e4b8b3;
    border-radius: 10px;
    background: #fff7f6;
}

.panic-incident-summary strong,
.panic-incident-summary span {
    display: block;
}

.mobile-panic-button {
    width: 100%;
    margin: 18px 0 10px;
    border: 0;
    border-radius: 12px;
    padding: 16px;
    background: #a5231b;
    color: #ffffff;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
}

.mobile-panic-button:active {
    background: #781711;
}

.panic-incident-banner.panic-cleared {
    border-color: #23633b;
    background: #2f7d4b;
}

.panic-incident-banner.panic-cleared .panic-banner-action {
    color: #23633b;
}

.panic-history-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #dbe3e9;
}

.panic-history-list {
    display: grid;
    gap: 12px;
}

.panic-history-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    padding: 15px 16px;
    border: 1px solid #d7e0e6;
    border-radius: 10px;
    background: #ffffff;
}

.panic-history-card h4 {
    margin: 0 0 5px;
}

.panic-history-card p {
    margin: 3px 0;
    color: #5e6d78;
}

.panic-history-status {
    align-self: start;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 800;
}

.panic-history-status.closed {
    background: #e6f3eb;
    color: #23633b;
}

.panic-history-status.active {
    background: #fff0ef;
    color: #8f1d16;
}

@media (max-width: 900px) {
    .panic-launch-button {
        top: auto;
        right: 14px;
        bottom: calc(18px + env(safe-area-inset-bottom, 0px));
        min-width: 190px;
        min-height: 62px;
    }
}

@media (max-width: 720px) {
    .panic-launch-button {
        top: auto;
        right: 10px;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        min-width: 168px;
        min-height: 56px;
        padding: 10px 14px;
        font-size: .95rem;
    }

    .panic-history-card {
        grid-template-columns: 1fr;
    }

    .panic-incident-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        align-items: flex-start;
    }

    .panic-action-buttons {
        flex-wrap: wrap;
    }
}

/* =========================================================
   HOME + ROLE WORKSPACES
   ========================================================= */

.courtcheck-home-link {
    color: inherit;
    text-decoration: none;
}

.courtcheck-home-link:hover,
.courtcheck-home-link:focus-visible {
    text-decoration: underline;
    text-underline-offset: 5px;
}

.workspace-section {
    margin-top: 30px;
}

.workspace-section-heading {
    margin-bottom: 14px;
}

.workspace-section-heading h3 {
    margin: 0 0 4px;
}

.workspace-section-heading p {
    margin: 0;
    color: #607381;
}

.workspace-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.workspace-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 4px 14px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 5px 16px rgba(25, 49, 66, .06);
}

.workspace-card:hover {
    border-color: #9fb8c9;
    box-shadow: 0 8px 22px rgba(25, 49, 66, .10);
}

.workspace-card .workspace-icon {
    grid-row: 1 / span 2;
    font-size: 1.55rem;
}

.workspace-card strong {
    font-size: 1.03rem;
}

.workspace-card > span:last-child {
    color: #607381;
    line-height: 1.45;
}

.role-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.role-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(190px, .7fr);
    gap: 16px;
    align-items: end;
    margin-bottom: 12px;
}

.role-search-field,
.role-filter-field {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.role-search-field input,
.role-filter-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid #cfd9e0;
    border-radius: 9px;
    background: #ffffff;
    font: inherit;
}

.role-view-note {
    margin-bottom: 16px;
    padding: 11px 13px;
    border: 1px solid #d9e3e9;
    border-radius: 10px;
    background: #f7fafb;
    color: #607381;
    font-size: .92rem;
}

.role-person-list {
    display: grid;
    gap: 14px;
}

.role-person-card {
    padding: 18px;
    border: 1px solid #d6e0e6;
    border-radius: 13px;
    background: #ffffff;
    box-shadow: 0 5px 16px rgba(25, 49, 66, .05);
}

.role-person-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.role-person-card-heading h3 {
    margin: 0 0 4px;
}

.role-person-card-heading p,
.role-checkin-time {
    margin: 0;
    color: #607381;
}

.role-status-badge {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
}

.role-status-badge.present {
    background: #e7f5ec;
    color: #23663d;
}

.role-status-badge.not-present {
    background: #eef2f5;
    color: #566671;
}

.role-checkin-time {
    margin-top: 8px;
    font-size: .9rem;
}

.role-case-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.role-case-row {
    padding: 12px 14px;
    border: 1px solid #e0e7eb;
    border-radius: 10px;
    background: #f8fafb;
}

.role-case-row h4,
.role-case-row p {
    margin: 0;
}

.role-case-row p + p,
.role-case-row h4 + p {
    margin-top: 5px;
}

@media (max-width: 900px) {
    .workspace-grid,
    .role-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .workspace-grid,
    .role-summary-grid,
    .role-toolbar {
        grid-template-columns: 1fr;
    }

    .role-person-card-heading {
        display: grid;
    }
}
/* ===========================================
   MOBILE LAYOUT
   =========================================== */

@media (max-width: 700px) {

    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }

    .app-title-area h1 {
        font-size: 28px;
        margin: 0;
    }

    .session-information {
        width: 100%;
        text-align: left;
    }

    .main-navigation {
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px;
    }

    .navigation-button {
        flex: 1 1 calc(50% - 6px);
        padding: 10px 8px;
        font-size: 14px;
    }

    .app-main {
        width: auto;
        margin: 18px 12px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .summary-card {
        padding: 16px 12px;
        min-width: 0;
    }

       .toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .toolbar input,
    .toolbar select {
        width: 100%;
        max-width: 100%;
    }

    input,
    select,
    button {
        max-width: 100%;
    }

    body {
        overflow-x: hidden;
    } 
}
/* =========================================================
   DOCUMENT TEMPLATE MANAGER
   ========================================================= */

.document-template-intro {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #d7e2ea;
    border-radius: 10px;
    background: #f6f9fb;
    color: #44535e;
}

.document-template-upload-form {
    padding: 18px;
    border: 1px solid #dfe7ec;
    border-radius: 12px;
    background: #ffffff;
}

.document-template-upload-form input[type="file"] {
    padding: 10px;
    border: 1px dashed #aebbc5;
    border-radius: 8px;
    background: #f9fbfc;
}

.document-template-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 26px 0 12px;
}

.document-template-list-heading h4,
.document-template-list-heading p {
    margin: 0;
}

.document-template-list-heading p {
    margin-top: 3px;
    color: #5e6d78;
}

.document-template-empty {
    display: grid;
    gap: 5px;
    padding: 22px;
    border: 1px dashed #bcc8d0;
    border-radius: 12px;
    color: #5e6d78;
    text-align: center;
}

.document-template-card {
    gap: 18px;
}

.document-template-card-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.document-template-file-icon {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 58px;
    border: 1px solid #c7d1d8;
    border-radius: 7px;
    background: #f4f7f9;
    color: #4a5963;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.document-template-card-actions {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.document-template-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.document-template-status.needs-mapping {
    background: #fff5d8;
    color: #725b12;
}

.document-template-status.mapped {
    background: #e6f4eb;
    color: #29613c;
}

@media (max-width: 760px) {
    .document-template-card-main {
        align-items: flex-start;
    }

    .document-template-card-actions {
        justify-items: start;
        width: 100%;
    }
}

/* =========================================================
   DOCUMENT FIELD MAPPER
   ========================================================= */
.document-field-mapper-dialog {
    width: min(1500px, 96vw);
    max-width: none;
    height: 92vh;
    max-height: 92vh;
    padding: 0;
    border: 0;
    border-radius: 18px;
    overflow: hidden;
}

.document-field-mapper-dialog::backdrop {
    background: rgba(15, 23, 42, 0.72);
}

.document-field-mapper-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f4f6f8;
}

.document-field-mapper-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 24px;
    background: #ffffff;
    border-bottom: 1px solid #d9dee5;
}

.document-field-mapper-header h2,
.document-field-mapper-header p {
    margin: 0;
}

.document-field-mapper-header p {
    margin-top: 4px;
    color: #667085;
}

.document-field-mapper-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #667085;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.document-field-mapper-layout {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
}

.document-field-mapper-workspace {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.document-field-mapper-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    background: #e8edf3;
    border-bottom: 1px solid #ccd3dc;
    color: #344054;
    font-size: 0.9rem;
}

.document-field-mapper-pages {
    min-height: 0;
    flex: 1;
    overflow: auto;
    padding: 24px;
    text-align: center;
}

.document-mapper-page {
    position: relative;
    width: max-content;
    margin: 0 auto 24px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.16);
    user-select: none;
}

.document-mapper-page canvas {
    display: block;
    max-width: none;
}

.document-mapper-overlay {
    position: absolute;
    inset: 0;
    cursor: crosshair;
    touch-action: none;
}

.document-mapped-field,
.document-mapped-field-draft {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid #2563eb;
    background: rgba(37, 99, 235, 0.12);
    color: #0f3f96;
    overflow: hidden;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
    padding: 2px 4px;
    cursor: pointer;
}

.document-mapped-field.selected {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}

.document-mapped-field-draft {
    border-style: dashed;
    pointer-events: none;
}

.document-field-mapper-sidebar {
    min-height: 0;
    overflow: auto;
    padding: 18px;
    background: #fff;
    border-left: 1px solid #d9dee5;
}

.mapper-help-card {
    padding: 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.mapper-help-card strong {
    display: block;
    margin-top: 9px;
}

.mapper-help-card strong:first-child {
    margin-top: 0;
}

.mapper-help-card p {
    margin: 2px 0 0;
    color: #667085;
    font-size: 0.88rem;
}

.mapper-field-editor {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.mapper-field-editor h3 {
    margin: 0 0 14px;
}

.mapper-field-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mapper-delete-button {
    width: 100%;
    margin-top: 8px;
}

.mapper-sidebar-actions {
    position: sticky;
    bottom: -18px;
    margin: 20px -18px -18px;
    padding: 14px 18px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.mapper-sidebar-actions .primary-button {
    width: 100%;
}

@media (max-width: 900px) {
    .document-field-mapper-dialog {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .document-field-mapper-layout {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .document-field-mapper-pages {
        max-height: 62vh;
    }

    .document-field-mapper-sidebar {
        border-left: 0;
        border-top: 1px solid #d9dee5;
    }
}


.document-mapped-field {
    touch-action: none;
}

.document-mapped-field.dragging {
    cursor: grabbing;
}

.document-mapped-field.selected {
    overflow: visible;
}

.document-mapped-field-resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #dc2626;
    box-sizing: border-box;
    z-index: 3;
}

.document-mapped-field-resize-handle.resize-nw { left: -6px; top: -6px; cursor: nwse-resize; }
.document-mapped-field-resize-handle.resize-n { left: 50%; top: -6px; transform: translateX(-50%); cursor: ns-resize; }
.document-mapped-field-resize-handle.resize-ne { right: -6px; top: -6px; cursor: nesw-resize; }
.document-mapped-field-resize-handle.resize-e { right: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.document-mapped-field-resize-handle.resize-se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.document-mapped-field-resize-handle.resize-s { left: 50%; bottom: -6px; transform: translateX(-50%); cursor: ns-resize; }
.document-mapped-field-resize-handle.resize-sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.document-mapped-field-resize-handle.resize-w { left: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }


/* Document mapper save confirmation */
.mapper-sidebar-actions .primary-button.mapping-saved {
    background: #15803d;
    border-color: #15803d;
    color: #ffffff;
}

.mapper-sidebar-actions .primary-button.mapping-saved:hover {
    background: #15803d;
    border-color: #15803d;
}


/* Document mapper per-page rotation */
.document-mapper-page-section {
    width: max-content;
    max-width: none;
    margin: 0 auto 28px;
}

.document-mapper-page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 100%;
    margin-bottom: 8px;
    padding: 8px 10px;
    box-sizing: border-box;
    border: 1px solid #d9dee5;
    border-radius: 8px;
    background: #ffffff;
}

.document-mapper-rotation-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.document-mapper-rotate-button {
    min-height: 36px;
    padding: 7px 12px;
    white-space: nowrap;
}

.document-mapper-page-section .document-mapper-page {
    margin-bottom: 0;
}


/* Public Defender saved plea editing */
.pd-plea-entry-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pd-edit-plea-button {
    min-height: 34px;
    padding: 6px 12px;
}


/* Safer document mapper modes */
.document-field-mapper-toolbar {
    gap: 14px;
    flex-wrap: wrap;
}

.document-field-mapper-toolbar-left,
.document-field-mapper-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.document-field-mapper-toolbar-left {
    flex: 1 1 440px;
}

.document-field-mapper-toolbar-right {
    justify-content: flex-end;
}

.mapper-add-field-button {
    white-space: nowrap;
}

.mapper-add-field-button.active {
    background: #f59e0b;
    border-color: #d97706;
    color: #111827;
}

.document-mapper-overlay {
    cursor: default;
}

.document-mapper-overlay.add-field-mode {
    cursor: crosshair;
}


/* =========================================================
   PUBLIC DEFENDER DOCUMENT FILL + PRINT
   ========================================================= */

.pd-document-template-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.document-fill-print-dialog {
    width: min(96vw, 1180px);
    max-width: 1180px;
    max-height: 94vh;
    padding: 0;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
}

.document-fill-print-dialog::backdrop {
    background: rgba(15, 23, 42, 0.58);
}

.document-fill-print-shell {
    display: flex;
    flex-direction: column;
    max-height: 94vh;
    background: #eef1f5;
}

.document-fill-print-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    background: #ffffff;
    border-bottom: 1px solid #d9dee5;
}

.document-fill-print-header h2 {
    margin: 2px 0 4px;
}

.document-fill-print-header p {
    margin: 0;
    color: #667085;
}

.document-fill-print-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.document-fill-print-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 10px 22px;
    background: #fff8e6;
    border-bottom: 1px solid #ead9aa;
}

.document-fill-print-toolbar span {
    color: #667085;
    font-size: 0.9rem;
}

.document-fill-print-pages {
    overflow: auto;
    padding: 24px;
}

.document-fill-print-page {
    position: relative;
    width: max-content;
    margin: 0 auto 28px;
    background: #ffffff;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.16);
}

.document-fill-print-page canvas {
    display: block;
    max-width: none;
}

.document-fill-print-overlay {
    position: absolute;
    inset: 0;
}

.document-fill-print-field {
    position: absolute;
    box-sizing: border-box;
    resize: none;
    overflow: hidden;
    margin: 0;
    padding: 2px 4px;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    color: #111827;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.1;
    white-space: pre-wrap;
    transition:
        border-color 120ms ease,
        background-color 120ms ease,
        box-shadow 120ms ease;
}

.document-fill-print-field.auto-filled {
    border-color: transparent;
    background: transparent;
}

.document-fill-print-field.manual-needed {
    border-color: transparent;
    background: transparent;
}

.document-fill-print-field:focus {
    outline: none;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.document-fill-print-loading {
    padding: 40px;
    text-align: center;
    color: #667085;
}

/* Printing the filled court document */


@media (max-width: 800px) {
    .document-fill-print-dialog {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .document-fill-print-shell {
        max-height: 100vh;
    }

    .document-fill-print-header {
        flex-direction: column;
    }
}


/* Mapper copy/paste and bold controls */
.mapper-bold-option {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    margin-top: 10px;
    font-weight: 600;
}

.mapper-bold-option input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.mapper-field-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.mapper-field-actions .secondary-button {
    width: 100%;
}


/* Mapper multi-select alignment */
.mapper-align-panel {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.mapper-align-panel > strong {
    display: block;
}

.mapper-align-panel > p {
    margin: 3px 0 10px;
    color: #667085;
    font-size: 0.86rem;
}

.mapper-align-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mapper-align-grid .secondary-button {
    width: 100%;
    min-width: 0;
}

.document-mapped-field.selected {
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}


.mapper-distribute-heading {
    margin: 14px 0 7px;
    font-size: 0.86rem;
    font-weight: 700;
    color: #475467;
}


/* Mapper drag-selection marquee */
.document-mapper-selection-box {
    position: absolute;
    z-index: 30;
    pointer-events: none;
    border: 1px dashed #2563eb;
    background: rgba(37, 99, 235, 0.10);
    box-sizing: border-box;
}


/* Adobe-style quick mapped-field properties */
.document-field-mapper-dialog {
    position: relative;
}

.quick-field-properties {
    position: absolute;
    z-index: 1000;
    top: 86px;
    right: 28px;
    width: 310px;
    box-sizing: border-box;
    padding: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.24);
}

.quick-field-properties[hidden] {
    display: none !important;
}

.quick-field-properties-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid #e2e8f0;
}

.quick-field-properties-header strong {
    font-size: 1rem;
}

.quick-field-close {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.quick-field-close:hover {
    background: #f1f5f9;
}

.quick-field-properties .form-field {
    margin-bottom: 10px;
}

.quick-field-properties-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-field-done {
    width: 100%;
    margin-top: 12px;
}


.quick-field-properties {
    left: 28px;
    right: auto;
}

.quick-field-properties-header {
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.quick-field-properties.dragging .quick-field-properties-header {
    cursor: grabbing;
}

.quick-field-drag-hint {
    margin-left: auto;
    color: #667085;
    font-size: 0.75rem;
    font-weight: 500;
}

.quick-field-close {
    flex: 0 0 auto;
}





/* =========================================================
   PRINT: USE THE PDF'S REAL PHYSICAL PAGE SIZE
   ========================================================= */



/* =========================================================
   COURT DOCUMENT PRINTING
   One PDF page = one printed page.
   ========================================================= */



.court-document-print-host {
    display: none;
}

@media print {
    @page {
        margin: 0;
    }

    html,
    body.printing-court-document {
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    body.printing-court-document > * {
        display: none !important;
    }

    body.printing-court-document > #courtDocumentPrintHost {
        display: block !important;
    }

    body.printing-court-document .court-document-print-page {
        position: relative !important;
        display: block !important;
        width: calc(var(--pdf-print-width) * 0.98) !important;
        height: calc(var(--pdf-print-height) * 0.98) !important;
        margin: 0 auto !important;
        padding: 0 !important;
        overflow: hidden !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        break-after: page !important;
        page-break-after: always !important;
    }

    body.printing-court-document .court-document-print-page:last-child {
        break-after: auto !important;
        page-break-after: auto !important;
    }

    body.printing-court-document .court-document-print-background {
        position: absolute !important;
        inset: 0 !important;
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.printing-court-document .court-document-print-overlay {
        position: absolute !important;
        inset: 0 !important;
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }

    body.printing-court-document .document-fill-print-field {
        position: absolute !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 2px !important;
        border: 0 !important;
        outline: 0 !important;
        background: transparent !important;
        color: #000000 !important;
        box-shadow: none !important;
        resize: none !important;
        overflow: hidden !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }
}
.document-fill-print-dialog {
    position: fixed !important;
    top: 16px !important;
    left: 50% !important;

    width: min(96vw, 1180px);
    height: calc(100vh - 32px);
    max-height: calc(100vh - 32px);

    margin: 0 !important;
    transform: translateX(-50%) !important;
}

.document-fill-print-shell {
    height: 100%;
    max-height: none;
}

.document-fill-print-header {
    flex: 0 0 auto;
}

.document-fill-print-pages {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

/* =========================================================
   STEP 35 — CLEANER DOCUMENT MAPPER
   ========================================================= */

.document-field-mapper-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 18px;
    background: #ffffff;
}

/* The floating Field Properties panel replaces the old duplicate editor. */
#documentFieldMapperEditor {
    display: none !important;
}

.mapper-help-card,
.mapper-align-panel {
    display: none !important;
}

.mapper-help-disclosure {
    margin: 0 0 18px;
    border: 1px solid #dbe2e8;
    border-radius: 10px;
    background: #f8fafc;
}

.mapper-help-disclosure summary {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 12px;
    cursor: pointer;
    color: #173b57;
    font-weight: 750;
    list-style: none;
}

.mapper-help-disclosure summary::-webkit-details-marker {
    display: none;
}

.mapper-help-question {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid #9fb0bd;
    border-radius: 50%;
    background: #ffffff;
    font-weight: 850;
}

.mapper-help-compact {
    padding: 0 13px 12px 45px;
    color: #596978;
    font-size: 0.82rem;
    line-height: 1.42;
}

.mapper-help-compact p {
    margin: 0 0 7px;
}

.mapper-compact-tool-section {
    padding: 18px 0;
    border-top: 1px solid #e2e7ec;
}

.mapper-compact-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.mapper-compact-heading strong {
    color: #17222c;
    font-size: 1rem;
}

.mapper-compact-heading span {
    color: #71808d;
    font-size: 0.74rem;
}

.mapper-icon-tool-grid {
    display: grid;
    gap: 8px;
}

.mapper-icon-tool-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.mapper-icon-tool-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.mapper-icon-tool {
    display: grid;
    place-items: center;
    min-height: 48px;
    padding: 8px;
    border: 1px solid #b8c5cf;
    border-radius: 8px;
    background: #ffffff;
    color: #173b57;
    cursor: pointer;
}

.mapper-icon-tool:hover {
    border-color: #173b57;
    background: #f4f8fb;
}

.mapper-icon-tool:active {
    transform: translateY(1px);
}

.mapper-sidebar-actions {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    padding-top: 14px;
    background: #ffffff;
}

.mapper-sidebar-actions .primary-button {
    width: 100%;
}

/* Main alignment icons */
.mapper-edge-icon {
    position: relative;
    display: block;
    width: 30px;
    height: 25px;
}

.mapper-edge-icon b {
    position: absolute;
    background: #173b57;
    opacity: .38;
}

.mapper-edge-icon i {
    position: absolute;
    display: block;
    width: 15px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.mapper-edge-icon i:nth-of-type(1) { top: 6px; }
.mapper-edge-icon i:nth-of-type(2) { top: 12px; width: 21px; }
.mapper-edge-icon i:nth-of-type(3) { top: 18px; width: 12px; }

.mapper-edge-icon.edge-left b {
    left: 1px; top: 2px; width: 2px; height: 21px;
}
.mapper-edge-icon.edge-left i { left: 5px; }

.mapper-edge-icon.edge-right b {
    right: 1px; top: 2px; width: 2px; height: 21px;
}
.mapper-edge-icon.edge-right i { right: 5px; }

.mapper-edge-icon.edge-hcenter b {
    left: 14px; top: 2px; width: 2px; height: 21px;
}
.mapper-edge-icon.edge-hcenter i:nth-of-type(1) { left: 7px; }
.mapper-edge-icon.edge-hcenter i:nth-of-type(2) { left: 4px; }
.mapper-edge-icon.edge-hcenter i:nth-of-type(3) { left: 9px; }

.mapper-edge-icon.edge-top b,
.mapper-edge-icon.edge-vcenter b,
.mapper-edge-icon.edge-bottom b {
    left: 3px;
    width: 24px;
    height: 2px;
}

.mapper-edge-icon.edge-top b { top: 1px; }
.mapper-edge-icon.edge-vcenter b { top: 12px; }
.mapper-edge-icon.edge-bottom b { bottom: 1px; }

.mapper-edge-icon.edge-top i,
.mapper-edge-icon.edge-vcenter i,
.mapper-edge-icon.edge-bottom i {
    left: 7px;
}

.mapper-edge-icon.edge-top i:nth-of-type(1) { top: 6px; }
.mapper-edge-icon.edge-top i:nth-of-type(2) { top: 11px; }
.mapper-edge-icon.edge-top i:nth-of-type(3) { top: 16px; }

.mapper-edge-icon.edge-vcenter i:nth-of-type(1) { top: 5px; }
.mapper-edge-icon.edge-vcenter i:nth-of-type(2) { top: 11px; }
.mapper-edge-icon.edge-vcenter i:nth-of-type(3) { top: 17px; }

.mapper-edge-icon.edge-bottom i:nth-of-type(1) { top: 5px; }
.mapper-edge-icon.edge-bottom i:nth-of-type(2) { top: 10px; }
.mapper-edge-icon.edge-bottom i:nth-of-type(3) { top: 15px; }

/* Distribution icons */
.distribute-icon {
    position: relative;
    display: block;
    width: 42px;
    height: 26px;
}

.distribute-horizontal b,
.distribute-horizontal::after {
    content: "";
    position: absolute;
    top: 2px;
    width: 2px;
    height: 22px;
    background: #8da0ae;
}
.distribute-horizontal b { left: 1px; }
.distribute-horizontal::after { right: 1px; }
.distribute-horizontal i {
    position: absolute;
    top: 7px;
    width: 5px;
    height: 13px;
    border: 2px solid currentColor;
}
.distribute-horizontal i:nth-of-type(1) { left: 7px; }
.distribute-horizontal i:nth-of-type(2) { left: 18px; }
.distribute-horizontal i:nth-of-type(3) { right: 7px; }

.distribute-vertical b,
.distribute-vertical::after {
    content: "";
    position: absolute;
    left: 7px;
    width: 28px;
    height: 2px;
    background: #8da0ae;
}
.distribute-vertical b { top: 1px; }
.distribute-vertical::after { bottom: 1px; }
.distribute-vertical i {
    position: absolute;
    left: 15px;
    width: 13px;
    height: 4px;
    border: 2px solid currentColor;
}
.distribute-vertical i:nth-of-type(1) { top: 5px; }
.distribute-vertical i:nth-of-type(2) { top: 11px; }
.distribute-vertical i:nth-of-type(3) { top: 17px; }

/* Field Properties formatting buttons */
.quick-alignment-native-select {
    display: none !important;
}

.quick-horizontal-align-field {
    grid-column: 1 / -1;
}

.quick-alignment-button-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin-top: 7px;
}

.quick-align-icon-button {
    display: grid;
    place-items: center;
    min-width: 0;
    height: 48px;
    padding: 7px;
    border: 1px solid #b8c5cf;
    border-radius: 8px;
    background: #ffffff;
    color: #173b57;
    cursor: pointer;
}

.quick-align-icon-button:hover {
    border-color: #173b57;
    background: #f4f8fb;
}

.quick-align-icon-button.is-active {
    border-color: #173b57;
    background: #173b57;
    color: #ffffff;
}

.quick-format-section-title {
    margin-top: 15px;
    margin-bottom: 4px;
    font-weight: 700;
}

/* Familiar Word-style horizontal alignment symbol */
.word-align-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 27px;
}

.word-align-icon i {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.word-align-icon i:nth-child(1) { width: 27px; }
.word-align-icon i:nth-child(2) { width: 19px; }
.word-align-icon i:nth-child(3) { width: 24px; }

.word-align-icon.horizontal-left { align-items: flex-start; }
.word-align-icon.horizontal-center { align-items: center; }
.word-align-icon.horizontal-right { align-items: flex-end; }

/* Familiar top/middle/bottom text-in-cell symbol */
.word-vertical-icon {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 31px;
    height: 31px;
    padding: 3px 5px;
    border-top: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    opacity: .95;
}

.word-vertical-icon i {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.word-vertical-icon.vertical-top {
    justify-content: flex-start;
}

.word-vertical-icon.vertical-middle {
    justify-content: center;
}

.word-vertical-icon.vertical-bottom {
    justify-content: flex-end;
}

/* Give the floating properties box a little more breathing room for icons. */
.quick-field-properties {
    width: 330px;
}

/* Keep the cleaned-up document preview sizing from the current design. */
.document-fill-print-dialog {
    width: min(96vw, 1180px);
    max-width: 1180px;
    height: 90vh;
    max-height: 90vh;
    margin: auto;
    padding: 0;
    overflow: hidden;
}

.document-fill-print-shell {
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.document-fill-print-header {
    flex: 0 0 auto;
}

.document-fill-print-pages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}


/* =========================================================
   STEP 36 — FIELD ALIGNMENT ICONS
   These represent mapped boxes, not text alignment.
   ========================================================= */

.field-align-icon {
    position: relative;
    display: block;
    width: 40px;
    height: 30px;
    color: #173b57;
}

.field-align-icon .guide {
    position: absolute;
    display: block;
    background: #8ea0ae;
    border-radius: 2px;
}

.field-align-icon .box {
    position: absolute;
    display: block;
    box-sizing: border-box;
    border: 2px solid currentColor;
    border-radius: 2px;
    background: rgba(23, 59, 87, 0.04);
}

/* LEFT */
.field-align-left .guide {
    left: 3px;
    top: 2px;
    width: 2px;
    height: 26px;
}
.field-align-left .box-a {
    left: 7px;
    top: 3px;
    width: 18px;
    height: 6px;
}
.field-align-left .box-b {
    left: 7px;
    top: 12px;
    width: 28px;
    height: 6px;
}
.field-align-left .box-c {
    left: 7px;
    top: 21px;
    width: 13px;
    height: 6px;
}

/* HORIZONTAL CENTER */
.field-align-hcenter .guide {
    left: 19px;
    top: 2px;
    width: 2px;
    height: 26px;
}
.field-align-hcenter .box-a {
    left: 11px;
    top: 3px;
    width: 18px;
    height: 6px;
}
.field-align-hcenter .box-b {
    left: 6px;
    top: 12px;
    width: 28px;
    height: 6px;
}
.field-align-hcenter .box-c {
    left: 13px;
    top: 21px;
    width: 14px;
    height: 6px;
}

/* RIGHT */
.field-align-right .guide {
    right: 3px;
    top: 2px;
    width: 2px;
    height: 26px;
}
.field-align-right .box-a {
    right: 7px;
    top: 3px;
    width: 18px;
    height: 6px;
}
.field-align-right .box-b {
    right: 7px;
    top: 12px;
    width: 28px;
    height: 6px;
}
.field-align-right .box-c {
    right: 7px;
    top: 21px;
    width: 13px;
    height: 6px;
}

/* TOP */
.field-align-top .guide {
    left: 4px;
    top: 2px;
    width: 32px;
    height: 2px;
}
.field-align-top .box-a {
    left: 4px;
    top: 7px;
    width: 8px;
    height: 17px;
}
.field-align-top .box-b {
    left: 16px;
    top: 7px;
    width: 8px;
    height: 11px;
}
.field-align-top .box-c {
    left: 28px;
    top: 7px;
    width: 8px;
    height: 21px;
}

/* VERTICAL CENTER */
.field-align-vcenter .guide {
    left: 4px;
    top: 14px;
    width: 32px;
    height: 2px;
}
.field-align-vcenter .box-a {
    left: 4px;
    top: 7px;
    width: 8px;
    height: 16px;
}
.field-align-vcenter .box-b {
    left: 16px;
    top: 9px;
    width: 8px;
    height: 12px;
}
.field-align-vcenter .box-c {
    left: 28px;
    top: 5px;
    width: 8px;
    height: 20px;
}

/* BOTTOM */
.field-align-bottom .guide {
    left: 4px;
    bottom: 2px;
    width: 32px;
    height: 2px;
}
.field-align-bottom .box-a {
    left: 4px;
    bottom: 6px;
    width: 8px;
    height: 17px;
}
.field-align-bottom .box-b {
    left: 16px;
    bottom: 6px;
    width: 8px;
    height: 11px;
}
.field-align-bottom .box-c {
    left: 28px;
    bottom: 6px;
    width: 8px;
    height: 21px;
}


/* =========================================================
   STEP 42 — SAFE PUBLIC DEFENDER VISUAL REDESIGN
   CSS ONLY: preserves all existing PD logic and data.
   ========================================================= */

#publicDefenderList .pd-person-card {
    overflow: hidden;
    padding: 0;
    border: 1px solid #d8e2ea;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(27, 48, 64, 0.055);
}

/* Client identity/header */
#publicDefenderList .pd-person-card > .role-person-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin: 0;
    padding: 20px 22px 8px;
    border: 0;
}

#publicDefenderList .pd-person-card > .role-person-card-heading h3 {
    margin: 0 0 5px;
    color: #12263a;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

#publicDefenderList .pd-person-card > .role-person-card-heading p {
    margin: 2px 0;
    color: #667988;
    font-size: 0.86rem;
}

#publicDefenderList .pd-person-card > .pd-client-attention {
    display: inline-flex;
    margin: 0 22px 10px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff1da;
    color: #8a5200;
    font-size: 0.77rem;
    font-weight: 750;
}

#publicDefenderList .pd-person-card > .pd-open-workspace-button {
    margin: 0 22px 18px;
}

/* Open workspace becomes a clean two-column dashboard. */
#publicDefenderList .pd-client-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.9fr);
    gap: 16px;
    padding: 18px 22px 22px;
    border-top: 1px solid #e7edf2;
    background: #f8fafc;
    align-items: start;
}

#publicDefenderList .pd-client-workspace[hidden] {
    display: none !important;
}

#publicDefenderList .pd-workspace-section {
    margin: 0;
    padding: 16px;
    border: 1px solid #dde5eb;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(24, 44, 60, 0.025);
}

/* Cases stay on the left and get the most room. */
#publicDefenderList .pd-client-workspace > .pd-workspace-section:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / span 3;
}

/* Conference + plea actions sit below/alongside cases. */
#publicDefenderList .pd-client-workspace > .pd-workspace-section:nth-child(2) {
    grid-column: 1;
    grid-row: 4;
}

#publicDefenderList .pd-client-workspace > .pd-workspace-section:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
}

/* Documents and private notes stack on the right. */
#publicDefenderList .pd-client-workspace > .pd-workspace-section:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
}

#publicDefenderList .pd-client-workspace > .pd-workspace-section:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
}

#publicDefenderList .pd-workspace-section > h4,
#publicDefenderList .pd-workspace-section-heading h4 {
    margin: 0;
    color: #172b3e;
    font-size: 1rem;
}

#publicDefenderList .pd-workspace-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

#publicDefenderList .pd-workspace-section-heading > div {
    min-width: 0;
}

#publicDefenderList .pd-workspace-muted {
    margin: 5px 0 0;
    color: #71818e;
    font-size: 0.78rem;
    line-height: 1.42;
}

/* Case rows become compact list items instead of giant cards. */
#publicDefenderList .role-case-list {
    display: grid;
    gap: 0;
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
}

#publicDefenderList .role-case-row {
    margin: 0;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid #e8edf1;
    border-radius: 0;
    background: #ffffff;
}

#publicDefenderList .role-case-row:last-child {
    border-bottom: 0;
}

#publicDefenderList .role-case-row:hover {
    background: #fafcfd;
}

#publicDefenderList .role-case-row h4 {
    margin: 0 0 5px;
    color: #145aa3;
    font-size: 0.9rem;
}

#publicDefenderList .role-case-row p {
    margin: 2px 0;
    color: #344a5d;
    font-size: 0.8rem;
    line-height: 1.35;
}

#publicDefenderList .role-case-row p strong {
    color: #1d3448;
}

/* Plea history / terms */
#publicDefenderList .pd-plea-list {
    display: grid;
    gap: 12px;
}

#publicDefenderList .pd-plea-entry {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

#publicDefenderList .pd-plea-entry-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 9px;
    border-bottom: 1px solid #e7edf1;
}

#publicDefenderList .pd-plea-entry-heading > strong {
    color: #1a3044;
}

#publicDefenderList .pd-plea-entry-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7d8c;
    font-size: 0.75rem;
}

#publicDefenderList .pd-plea-overall-summary {
    margin: 0 0 10px;
    padding: 11px 12px;
    border: 1px solid #e1e7ec;
    border-radius: 9px;
    background: #f8fafc;
}

#publicDefenderList .pd-plea-overall-summary > strong {
    display: block;
    margin-bottom: 5px;
    color: #344b60;
    font-size: 0.78rem;
}

#publicDefenderList .pd-plea-overall-summary p {
    margin: 0;
    color: #53687a;
    font-size: 0.75rem;
    line-height: 1.45;
}

#publicDefenderList .pd-plea-case-summary {
    padding: 8px 0;
    border-top: 1px solid #eef2f5;
}

#publicDefenderList .pd-plea-case-summary > strong {
    color: #22394d;
    font-size: 0.77rem;
}

#publicDefenderList .pd-plea-case-summary p {
    margin: 3px 0 0;
    color: #5c6f7e;
    font-size: 0.74rem;
    line-height: 1.35;
}

/* Conference entries */
#publicDefenderList .pd-conference-list {
    margin-top: 10px;
}

#publicDefenderList .pd-conference-entry {
    padding: 10px 12px;
    border: 1px solid #e3e9ee;
    border-radius: 9px;
    background: #fafcfd;
}

/* Documents */
#publicDefenderList .pd-document-template-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* Summary cards and search area get subtle polish too. */
#publicDefenderView .role-summary-card,
[data-role-view="publicDefender"] .role-summary-card {
    border-radius: 14px;
    border-color: #dae3ea;
    box-shadow: 0 5px 18px rgba(28, 47, 62, 0.035);
}

#publicDefenderSearch,
#publicDefenderStatusFilter {
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 1050px) {
    #publicDefenderList .pd-client-workspace {
        grid-template-columns: 1fr;
    }

    #publicDefenderList .pd-client-workspace > .pd-workspace-section:nth-child(n) {
        grid-column: 1;
        grid-row: auto;
    }
}

@media (max-width: 700px) {
    #publicDefenderList .pd-person-card > .role-person-card-heading,
    #publicDefenderList .pd-workspace-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    #publicDefenderList .pd-client-workspace {
        padding: 14px;
    }
}


/* =========================================================
   STEP 43 — AUTO FIT TEXT
   ========================================================= */

.quick-autofit-option {
    margin-top: 8px;
}

.quick-autofit-help {
    margin: 4px 0 2px 28px;
    color: #71818d;
    font-size: 0.74rem;
    line-height: 1.35;
}


/* =========================================================
   STEP 44 — FIELD PROPERTIES PANEL SIZE FIX
   ========================================================= */

#documentFieldMapperDialog .quick-field-properties {
    box-sizing: border-box;
    max-height: calc(100% - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 12px;
}

#documentFieldMapperDialog .quick-field-properties-header {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #ffffff;
}

#documentFieldMapperDialog .quick-field-properties .form-field {
    margin-bottom: 10px;
}

#documentFieldMapperDialog .quick-format-section-title {
    margin-top: 10px;
}

#documentFieldMapperDialog .quick-align-icon-button {
    height: 42px;
}

#documentFieldMapperDialog .quick-autofit-help {
    margin-top: 2px;
    margin-bottom: 8px;
}

#documentFieldMapperDialog .quick-field-done {
    margin-top: 8px;
}


/* =========================================================
   STEP 45 — CENTERED FIELD PROPERTIES + RELIABLE AUTOFIT
   ========================================================= */

#documentFieldMapperDialog .quick-field-properties {
    position: absolute;
    width: min(390px, calc(100% - 32px));
    max-width: calc(100% - 32px);
    max-height: calc(100% - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    overscroll-behavior: contain;
}

#documentFieldMapperDialog .quick-field-properties-header {
    position: sticky;
    top: 0;
    z-index: 10;
    margin: -1px -1px 10px;
    padding-top: 2px;
    background: #fff;
}

#documentFieldMapperDialog .quick-field-done {
    position: sticky;
    bottom: 0;
    z-index: 10;
    width: 100%;
    margin-top: 10px;
    background: #173f5f;
    box-shadow: 0 -8px 12px rgba(255,255,255,.92);
}

/* Tighten the editor so all controls fit comfortably. */
#documentFieldMapperDialog .quick-field-properties {
    padding: 14px 16px 12px;
}

#documentFieldMapperDialog .quick-field-properties h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

#documentFieldMapperDialog .quick-field-properties label,
#documentFieldMapperDialog .quick-format-section-title {
    margin-bottom: 5px;
}

#documentFieldMapperDialog .quick-field-properties input,
#documentFieldMapperDialog .quick-field-properties select {
    min-height: 42px;
}

#documentFieldMapperDialog .quick-align-icon-button {
    min-height: 40px;
    height: 40px;
}

#documentFieldMapperDialog .quick-autofit-help {
    margin: 2px 0 6px 27px;
    font-size: .72rem;
    line-height: 1.25;
}

/* The mapped fill fields must be allowed to report overflow accurately. */
.document-fill-field {
    box-sizing: border-box;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}
.pd-amended-to-field[hidden] {
    display: none !important;
}
.pd-plea-case-result {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid #d9e2ea;
    border-radius: 10px;
    background: #f9fbfc;
}

.pd-plea-case-result:last-child {
    margin-bottom: 0;
}

.pd-plea-case-heading {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e3e8ed;
}

.pd-plea-case-heading strong {
    display: block;
    margin-bottom: 2px;
}

.pd-plea-case-result .form-field {
    margin-bottom: 10px;
}

/* =========================================================
   HIERARCHICAL COURTCHECK DATA PICKER
   ========================================================= */

.quick-data-picker {
    padding-bottom: 4px;
}

.quick-data-picker .quick-format-section-title {
    margin-bottom: 8px;
}

.quick-data-picker .form-field {
    margin-bottom: 8px !important;
}

.quick-data-picker select {
    width: 100%;
}


/* =========================================================
   AUTO DETECT FIELDS
   ========================================================= */


.document-mapped-field.auto-detected {
    border: 2px dashed rgba(37, 99, 235, .65);
    background: rgba(59, 130, 246, .06);
    box-shadow: none;
}

.document-mapped-field.auto-detected:not(.selected) {
    opacity: .72;
}

.document-mapped-field.auto-detected:hover,
.document-mapped-field.auto-detected.selected {
    opacity: 1;
    background: rgba(59, 130, 246, .10);
}


/* Structural Auto Detect: cell geometry */
.document-mapped-field.auto-detected {
    box-sizing: border-box;
}

.document-mapped-field.auto-detected[data-detected-kind="tableCell"] {
    border-width: 2px;
}


/* =========================================================
   REPEAT CASE ROW
   ========================================================= */

.mapper-repeat-row-button {
    white-space: nowrap;
}


/* =========================================================
   CHECKBOX DOCUMENT FIELDS
   ========================================================= */

.document-mapped-field.checkbox-field {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 22px;
    line-height: 1;
}

.quick-checkbox-help {
    margin: 8px 0 12px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.35;
}

.document-fill-print-checkbox {
    position: absolute;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: pointer;
    accent-color: currentColor;
    z-index: 2;
}

@media print {
    .document-fill-print-checkbox {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}


.document-fill-print-checkbox {
    appearance: auto;
    -webkit-appearance: checkbox;
    background: transparent;
}

.precision-placement-card{width:min(980px,calc(100vw - 40px));max-width:980px}
.precision-placement-viewport{position:relative;margin:16px auto;overflow:hidden;border:1px solid #cbd5e1;background:#fff;box-shadow:0 10px 28px rgba(15,23,42,.14)}
.precision-placement-viewport canvas{display:block;pointer-events:none;user-select:none}
.precision-placement-field{position:absolute;box-sizing:border-box;border:3px solid #dc2626;background:rgba(220,38,38,.08);cursor:move;outline:none}
.precision-placement-field:focus{box-shadow:0 0 0 3px rgba(37,99,235,.28)}
.precision-handle{position:absolute;width:12px;height:12px;background:#fff;border:2px solid #dc2626;border-radius:2px}
.precision-handle.nw{left:-7px;top:-7px;cursor:nwse-resize}.precision-handle.ne{right:-7px;top:-7px;cursor:nesw-resize}
.precision-handle.sw{left:-7px;bottom:-7px;cursor:nesw-resize}.precision-handle.se{right:-7px;bottom:-7px;cursor:nwse-resize}
.precision-placement-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:12px;font-size:13px;color:#64748b}
.quick-field-actions{display:flex;gap:8px;margin-top:10px}.quick-field-actions .quick-field-done{flex:1}

/* Precision Placement v2: true floating magnifier */
#precisionPlacementModal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 100000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    background: rgba(15, 23, 42, .68) !important;
    overflow: auto !important;
}
#precisionPlacementModal.hidden {
    display: none !important;
}
#precisionPlacementModal .precision-placement-card {
    position: relative !important;
    width: auto !important;
    max-width: min(900px, calc(100vw - 48px)) !important;
    max-height: calc(100vh - 48px) !important;
    margin: auto !important;
    padding: 20px !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: 0 24px 70px rgba(0,0,0,.35) !important;
    overflow: auto !important;
}
#precisionPlacementModal .modal-header {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 20px !important;
}
#precisionPlacementModal .modal-header h3 {
    margin: 0 0 4px !important;
}
#precisionPlacementModal .precision-placement-viewport {
    max-width: calc(100vw - 100px) !important;
    max-height: calc(100vh - 250px) !important;
}


/* Precision Placement drag reliability */
#precisionPlacementField {
    z-index: 10 !important;
    pointer-events: auto !important;
    touch-action: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

#precisionPlacementField .precision-handle {
    z-index: 11 !important;
    pointer-events: auto !important;
    touch-action: none !important;
}

body.precision-dragging,
body.precision-dragging * {
    cursor: grabbing !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

#precisionPlacementCanvas {
    pointer-events: none !important;
}


/* =========================================================
   PRINT PREVIEW CHECKBOXES — COURTENTRY DRAWN X
   ========================================================= */

.document-fill-print-checkbox {
    position: absolute;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #111827;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    appearance: none;
    -webkit-appearance: none;
}

.document-fill-print-checkbox.checked {
    font-size: 18px;
}

.document-fill-print-checkbox:focus {
    outline: 1px dashed rgba(15, 23, 42, .55);
    outline-offset: 1px;
}

@media print {
    .document-fill-print-checkbox {
        color: #000 !important;
        background: transparent !important;
        border: 0 !important;
        outline: 0 !important;
        box-shadow: none !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}


/* =========================================================
   PRECISION AREA / ZOOM MAPPER
   ========================================================= */

.document-mapper-overlay.precision-area-mode {
    cursor: zoom-in !important;
}

#documentFieldMapperPrecisionAreaButton.active {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

.precision-area-selection-draft {
    position: absolute;
    z-index: 50;
    border: 2px dashed #0f766e;
    background: rgba(13, 148, 136, .12);
    pointer-events: none;
}

.precision-area-modal {
    position: fixed;
    inset: 0;
    z-index: 90000;
    pointer-events: none;
}

.precision-area-modal.hidden {
    display: none !important;
}

.precision-area-card {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    max-width: calc(100vw - 50px);
    max-height: calc(100vh - 50px);
    padding: 0;
    border: 1px solid #94a3b8;
    border-radius: 14px;
    background: #f8fafc;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .35);
    overflow: hidden;
    pointer-events: auto;
}

.precision-area-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 11px 14px;
    background: #0f172a;
    color: #fff;
    cursor: move;
    user-select: none;
}

.precision-area-header > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.precision-area-header strong {
    font-size: 1rem;
}

.precision-area-header span {
    color: #cbd5e1;
    font-size: .74rem;
}

.precision-area-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-bottom: 1px solid #cbd5e1;
    background: #fff;
}

.precision-area-toolbar button.active {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

#precisionAreaStatus {
    margin-left: auto;
    color: #475569;
    font-size: .78rem;
    font-weight: 600;
}

.precision-area-viewport {
    position: relative;
    margin: 12px;
    overflow: hidden;
    border: 1px solid #94a3b8;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

.precision-area-viewport canvas {
    display: block;
    pointer-events: none;
    user-select: none;
}

.precision-area-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    cursor: default;
    outline: none;
}

.precision-area-field {
    position: absolute;
    box-sizing: border-box;
    z-index: 5;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 2px 4px;
    border: 2px solid #2563eb;
    background: rgba(37, 99, 235, .08);
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    cursor: move;
    user-select: none;
}

.precision-area-field.checkbox {
    justify-content: center;
    padding: 0;
    font-size: 20px;
}

.precision-area-field.selected {
    border-color: #dc2626;
    background: rgba(220, 38, 38, .08);
    box-shadow: 0 0 0 1px rgba(220, 38, 38, .22);
}

.precision-area-resize-handle {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 12px;
    height: 12px;
    border: 2px solid #dc2626;
    background: #fff;
    cursor: nwse-resize;
}

.precision-area-draft {
    position: absolute;
    z-index: 10;
    border: 2px dashed #f59e0b;
    background: rgba(245, 158, 11, .12);
    pointer-events: none;
}

.precision-area-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 12px 12px;
    color: #64748b;
    font-size: .75rem;
}

#precisionAreaModal #quickFieldProperties {
    z-index: 91000;
}

/* Field Properties needs to remain above the Precision Area window. */
#quickFieldProperties {
    z-index: 92000 !important;
}


/* =========================================================
   COMPACT FIELD PROPERTIES — FONT DRAWER
   ========================================================= */

#quickFieldProperties .quick-font-toggle {
    width: 100%;
    min-height: 38px;
    margin: 4px 0 8px;
    font-weight: 700;
}

#quickFieldProperties .quick-font-toggle.active {
    background: #e8f0f7;
    border-color: #19476a;
    color: #19476a;
}

#quickFieldProperties #quickTextFormattingControls[hidden] {
    display: none !important;
}

#quickFieldProperties #quickTextFormattingControls {
    margin-top: 4px;
    padding: 10px;
    border: 1px solid #d7e0e8;
    border-radius: 10px;
    background: #f8fafc;
}


/* =========================================================
   PRECISION AREA — FULL 8-WAY RESIZE HANDLES
   ========================================================= */

.precision-area-field.selected {
    overflow: visible;
}

.precision-area-resize-handle {
    position: absolute;
    z-index: 20;
    box-sizing: border-box;
    width: 10px;
    height: 10px;
    border: 2px solid #dc2626;
    border-radius: 2px;
    background: #fff;
    pointer-events: auto;
}

.precision-area-resize-handle.resize-nw {
    left: -6px;
    top: -6px;
    cursor: nwse-resize;
}

.precision-area-resize-handle.resize-n {
    left: 50%;
    top: -6px;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.precision-area-resize-handle.resize-ne {
    right: -6px;
    top: -6px;
    cursor: nesw-resize;
}

.precision-area-resize-handle.resize-e {
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.precision-area-resize-handle.resize-se {
    right: -6px;
    bottom: -6px;
    cursor: nwse-resize;
}

.precision-area-resize-handle.resize-s {
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.precision-area-resize-handle.resize-sw {
    left: -6px;
    bottom: -6px;
    cursor: nesw-resize;
}

.precision-area-resize-handle.resize-w {
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}


/* =========================================================
   FIELD TYPE — MUTUALLY EXCLUSIVE CHECKBOX CHOICES
   ========================================================= */

.quick-field-type-options {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.quick-field-type-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
}

.quick-field-type-option input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.quick-field-type-option:has(input:checked) {
    border-color: #19476a;
    background: #eef5fa;
}


#quickFieldDataField:disabled {
    background: #eef1f4;
    color: #6b7280;
    cursor: not-allowed;
    opacity: 1;
}


/*
 * Manual-at-print fields use a deliberately subtle tint so the mapper
 * communicates field type without competing with the underlying form.
 */
.document-mapped-field.manual-print-text:not(.selected) {
    background: rgba(59, 130, 246, 0.055);
}

.document-mapped-field.manual-print-checkbox:not(.selected) {
    background: rgba(16, 185, 129, 0.065);
}


/* =========================================================
   MANUAL-AT-PRINT FIELD CUES — DOCUMENT PREVIEW ONLY
   ========================================================= */

.document-fill-print-field.manual-print-text-preview {
    background: rgba(59, 130, 246, 0.07);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
    border-radius: 2px;
}

.document-fill-print-field.manual-print-text-preview:hover,
.document-fill-print-field.manual-print-text-preview:focus {
    background: rgba(59, 130, 246, 0.11);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.30);
}

.document-fill-print-checkbox.manual-print-checkbox-preview {
    background: rgba(16, 185, 129, 0.09);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.24);
    border-radius: 2px;
}

.document-fill-print-checkbox.manual-print-checkbox-preview:hover,
.document-fill-print-checkbox.manual-print-checkbox-preview:focus {
    background: rgba(16, 185, 129, 0.14);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.36);
}

@media print {
    .document-fill-print-field.manual-print-text-preview,
    .document-fill-print-checkbox.manual-print-checkbox-preview {
        background: transparent !important;
        box-shadow: none !important;
    }
}


/* =========================================================
   PUBLIC DEFENDER — CLIENT DETAILS
   ========================================================= */

#publicDefenderList .pd-client-details-card {
    padding-bottom: 2px;
}

#publicDefenderList .pd-client-details-note {
    margin: 3px 0 0;
    color: #66758a;
    font-size: 0.82rem;
}

#publicDefenderList .pd-client-details-display {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    margin-top: 12px;
}

#publicDefenderList .pd-client-details-display span {
    display: block;
    margin-bottom: 2px;
    color: #66758a;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}

#publicDefenderList .pd-client-details-display strong {
    display: block;
    color: #172b3e;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

#publicDefenderList .pd-client-details-address {
    grid-column: 1 / -1;
}

#publicDefenderList .pd-client-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

#publicDefenderList .pd-client-details-grid label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-weight: 700;
    color: #24364a;
}

#publicDefenderList .pd-client-details-grid input {
    width: 100%;
    box-sizing: border-box;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

#publicDefenderList .pd-client-details-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

#publicDefenderList .pd-client-details-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 18px 0;
}

#publicDefenderList .pd-client-details-display[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    #publicDefenderList .pd-client-details-display,
    #publicDefenderList .pd-client-details-grid {
        grid-template-columns: 1fr;
    }
    #publicDefenderList .pd-client-details-address {
        grid-column: 1;
    }
}


/* =========================================================
   PUBLIC DEFENDER — CLIENT DETAILS DIALOG
   ========================================================= */

#publicDefenderList .pd-client-details-dialog {
    width: min(92vw, 680px);
    max-height: min(88vh, 760px);
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 26px 80px rgba(15, 23, 42, 0.30);
    overflow: hidden;
}

#publicDefenderList .pd-client-details-dialog::backdrop {
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
}

#publicDefenderList .pd-client-details-dialog .pd-client-details-form {
    padding: 0;
    margin: 0;
}

#publicDefenderList .pd-client-details-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px 14px;
    border-bottom: 1px solid #e2e8f0;
}

#publicDefenderList .pd-client-details-dialog-header h3 {
    margin: 3px 0 0;
    color: #173f5c;
    font-size: 1.25rem;
}

#publicDefenderList .pd-client-details-eyebrow {
    color: #6b7b8c;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

#publicDefenderList .pd-client-details-dialog-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eef2f5;
    color: #173f5c;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

#publicDefenderList .pd-client-details-dialog .pd-client-details-grid {
    padding: 18px 22px 4px;
}

#publicDefenderList .pd-client-details-dialog .pd-client-details-actions {
    padding: 14px 22px 20px;
    margin-top: 6px;
    border-top: 1px solid #eef2f5;
}


/* =========================================================
   CLIENT DETAILS — FLOATING MOVABLE DIALOG
   ========================================================= */

#publicDefenderList .pd-client-details-dialog {
    position: fixed;
    inset: auto;
    margin: 0;
    width: min(92vw, 680px);
    max-height: min(82vh, 760px);
    z-index: 9000;
    overflow: auto;
}

#publicDefenderList .pd-client-details-dialog::backdrop {
    display: none;
    background: transparent;
    backdrop-filter: none;
}

#publicDefenderList .pd-client-details-dialog-header {
    cursor: move;
    user-select: none;
    touch-action: none;
}

#publicDefenderList .pd-client-details-dialog.dragging {
    user-select: none;
}


/* =========================================================
   ROLE-BASED ACCESS CONTROL
   ========================================================= */

.permission-hidden {
    display: none !important;
}

.permission-denied-view {
    display: none !important;
}

.access-preview-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 8px 16px;
    border-bottom: 1px solid #d6dee5;
    background: #fff7d6;
    color: #4d3d05;
    font-size: 0.88rem;
}

.access-preview-bar[hidden] {
    display: none !important;
}

.access-preview-bar button {
    padding: 5px 10px;
    border: 1px solid #b79b2f;
    border-radius: 7px;
    background: #fff;
    color: #4d3d05;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.access-control-intro {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #cbd8e2;
    border-radius: 10px;
    background: #f7fafc;
    color: #425866;
    line-height: 1.45;
}

.role-permission-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(240px, .8fr);
    gap: 18px;
}

.role-permission-card,
.role-preview-card {
    padding: 18px;
    border: 1px solid #d7e0e7;
    border-radius: 12px;
    background: #fff;
}

.access-permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin: 18px 0;
}

.access-permission-option {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #e0e7ed;
    border-radius: 8px;
    background: #f9fbfc;
}

.access-preview-kicker {
    color: #66758a;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.role-preview-card h4 {
    margin: 5px 0 8px;
    color: #173f5c;
}

@media (max-width: 850px) {
    .role-permission-layout,
    .access-permission-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   COURTENTRY OWNER PORTAL
   ========================================================= */

.owner-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.owner-organizations-section {
    margin-top: 0;
}

.owner-organizations-section .workspace-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
}

.owner-organization-search {
    width: min(100%, 320px);
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font: inherit;
}

.owner-organization-list {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.owner-organization-card {
    padding: 18px;
    border: 1px solid #d8e1e8;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.035);
}

.owner-organization-card-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.owner-organization-card-heading h3 {
    margin: 4px 0 3px;
    color: #173f5c;
}

.owner-organization-card-heading code {
    color: #607487;
    font-size: .82rem;
}

.owner-organization-type,
.owner-dialog-eyebrow {
    color: #66758a;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.owner-organization-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
}

.owner-organization-status.active {
    background: #e8f5ec;
    color: #23643a;
}

.owner-organization-status.trial {
    background: #fff5d9;
    color: #735a05;
}

.owner-organization-status.suspended {
    background: #fdeaea;
    color: #8f2e2e;
}

.owner-organization-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.owner-organization-facts > div {
    min-width: 0;
}

.owner-organization-facts span {
    display: block;
    margin-bottom: 3px;
    color: #6b7b8c;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.owner-organization-facts strong,
.owner-organization-facts small {
    display: block;
    overflow-wrap: anywhere;
}

.owner-organization-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.owner-organization-dialog {
    width: min(92vw, 760px);
    max-height: 88vh;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(15, 23, 42, .34);
    overflow: auto;
}

.owner-organization-dialog::backdrop {
    background: rgba(15, 23, 42, .52);
    backdrop-filter: blur(2px);
}

.owner-organization-form {
    margin: 0;
}

.owner-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.owner-dialog-header h2 {
    margin: 4px 0;
    color: #173f5c;
}

.owner-dialog-header p {
    margin: 0;
    color: #66758a;
}

.owner-dialog-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eef2f5;
    color: #173f5c;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.owner-form-section {
    padding: 18px 24px;
}

.owner-form-section + .owner-form-section {
    border-top: 1px solid #edf1f4;
}

.owner-form-section h3 {
    margin: 0 0 12px;
    color: #173f5c;
}

.owner-form-help {
    margin: -5px 0 14px;
    color: #66758a;
    font-size: .88rem;
}

.owner-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.owner-grid-wide {
    grid-column: 1 / -1;
}

.owner-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 22px;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 850px) {
    .owner-summary-grid,
    .owner-organization-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .owner-organizations-section .workspace-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .owner-organization-search {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .owner-summary-grid,
    .owner-organization-facts,
    .owner-form-grid {
        grid-template-columns: 1fr;
    }

    .owner-grid-wide {
        grid-column: 1;
    }
}


/* =========================================================
   ORGANIZATION FIRST-LOGIN USER SETUP
   ========================================================= */

.organization-onboarding-view {
    padding: 0;
}

.organization-onboarding-shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 0 50px;
}

.organization-onboarding-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 20px;
}

.organization-onboarding-kicker,
.organization-user-role {
    color: #66758a;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.organization-onboarding-header h2 {
    margin: 4px 0 5px;
    color: #173f5c;
}

.organization-onboarding-header p {
    margin: 0;
    color: #66758a;
}

.organization-license-meter {
    min-width: 170px;
    padding: 14px 16px;
    border: 1px solid #d7e0e7;
    border-radius: 12px;
    background: #fff;
    text-align: right;
}

.organization-license-meter span {
    display: block;
    color: #6b7b8c;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.organization-license-meter strong {
    display: block;
    margin-top: 4px;
    color: #173f5c;
    font-size: 1.35rem;
}

.organization-onboarding-card {
    padding: 20px;
    border: 1px solid #d8e1e8;
    border-radius: 14px;
    background: #fff;
}

.organization-onboarding-card-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.organization-onboarding-card-heading h3 {
    margin: 0 0 4px;
    color: #173f5c;
}

.organization-onboarding-card-heading p {
    margin: 0;
    color: #66758a;
}

.organization-user-list {
    display: grid;
    gap: 10px;
}

.organization-user-card {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 15px 16px;
    border: 1px solid #e0e7ed;
    border-radius: 10px;
    background: #f9fbfc;
}

.organization-user-card h4 {
    margin: 3px 0;
    color: #173f5c;
}

.organization-user-card p {
    margin: 0;
    color: #66758a;
}

.organization-user-status {
    text-align: right;
}

.organization-user-status > span {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 800;
}

.organization-user-status > span.active {
    background: #e8f5ec;
    color: #23643a;
}

.organization-user-status > span.pending {
    background: #fff5d9;
    color: #705804;
}

.organization-user-status small {
    display: block;
    margin-top: 5px;
    color: #66758a;
}

.organization-onboarding-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.organization-user-dialog {
    width: min(92vw, 620px);
    padding: 0;
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(15,23,42,.32);
}

.organization-user-dialog::backdrop {
    background: rgba(15,23,42,.48);
}

.organization-user-dialog-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px 15px;
    border-bottom: 1px solid #e2e8f0;
}

.organization-user-dialog-header h2 {
    margin: 4px 0;
    color: #173f5c;
}

.organization-user-dialog-header p {
    margin: 0;
    color: #66758a;
}

.organization-user-dialog-close {
    width: 35px;
    height: 35px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eef2f5;
    color: #173f5c;
    font-size: 24px;
    cursor: pointer;
}

.organization-user-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 18px 22px;
}

.organization-user-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
}

.organization-user-form-grid .wide {
    grid-column: 1 / -1;
}

.organization-user-form-grid input,
.organization-user-form-grid select {
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

.organization-user-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 22px 20px;
    border-top: 1px solid #e2e8f0;
}

#addOrganizationUserButton:disabled {
    cursor: not-allowed;
    opacity: .55;
}

@media (max-width: 700px) {
    .organization-onboarding-header,
    .organization-onboarding-card-heading,
    .organization-user-card {
        align-items: stretch;
        flex-direction: column;
    }

    .organization-license-meter,
    .organization-user-status {
        text-align: left;
    }

    .organization-user-form-grid {
        grid-template-columns: 1fr;
    }

    .organization-user-form-grid .wide {
        grid-column: 1;
    }
}


/* =========================================================
   ORGANIZATION USER MANAGEMENT
   ========================================================= */

.organization-user-name-button {
    display: block;
    margin: 3px 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #173f5c;
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.organization-user-name-button:hover {
    text-decoration: underline;
}

.organization-user-manage-button {
    display: block;
    margin-top: 7px;
    min-height: 30px;
    padding: 5px 9px;
    font-size: .76rem;
}

.organization-user-details-body {
    padding: 18px 22px;
}

.organization-user-details-role {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
}

.organization-user-details-role select {
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

.organization-user-invite-panel {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #dbe3e9;
    border-radius: 10px;
    background: #f8fafb;
}

.organization-user-invite-panel strong,
.organization-user-invite-panel small {
    display: block;
}

.organization-user-invite-panel strong {
    margin-top: 4px;
    color: #173f5c;
}

.organization-user-invite-panel small {
    margin-top: 3px;
    color: #66758a;
}

.organization-user-invite-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.organization-user-dialog-actions {
    justify-content: space-between;
}

.organization-user-dialog-action-group {
    display: flex;
    gap: 10px;
}

.danger-button {
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid #c24d4d;
    border-radius: 8px;
    background: #fff;
    color: #9f3030;
    font-weight: 800;
    cursor: pointer;
}

.danger-button:hover {
    background: #fff1f1;
}

@media (max-width: 650px) {
    .organization-user-invite-panel,
    .organization-user-dialog-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .organization-user-invite-actions,
    .organization-user-dialog-action-group {
        justify-content: flex-start;
    }
}


/* =========================================================
   ADMINISTRATION USERS PANEL
   ========================================================= */

.admin-users-license-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid #d8e1e8;
    border-radius: 10px;
    background: #f8fafb;
}

.admin-users-license-summary span {
    display: block;
    color: #66758a;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.admin-users-license-summary strong {
    display: block;
    margin-top: 3px;
    color: #173f5c;
    font-size: 1.25rem;
}

.admin-users-license-summary p {
    margin: 0;
    color: #66758a;
}

#adminAddOrganizationUserButton:disabled {
    cursor: not-allowed;
    opacity: .55;
}

@media (max-width: 700px) {
    .admin-users-license-summary {
        align-items: flex-start;
        flex-direction: column;
    }
}


.session-sign-out-button {
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 7px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
}

.session-sign-out-button[hidden] {
    display: none !important;
}


/* =========================================================
   CHECKPOINT PHOTO RECORD
   ========================================================= */
.check-in-photo-summary { display:grid; grid-template-columns:64px minmax(0,1fr) auto; align-items:center; gap:12px; margin-top:12px; padding:10px 12px; border:1px solid #d7e1e8; border-radius:12px; background:#f7fafc; }
.check-in-photo-thumbnail { width:64px; height:64px; object-fit:cover; border-radius:10px; background:#dfe7ec; }
.check-in-photo-details { display:grid; min-width:0; gap:3px; }
.check-in-photo-details strong { color:#183f5b; }
.check-in-photo-details span { color:#617684; font-size:.82rem; }
.check-in-photo-view-button { width:auto; white-space:nowrap; }
.check-in-photo-dialog { width:min(92vw,760px); padding:0; border:0; border-radius:18px; box-shadow:0 24px 70px rgba(0,0,0,.30); }
.check-in-photo-dialog::backdrop { background:rgba(8,24,36,.72); backdrop-filter:blur(3px); }
.check-in-photo-dialog-content { padding:26px; }
.check-in-photo-dialog-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:18px; }
.check-in-photo-dialog-heading h2 { margin:0; color:#183f5b; }
.check-in-photo-record { display:grid; grid-template-columns:minmax(220px,.9fr) minmax(240px,1.1fr); gap:20px; align-items:start; }
.check-in-photo-large { width:100%; max-height:460px; object-fit:contain; border:1px solid #d7e1e8; border-radius:14px; background:#edf2f5; }
.check-in-photo-record-details { display:grid; gap:7px; padding:18px; border:1px solid #d7e1e8; border-radius:14px; background:#f7fafc; }
.check-in-photo-record-details span { margin-top:8px; color:#617684; font-size:.78rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.check-in-photo-record-details span:first-child { margin-top:0; }
.check-in-photo-record-details strong { color:#183f5b; font-size:1rem; }
.check-in-photo-link-note { margin:18px 0 0; padding:11px 13px; border-left:4px solid #2f7d4a; background:#edf7f1; color:#355547; font-size:.86rem; }
@media (max-width:680px) { .check-in-photo-summary { grid-template-columns:56px minmax(0,1fr); } .check-in-photo-thumbnail { width:56px; height:56px; } .check-in-photo-view-button { grid-column:1/-1; width:100%; } .check-in-photo-record { grid-template-columns:1fr; } .check-in-photo-dialog-heading { flex-direction:column; } }


/* =========================================================
   DRIVER LICENSE SCANNER
   ========================================================= */
.driver-license-scanner-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 0 0 16px;
    border: 1px solid var(--border-color, #d7dce2);
    border-radius: 12px;
    background: var(--surface-color, #fff);
}

.driver-license-scanner-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex: 0 0 12px;
    background: #2f8f4e;
}

.driver-license-scanner-panel[data-scanner-status="working"] .driver-license-scanner-indicator { background: #d59b17; }
.driver-license-scanner-panel[data-scanner-status="success"] .driver-license-scanner-indicator { background: #2f8f4e; }
.driver-license-scanner-panel[data-scanner-status="warning"] .driver-license-scanner-indicator { background: #d59b17; }
.driver-license-scanner-panel[data-scanner-status="error"] .driver-license-scanner-indicator { background: #b64040; }

.driver-license-scanner-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.driver-license-scanner-copy strong { font-size: 0.95rem; }
.driver-license-scanner-copy span { color: var(--muted-text, #657080); font-size: 0.86rem; }

.driver-license-match-dialog { width: min(680px, calc(100% - 32px)); }
.driver-license-match-content { padding: 4px; }
.driver-license-match-message { margin: 8px 0 14px; color: var(--muted-text, #657080); }
.driver-license-match-list { display: grid; gap: 10px; }
.driver-license-match-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border-color, #d7dce2);
    border-radius: 10px;
}
.driver-license-match-row > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.driver-license-match-row span { color: var(--muted-text, #657080); font-size: 0.86rem; }

@media (max-width: 620px) {
    .driver-license-match-row { align-items: stretch; flex-direction: column; }
    .driver-license-match-row button { width: 100%; }
}

/* Off-docket workflow: hidden conditional fields must remain out of layout. */
#offDocketDialog [hidden] {
    display: none !important;
}



/* =========================================================
   OFFICER / DETECTIVE PERSON HISTORY SEARCH
   ========================================================= */
.person-history-search-panel {
    background: #ffffff;
    border: 1px solid #d9dee7;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
}
.person-history-search-grid {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) minmax(180px, 1fr) auto;
    gap: 14px;
    align-items: end;
}
.person-history-search-button { min-height: 42px; }
.person-history-search-note { margin: 10px 0 0; color: #657083; font-size: .9rem; }
.person-history-results-heading { margin-bottom: 12px; }
.person-history-results { display: grid; gap: 14px; }
.person-history-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 18px;
    background: #fff;
    border: 1px solid #d9dee7;
    border-radius: 12px;
    padding: 16px;
}
.person-history-photo-column { width: 112px; }
.person-history-photo {
    display: block;
    width: 112px;
    height: 140px;
    object-fit: cover;
    border: 1px solid #ccd3df;
    border-radius: 10px;
    background: #eef1f5;
}
.person-history-photo-empty {
    display: grid;
    place-items: center;
    color: #7b8493;
    font-size: .85rem;
    text-align: center;
}
.person-history-card-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.person-history-card-heading h3 { margin: 0 0 4px; }
.person-history-card-heading p { margin: 0; color: #5e6878; }
.person-history-session-badge {
    white-space: nowrap;
    border: 1px solid #cfd6e2;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: .78rem;
    font-weight: 700;
    color: #4b5668;
    background: #f6f8fb;
}
.person-history-detail-grid { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 14px; }
.person-history-detail-grid p, .person-history-associations p { margin: 0; }
.person-history-associations {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e3e7ee;
    display: grid;
    gap: 6px;
}
@media (max-width: 720px) {
    .person-history-search-grid { grid-template-columns: 1fr; }
    .person-history-card { grid-template-columns: 82px minmax(0, 1fr); gap: 12px; padding: 12px; }
    .person-history-photo-column { width: 82px; }
    .person-history-photo { width: 82px; height: 104px; }
    .person-history-card-heading { display: block; }
    .person-history-session-badge { display: inline-block; margin-top: 8px; }
}

/* =========================================================
   COURT HISTORY — READ-ONLY ARCHIVE
   ========================================================= */
.court-history-browser{display:grid;grid-template-columns:minmax(280px,360px) minmax(0,1fr);gap:22px;align-items:start}
.court-history-list-panel,.court-history-detail-panel{background:#fff;border:1px solid #d9dee7;border-radius:16px;box-shadow:0 8px 24px rgba(24,39,75,.06)}
.court-history-list-panel{overflow:hidden}.court-history-panel-heading{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;padding:20px;border-bottom:1px solid #e7eaf0}
.court-history-panel-heading h3,.court-history-panel-heading p,.court-history-detail-heading h3,.court-history-detail-heading p,.court-history-record-heading h3{margin:0}.court-history-panel-heading p,.court-history-detail-heading p{margin-top:5px;color:#667085}
.court-history-session-list{max-height:72vh;overflow:auto;padding:10px}.court-history-session-card{width:100%;display:grid;gap:5px;text-align:left;border:1px solid transparent;border-radius:12px;background:transparent;padding:14px;cursor:pointer;color:inherit}
.court-history-session-card:hover,.court-history-session-card.selected{background:#f4f7fb;border-color:#cbd5e1}.court-history-session-card strong{font-size:.98rem}.court-history-session-card>span{color:#667085;font-size:.86rem}.court-history-session-counts{line-height:1.45}
.court-history-detail-panel{min-height:360px;padding:22px}.court-history-empty-detail{min-height:310px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:#667085}.court-history-empty-detail strong{color:#26344a;font-size:1.05rem}
.court-history-readonly-banner{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px 18px;align-items:center;margin-bottom:20px;padding:12px 14px;border-radius:10px;border:1px solid #d8dee9;background:#f6f8fb}.court-history-readonly-banner strong{color:#26344a;letter-spacing:.025em}.court-history-readonly-banner span{color:#667085;font-size:.9rem}
.court-history-detail-heading{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:18px}.court-history-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px}.court-history-summary-grid>div{border:1px solid #e2e7ef;border-radius:12px;background:#fafbfd;padding:14px;display:grid;gap:4px}.court-history-summary-grid strong{font-size:1.35rem;color:#21314b}.court-history-summary-grid span,.court-history-time-row{color:#667085;font-size:.88rem}
.court-history-time-row{display:flex;flex-wrap:wrap;gap:10px 24px;padding-bottom:18px;border-bottom:1px solid #e7eaf0}.court-history-record-section{margin-top:22px}.court-history-record-heading{display:flex;align-items:center;gap:10px;margin-bottom:10px}.court-history-record-heading span{display:inline-flex;min-width:26px;height:26px;align-items:center;justify-content:center;border-radius:999px;background:#eef2f7;color:#44546a;font-size:.8rem;font-weight:700}
.court-history-person-list{display:grid;gap:10px}.court-history-person-card{display:grid;grid-template-columns:72px minmax(0,1fr);gap:14px;padding:13px;border:1px solid #e0e5ec;border-radius:12px;background:#fff}.court-history-person-photo{width:72px;height:72px;border-radius:10px;object-fit:cover;border:1px solid #d9dee7;background:#eef2f6}.court-history-person-photo-empty{display:flex;align-items:center;justify-content:center;text-align:center;color:#7b8798;font-size:.72rem}
.court-history-person-heading{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.court-history-person-heading h4,.court-history-person-heading p{margin:0}.court-history-person-heading p{margin-top:3px;color:#667085;font-size:.86rem}.court-history-status{flex:none;border-radius:999px;padding:5px 9px;font-size:.76rem;font-weight:700}.court-history-status.present{background:#e9f7ef;color:#21653d}.court-history-status.not-present{background:#f1f3f6;color:#667085}.court-history-person-meta{display:flex;flex-wrap:wrap;gap:6px 18px;margin-top:10px;color:#4f5d70;font-size:.86rem}
.court-history-alert-list{display:grid;gap:8px}.court-history-alert-row{display:flex;justify-content:space-between;gap:14px;padding:12px 14px;border:1px solid #e0e5ec;border-radius:10px}.court-history-alert-row span{color:#667085}
@media(max-width:900px){.court-history-browser{grid-template-columns:1fr}.court-history-session-list{max-height:360px}.court-history-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.court-history-summary-grid{grid-template-columns:1fr 1fr}.court-history-person-card{grid-template-columns:56px minmax(0,1fr)}.court-history-person-photo{width:56px;height:56px}.court-history-person-heading,.court-history-detail-heading{flex-direction:column}}

/* CourtEntry v9.7 — Clerk workspace hierarchy */
.dashboard-eyebrow{display:block;margin-bottom:5px;font-size:.74rem;font-weight:800;letter-spacing:.11em;color:#667085}
.clerk-dashboard-summary{grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-top:18px}.clerk-dashboard-summary .summary-card{padding:18px}.clerk-dashboard-summary .summary-card strong{display:block;margin-top:7px;font-size:1.75rem;color:#21314b}.clerk-dashboard-summary .attention-card{border-color:#cbd5e1;background:#fafbfd}
.clerk-dashboard-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:20px}.dashboard-panel{background:#fff;border:1px solid var(--border);border-radius:12px;padding:20px;min-height:210px}.dashboard-panel-heading{display:flex;justify-content:space-between;gap:12px;padding-bottom:12px;border-bottom:1px solid #e7eaf0}.dashboard-panel-heading h3,.dashboard-panel-heading p{margin:0}.dashboard-panel-heading p{margin-top:4px;color:#667085;font-size:.88rem}.dashboard-activity-list{display:grid;gap:0}.dashboard-activity-row{display:flex;justify-content:space-between;gap:14px;padding:12px 2px;border-bottom:1px solid #eef1f5}.dashboard-activity-row:last-child{border-bottom:0}.dashboard-activity-row span{color:#667085;font-size:.86rem}.dashboard-empty{padding:22px 2px;color:#667085}.clerk-utility-actions{align-items:center}.icon-text-button{display:inline-flex;align-items:center;gap:7px}.ui-icon{font-size:1.05em;line-height:1}.history-icon{font-size:1.3em;transform:rotate(-25deg)}
.clerk-settings-dialog{border:0;padding:0;border-radius:16px;width:min(620px,calc(100vw - 30px));box-shadow:0 24px 70px rgba(16,24,40,.25)}.clerk-settings-dialog::backdrop{background:rgba(15,23,42,.48)}.clerk-settings-card{padding:24px}.clerk-settings-heading{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}.clerk-settings-heading h3,.clerk-settings-heading p{margin:0}.clerk-settings-heading p{margin-top:5px;color:#667085}.dialog-close-button{border:0;background:transparent;font-size:1.8rem;cursor:pointer;color:#667085}.clerk-settings-options{display:grid;gap:10px;margin:22px 0}.clerk-settings-options label{display:flex;gap:12px;align-items:flex-start;border:1px solid #e1e6ee;border-radius:10px;padding:14px;cursor:pointer}.clerk-settings-options label span{display:grid;gap:3px}.clerk-settings-options small{color:#667085}.clerk-settings-note{padding:12px 14px;background:#f6f8fb;border-radius:9px;color:#667085;font-size:.86rem}.dialog-actions{display:flex;justify-content:flex-end;margin-top:18px}
@media(max-width:1000px){.clerk-dashboard-summary{grid-template-columns:repeat(3,1fr)}}@media(max-width:700px){.clerk-dashboard-grid{grid-template-columns:1fr}.clerk-dashboard-summary{grid-template-columns:repeat(2,1fr)}.clerk-dashboard-actions{width:100%}}

/* =========================================================
   V9.8 HEADER UTILITIES + CLERK MORE MENU
   ========================================================= */
.header-utility-area{display:flex;align-items:center;gap:16px}.header-utility-bar{display:flex;align-items:center;gap:8px;padding-right:14px;border-right:1px solid rgba(255,255,255,.22)}.header-utility-icon-button{position:relative;width:42px;height:42px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.26);border-radius:10px;background:rgba(255,255,255,.08);color:#fff;cursor:pointer}.header-utility-icon-button:hover{background:rgba(255,255,255,.16)}.header-utility-icon{font-size:1.3rem;line-height:1}.header-utility-badge{position:absolute;top:-6px;right:-6px;min-width:20px;height:20px;padding:0 5px;display:grid;place-items:center;border-radius:999px;background:#c63030;color:#fff;font-size:.72rem;font-weight:800;border:2px solid var(--primary)}.header-utility-badge[hidden]{display:none}.session-information{display:grid;gap:3px}.clerk-utility-actions{width:auto!important;position:absolute;right:0;top:0}.section-heading{position:relative}.clerk-more-menu-wrap{position:relative}.clerk-more-menu-button{width:44px;height:40px;border:1px solid var(--border);border-radius:9px;background:#fff;color:var(--text);font-size:1.65rem;line-height:1;cursor:pointer}.clerk-more-menu-button:hover,.clerk-more-menu-button[aria-expanded="true"]{background:#eef3f7;border-color:#9db0c0}.clerk-more-menu{position:absolute;right:0;top:48px;z-index:1050;width:260px;padding:7px;background:#fff;border:1px solid var(--border);border-radius:11px;box-shadow:0 16px 34px rgba(15,23,42,.18)}.clerk-more-menu[hidden]{display:none}.clerk-more-menu button{width:100%;display:flex;align-items:center;gap:11px;padding:11px 12px;border:0;border-radius:7px;background:transparent;color:var(--text);text-align:left;font:inherit;cursor:pointer}.clerk-more-menu button:hover,.clerk-more-menu button:focus-visible{background:#eef3f7;outline:none}.clerk-more-menu button span:first-child{width:22px;text-align:center;font-size:1rem}.clerk-more-menu-separator{height:1px;background:#e5e9ef;margin:6px 4px}.clerk-more-menu .clerk-more-menu-danger{color:#a92828}.clerk-more-menu .clerk-more-menu-danger:hover{background:#fff0f0}.clerk-alert-controls-hidden{display:none!important}.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.message-typing-indicator{display:flex;align-items:center;gap:6px;margin:0 0 10px;padding:9px 12px;border-radius:10px;background:#eef3f7;color:#4f5f6d;font-size:.88rem}.message-typing-indicator[hidden]{display:none}.typing-dots{display:inline-flex;gap:3px;align-items:center}.typing-dots span{width:5px;height:5px;border-radius:50%;background:currentColor;opacity:.35;animation:courtentryTypingDot 1.05s infinite ease-in-out}.typing-dots span:nth-child(2){animation-delay:.14s}.typing-dots span:nth-child(3){animation-delay:.28s}@keyframes courtentryTypingDot{0%,60%,100%{transform:translateY(0);opacity:.3}30%{transform:translateY(-3px);opacity:1}}@media (prefers-reduced-motion:reduce){.typing-dots span{animation:none;opacity:.65}}@media(max-width:800px){.app-header{align-items:flex-start}.header-utility-area{flex-direction:column;align-items:flex-end;gap:8px}.header-utility-bar{border-right:0;padding-right:0}.clerk-utility-actions{position:static;width:100%!important}.clerk-more-menu{left:0;right:auto}}

/* v9.8: messages now live in the global header utility bar. */
.section-heading-actions .messages-launcher{display:none!important}.courtentry-account-identity{display:grid;gap:2px;text-align:right;padding-left:2px}.courtentry-account-identity strong{font-size:.84rem;color:#fff}.courtentry-account-identity span{font-size:.76rem;color:rgba(255,255,255,.78)}


/* =========================================================
   v9.9 HEADER ACCOUNT + UTILITY BAR
   ========================================================= */
.header-utility-area{display:flex;align-items:center;gap:12px}.header-utility-bar{display:flex;align-items:center;gap:6px;padding-right:12px;border-right:1px solid rgba(255,255,255,.22)}.header-utility-icon-button{width:38px;height:38px;border:0;border-radius:50%;background:transparent}.header-utility-icon-button:hover,.header-utility-icon-button:focus-visible{background:rgba(255,255,255,.14);outline:none}.header-utility-icon{font-size:1.22rem}.header-session-data{display:none!important}.account-menu-wrap{position:relative}.account-menu-button{display:flex;align-items:center;gap:8px;min-height:42px;padding:4px 8px 4px 4px;border:0;border-radius:22px;background:transparent;color:#fff;font:inherit;font-weight:700;cursor:pointer}.account-menu-button:hover,.account-menu-button:focus-visible,.account-menu-button[aria-expanded="true"]{background:rgba(255,255,255,.12);outline:none}.account-avatar{width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:rgba(255,255,255,.18);color:rgba(255,255,255,.86);font-size:.82rem;border:1px solid rgba(255,255,255,.18)}.account-menu-name{max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-menu-chevron{font-size:.9rem;opacity:.85}.account-menu{position:absolute;right:0;top:50px;z-index:2100;width:265px;padding:8px;background:#fff;color:var(--text);border:1px solid var(--border);border-radius:11px;box-shadow:0 16px 36px rgba(15,23,42,.22)}.account-menu[hidden]{display:none}.account-menu-summary{display:grid;gap:3px;padding:9px 10px}.account-menu-summary strong{font-size:.95rem;color:#173f5c}.account-menu-summary span{font-size:.8rem;color:#66758a}.account-menu-separator{height:1px;background:#e5e9ef;margin:5px 3px}.account-menu-signout{width:100%;padding:10px;border:0;border-radius:7px;background:transparent;color:#a92828;text-align:left;font:inherit;font-weight:700;cursor:pointer}.account-menu-signout:hover{background:#fff0f0}.courtentry-account-identity{display:none!important}.session-sign-out-button{display:none!important}@media(max-width:800px){.header-utility-area{flex-direction:row;align-items:center}.header-utility-bar{border-right:1px solid rgba(255,255,255,.22);padding-right:8px}.account-menu-name{display:none}.account-menu-button{padding-right:4px}.account-menu{right:0}}


/* =========================================================
   COURTENTRY MESSENGER v10.0
   ========================================================= */
.messages-panel.messenger-shell{position:fixed;top:72px;right:18px;width:min(1080px,calc(100vw - 36px));height:min(720px,calc(100vh - 96px));background:#fff;border:1px solid #ccd6df;border-radius:14px;box-shadow:0 18px 55px rgba(13,37,58,.25);z-index:1500;display:none;overflow:hidden}
.messages-panel.messenger-shell.is-open{display:flex;flex-direction:column}
.messenger-topbar{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid #dbe3ea;background:#f8fafc}.messenger-topbar h2{margin:2px 0 0}.messenger-topbar-actions{display:flex;gap:8px}.messenger-icon-button{border:1px solid #b9c8d5;background:white;border-radius:9px;width:40px;height:40px;font-size:22px;cursor:pointer}.messenger-layout{display:grid;grid-template-columns:330px 1fr;min-height:0;flex:1}.messenger-sidebar{border-right:1px solid #dbe3ea;display:flex;flex-direction:column;min-width:0}.messenger-search{padding:12px;border-bottom:1px solid #edf1f4}.messenger-search input{width:100%;padding:11px 12px;border:1px solid #c9d4de;border-radius:9px}.messenger-conversation-list{overflow:auto;min-height:0}.messenger-conversation-row{width:100%;display:grid;grid-template-columns:44px 1fr auto;gap:10px;align-items:center;text-align:left;border:0;border-bottom:1px solid #edf1f4;background:white;padding:12px;cursor:pointer}.messenger-conversation-row:hover{background:#f4f8fb}.messenger-conversation-row.active{background:#e8f1f8}.messenger-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#173f5d;color:#fff;font-weight:800}.messenger-conversation-copy{min-width:0;display:flex;flex-direction:column}.messenger-conversation-copy strong,.messenger-conversation-copy small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.messenger-conversation-copy small{color:#6c7b88;margin-top:3px}.messenger-conversation-meta{align-self:stretch;display:flex;flex-direction:column;align-items:flex-end;gap:7px;font-size:11px;color:#73818e}.messenger-conversation-meta b{background:#173f5d;color:#fff;border-radius:999px;min-width:20px;height:20px;display:grid;place-items:center}.messenger-chat{min-width:0;min-height:0;position:relative}.messenger-empty-state{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:#71808d}.messenger-conversation-view{height:100%;display:grid;grid-template-rows:auto 1fr auto auto;min-height:0}.messenger-chat-header{padding:14px 18px;border-bottom:1px solid #e3e9ee}.messenger-chat-header>div{display:flex;flex-direction:column;gap:3px}.messenger-chat-header span{font-size:12px;color:#71808d}.messenger-message-stream{padding:18px;overflow:auto;display:flex;flex-direction:column;gap:11px;background:#fbfcfd}.messenger-message{display:flex;flex-direction:column;max-width:72%}.messenger-message.mine{align-self:flex-end;align-items:flex-end}.messenger-message.theirs{align-self:flex-start;align-items:flex-start}.messenger-message-sender{font-size:11px;color:#60707d;margin:0 6px 3px}.messenger-bubble{padding:10px 13px;border-radius:16px;white-space:pre-wrap;word-break:break-word}.messenger-message.mine .messenger-bubble{background:#173f5d;color:#fff;border-bottom-right-radius:5px}.messenger-message.theirs .messenger-bubble{background:#edf2f6;color:#17212b;border-bottom-left-radius:5px}.messenger-message time{font-size:10px;color:#89949d;margin:3px 5px}.message-typing-indicator{padding:6px 18px;color:#64727e;font-size:12px}.messenger-composer{border-top:1px solid #e0e7ec;padding:12px;display:grid;grid-template-columns:1fr auto;gap:9px;background:#fff}.messenger-composer textarea{resize:none;border:1px solid #c8d4de;border-radius:12px;padding:11px 12px;font:inherit}.messenger-send-button{align-self:end}.messenger-new-dialog{width:min(560px,calc(100vw - 32px));border:0;border-radius:14px;padding:0;box-shadow:0 22px 60px rgba(0,0,0,.3)}.messenger-new-dialog form{padding:20px}.messenger-user-picker{max-height:330px;overflow:auto;border:1px solid #d9e1e7;border-radius:10px;margin:12px 0}.messenger-user-choice{display:grid;grid-template-columns:auto 12px 1fr;gap:10px;align-items:center;padding:11px 12px;border-bottom:1px solid #edf1f4;cursor:pointer}.messenger-user-choice:last-child{border-bottom:0}.messenger-user-choice span:last-child{display:flex;flex-direction:column}.messenger-user-choice small{color:#73818e;margin-top:2px}.messenger-presence-dot{width:10px;height:10px;border-radius:50%;background:#adb7bf}.messenger-presence-dot.online{background:#31a354}.typing-dots{display:inline-flex;gap:2px;margin-left:3px}.typing-dots span{width:4px;height:4px;border-radius:50%;background:currentColor;animation:messengerDot 1s infinite ease-in-out}.typing-dots span:nth-child(2){animation-delay:.15s}.typing-dots span:nth-child(3){animation-delay:.3s}@keyframes messengerDot{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-3px);opacity:1}}
@media(max-width:760px){.messages-panel.messenger-shell{top:10px;right:10px;width:calc(100vw - 20px);height:calc(100vh - 20px)}.messenger-layout{grid-template-columns:145px 1fr}.messenger-conversation-row{grid-template-columns:32px 1fr}.messenger-avatar{width:31px;height:31px}.messenger-conversation-meta{display:none}.messenger-message{max-width:88%}}

/* v10.1 Messenger polish: social-style compose flow */
.messenger-topbar{padding:13px 16px}.messenger-topbar .messages-close-button{margin-left:auto}
.messenger-sidebar-heading{height:56px;display:flex;align-items:center;justify-content:space-between;padding:0 12px 0 15px;border-bottom:1px solid #edf1f4;background:#fff}.messenger-sidebar-heading strong{font-size:1.05rem}.messenger-compose-button{width:36px;height:36px;display:grid;place-items:center;border:0;border-radius:9px;background:transparent;color:#173f5d;cursor:pointer}.messenger-compose-button:hover{background:#eef4f8}.messenger-compose-button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.messenger-new-dialog{width:min(520px,calc(100vw - 28px));max-height:min(720px,calc(100vh - 28px));border:0;border-radius:18px;padding:0;overflow:hidden;box-shadow:0 24px 70px rgba(0,0,0,.28)}.messenger-new-dialog::backdrop{background:rgba(13,37,58,.35);backdrop-filter:blur(2px)}.messenger-new-conversation-form{display:flex;flex-direction:column;max-height:min(720px,calc(100vh - 28px));padding:0!important;background:#fff}.messenger-new-header{display:grid;grid-template-columns:38px 1fr 38px;align-items:start;padding:16px 18px 13px;border-bottom:1px solid #e7edf2;text-align:center}.messenger-new-header>div{grid-column:2}.messenger-new-header h2{font-size:1.15rem;margin:1px 0 2px}.messenger-new-header p{font-size:.8rem;color:#71808d;margin:0;line-height:1.35}.messenger-back-button{grid-column:1;grid-row:1;background:transparent;border:0;width:34px;height:34px;border-radius:50%;font-size:1.55rem;line-height:1;cursor:pointer;color:#33414c}.messenger-back-button:hover{background:#eef3f7}
.messenger-recipient-search{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px;padding:11px 16px;border-bottom:1px solid #edf1f4}.messenger-recipient-search>span{font-weight:700;color:#3f4d58}.messenger-recipient-search input{width:100%;border:0!important;outline:0;padding:8px 4px!important;font:inherit;background:transparent}.messenger-recipient-search input:focus{box-shadow:none!important}
.messenger-selected-people{display:flex;gap:8px;overflow-x:auto;padding:10px 16px 4px}.messenger-selected-people[hidden]{display:none}.messenger-selected-chip{display:flex;align-items:center;gap:6px;border:0;border-radius:999px;padding:5px 8px 5px 5px;background:#e8f1f8;color:#173f5d;white-space:nowrap;cursor:pointer;font:inherit;font-size:.83rem}.messenger-selected-chip>span{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:#173f5d;color:#fff;font-size:.72rem;font-weight:800}.messenger-selected-chip b{font-size:1rem;font-weight:500;color:#61717f}.messenger-selected-chip:hover{background:#dcebf5}
.messenger-group-name-field{display:grid;gap:5px;padding:10px 16px 5px}.messenger-group-name-field[hidden]{display:none}.messenger-group-name-field span,.messenger-people-label{font-size:.78rem;font-weight:800;color:#6c7b88;text-transform:uppercase;letter-spacing:.04em}.messenger-group-name-field input{border:1px solid #ccd7e0;border-radius:10px;padding:10px 11px;font:inherit}.messenger-people-label{padding:12px 16px 5px}
.messenger-user-picker{max-height:none;overflow:auto;border:0;border-radius:0;margin:0;min-height:120px}.messenger-user-choice{grid-template-columns:46px 1fr 28px;gap:10px;padding:10px 16px;border-bottom:0;background:#fff}.messenger-user-choice:hover{background:#f5f8fa}.messenger-user-choice.selected{background:#edf5fa}.messenger-user-choice>input{position:absolute;opacity:0;pointer-events:none}.messenger-picker-avatar{position:relative;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#173f5d;color:#fff;font-weight:800}.messenger-picker-avatar .messenger-presence-dot{position:absolute;width:11px;height:11px;right:0;bottom:1px;border:2px solid #fff}.messenger-picker-copy{display:flex!important;flex-direction:column;min-width:0}.messenger-picker-copy strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.messenger-choice-check{width:24px;height:24px;border:1.5px solid #b8c6d1;border-radius:50%;display:grid;place-items:center;color:#fff;font-size:.78rem;font-weight:900}.messenger-user-choice.selected .messenger-choice-check{background:#173f5d;border-color:#173f5d}.messenger-new-footer{margin-top:auto;display:flex;justify-content:flex-end;gap:9px;padding:12px 16px 16px;border-top:1px solid #edf1f4;background:#fff}.messenger-new-footer button{min-width:92px}
@media(max-width:560px){.messenger-new-dialog{width:calc(100vw - 16px);max-height:calc(100vh - 16px)}.messenger-new-conversation-form{max-height:calc(100vh - 16px)}}


/* =========================================================
   CourtEntry v10.2 — consistent local stroke icon system
   ========================================================= */
.ce-icon{display:inline-grid;place-items:center;flex:0 0 auto;line-height:1}
.ce-icon>svg{width:1.15em;height:1.15em;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;display:block}
.header-utility-icon.ce-icon>svg{width:22px;height:22px}
.account-avatar.ce-icon{background:rgba(255,255,255,.18)}
.account-avatar.ce-icon>svg{width:19px;height:19px}
.account-menu-chevron.ce-icon>svg{width:16px;height:16px}
.clerk-more-menu-button .ce-icon>svg{width:22px;height:22px}
.clerk-more-menu button .ce-icon{width:22px}
.clerk-more-menu button .ce-icon>svg{width:18px;height:18px}
.messenger-compose-button .ce-icon>svg{width:22px;height:22px}
.icon-only-button{display:grid;place-items:center}
.icon-only-button .ce-icon>svg{width:21px;height:21px}
.messenger-send-button{display:inline-flex;align-items:center;justify-content:center;gap:7px}
.messenger-send-button .ce-icon>svg{width:17px;height:17px}

/* Messenger v10.3: honor HTML hidden state even when component display rules are defined. */
.messenger-shell [hidden],
.messenger-new-dialog [hidden] {
  display: none !important;
}
.messenger-chat {
  overflow: hidden;
}

/* Messenger v10.4 conversation options */
.messenger-chat-header{display:flex;align-items:center;justify-content:space-between;gap:12px;position:relative}
.messenger-chat-header>div:first-child{min-width:0}
.messenger-chat-actions{position:relative;display:block!important;flex:0 0 auto}
.messenger-chat-menu-button{width:36px;height:36px;border:0;border-radius:9px;background:transparent;color:#40515f;cursor:pointer}
.messenger-chat-menu-button:hover{background:#eef3f7}
.messenger-chat-menu{position:absolute;right:0;top:40px;z-index:8;min-width:170px;padding:6px;background:#fff;border:1px solid #d7e0e7;border-radius:10px;box-shadow:0 10px 28px rgba(13,37,58,.18)}
.messenger-chat-menu button{width:100%;display:flex;align-items:center;gap:9px;border:0;border-radius:7px;background:transparent;padding:9px 10px;text-align:left;font:inherit;cursor:pointer}
.messenger-chat-menu button:hover{background:#f6f8fa}
.messenger-chat-menu .messenger-delete-chat{color:#a62b2b}
.messenger-chat-menu .ce-icon>svg{width:18px;height:18px}

/* Messenger v10.5 conversation action model: click, right-click, long-press ready */
.messenger-conversation-row{grid-template-columns:44px minmax(0,1fr) auto 34px;position:relative;user-select:none;-webkit-user-select:none;touch-action:pan-y}
.messenger-row-menu-button{width:30px;height:30px;display:grid;place-items:center;align-self:center;border:0;border-radius:8px;background:transparent;color:#536574;cursor:pointer;padding:0}
.messenger-row-menu-button:hover,.messenger-row-menu-button:focus-visible{background:#dfeaf2;outline:none}
.messenger-row-menu-button .ce-icon>svg{width:18px;height:18px}
.messenger-row-context-menu{position:fixed;z-index:12000;min-width:170px;top:auto;right:auto;left:8px}
.messenger-row-context-menu[hidden]{display:none!important}
@media(max-width:760px){.messenger-conversation-row{grid-template-columns:32px minmax(0,1fr) 30px}.messenger-conversation-meta{display:none}.messenger-row-menu-button{grid-column:3}}


/* Messenger v10.6: anchored actions, mute state, movable/resizable desktop window */
.messages-panel.messenger-shell{resize:both;min-width:620px;min-height:420px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px)}
.messenger-topbar{cursor:move;touch-action:none}
.messenger-topbar button{cursor:pointer}
.messenger-row-context-menu{position:fixed!important;right:auto!important;top:auto;z-index:12000}
.messenger-muted-indicator{display:inline-grid;place-items:center;color:#71808d}
.messenger-muted-indicator .ce-icon>svg{width:14px;height:14px}
.messenger-chat-menu .messenger-mute-chat{color:#273b4b}
@media(max-width:760px){.messages-panel.messenger-shell{resize:none!important;min-width:0;min-height:0;max-width:none;max-height:none;left:10px!important;top:10px!important;right:10px!important;width:calc(100vw - 20px)!important;height:calc(100vh - 20px)!important}.messenger-topbar{cursor:default;touch-action:auto}}


/* Messenger v10.7: reliable resize handles + viewport-level action menu + movable/resizable recipient picker */
.messenger-row-context-menu{position:fixed!important;z-index:30000!important}
.ce-floating-window{box-sizing:border-box}
.ce-window-resize-handle{position:absolute;z-index:25000;display:block!important;touch-action:none;background:transparent}
.ce-resize-n{left:10px;right:10px;top:-5px;height:10px;cursor:ns-resize}
.ce-resize-s{left:10px;right:10px;bottom:-5px;height:10px;cursor:ns-resize}
.ce-resize-e{top:10px;bottom:10px;right:-5px;width:10px;cursor:ew-resize}
.ce-resize-w{top:10px;bottom:10px;left:-5px;width:10px;cursor:ew-resize}
.ce-resize-ne,.ce-resize-nw,.ce-resize-se,.ce-resize-sw{width:18px;height:18px;z-index:25001}
.ce-resize-ne{right:-5px;top:-5px;cursor:nesw-resize}.ce-resize-nw{left:-5px;top:-5px;cursor:nwse-resize}
.ce-resize-se{right:-5px;bottom:-5px;cursor:nwse-resize}.ce-resize-sw{left:-5px;bottom:-5px;cursor:nesw-resize}
.messenger-new-dialog.ce-floating-window{position:fixed;margin:0;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);overflow:hidden;min-width:440px;min-height:420px}
.messenger-new-dialog.ce-floating-window form{height:100%;box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden}
.messenger-new-dialog.ce-floating-window .messenger-new-header{cursor:move;touch-action:none;flex:0 0 auto}
.messenger-new-dialog.ce-floating-window .messenger-user-picker{flex:1 1 auto;min-height:100px;max-height:none}
@media(max-width:760px){.ce-window-resize-handle{display:none!important}.messenger-new-dialog.ce-floating-window{position:fixed!important;left:10px!important;top:10px!important;width:calc(100vw - 20px)!important;height:calc(100vh - 20px)!important;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;margin:0!important}.messenger-new-dialog.ce-floating-window .messenger-new-header{cursor:default;touch-action:auto}}


/* Messenger v10.8: fresh-history delete semantics + secure file attachments */
.messenger-composer{grid-template-columns:auto minmax(0,1fr) auto;align-items:end}
.messenger-attach-button{width:42px;height:42px;border:1px solid #c8d4de;border-radius:11px;background:#fff;color:#425666;cursor:pointer}
.messenger-attach-button:hover{background:#f1f5f8}
.messenger-attach-button .ce-icon>svg{width:19px;height:19px}
.messenger-attachment-selection{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px}
.messenger-pending-attachment{max-width:100%;display:inline-flex;align-items:center;gap:6px;border:1px solid #d5dfe7;background:#f7f9fb;border-radius:999px;padding:5px 7px 5px 9px;font-size:12px}
.messenger-pending-attachment>span:nth-child(2){max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.messenger-pending-attachment button{border:0;background:transparent;font-size:17px;line-height:1;cursor:pointer;color:#657786}
.messenger-attachment-list{display:flex;flex-direction:column;gap:6px;max-width:100%}
.messenger-attachment-card{display:flex;align-items:center;gap:10px;min-width:220px;max-width:360px;padding:10px 12px;border:1px solid #d6e0e8;border-radius:12px;background:#fff;color:#173f5d;text-decoration:none;box-shadow:0 1px 2px rgba(13,37,58,.04)}
.messenger-message.mine .messenger-attachment-card{background:#f5f9fc}
.messenger-attachment-card:hover{background:#eef5f9}
.messenger-attachment-card>span:last-child{display:flex;flex-direction:column;min-width:0}
.messenger-attachment-card strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.messenger-attachment-card small{color:#71808d;margin-top:2px;font-size:10px}
.messenger-attachment-card .ce-icon{flex:0 0 auto}
.messenger-attachment-card .ce-icon>svg{width:20px;height:20px}
@media(max-width:760px){.messenger-attachment-card{min-width:0;max-width:100%}.messenger-pending-attachment>span:nth-child(2){max-width:140px}}

/* v10.9 clerk dialogs + anchored compose */
.clerk-menu-state{margin-left:auto;font-size:.78rem;font-weight:800;color:#667786}.clerk-more-menu button{display:flex;align-items:center;gap:12px}.clerk-sub-navigation-retired{display:none!important}.ce-clerk-floating-dialog,.clerk-workspace-dialog{position:fixed;width:min(820px,calc(100vw - 32px));height:min(650px,calc(100vh - 32px));max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);min-width:480px;min-height:300px;padding:0;border:0;border-radius:16px;overflow:hidden;box-shadow:0 24px 70px rgba(0,0,0,.28)}.ce-clerk-floating-dialog::backdrop,.clerk-workspace-dialog::backdrop{background:rgba(13,37,58,.25)}.clerk-settings-dialog.ce-clerk-floating-dialog .clerk-settings-card{height:100%;overflow:auto;box-sizing:border-box}.clerk-settings-heading,.ce-dialog-titlebar,.clerk-workspace-dialog>.court-history-view>.section-heading{cursor:move;touch-action:none}.ce-dialog-titlebar{display:flex;justify-content:space-between;align-items:flex-start;padding:18px 20px;border-bottom:1px solid #dde5eb;background:#fff}.ce-dialog-titlebar h2,.ce-dialog-titlebar p{margin:0}.ce-dialog-titlebar p{margin-top:3px;color:#697987}.clerk-workspace-dialog>#clerkDocketPanel{display:flex!important;flex-direction:column;height:calc(100% - 82px);overflow:auto;padding:18px;box-sizing:border-box}.clerk-workspace-dialog>.court-history-view{display:flex!important;flex-direction:column;height:100%;padding:0!important}.clerk-workspace-dialog>.court-history-view>.section-heading{padding:18px 20px;margin:0;border-bottom:1px solid #dde5eb}.clerk-workspace-dialog .court-history-browser{flex:1;min-height:0;padding:16px;overflow:hidden}.arrival-alert-dialog-body{padding:22px}.arrival-alert-setting-row{display:flex;align-items:center;justify-content:space-between;gap:20px}.arrival-alert-setting-row>div{display:flex;flex-direction:column;gap:5px}.arrival-alert-setting-row span{color:#697987}.messenger-compose-popover{position:fixed;z-index:30000;margin:0;border:1px solid #d5dee6;border-radius:14px;padding:0;overflow:hidden;background:#fff;box-shadow:0 18px 45px rgba(0,0,0,.22);min-width:300px}.messenger-compose-popover .messenger-new-conversation-form{max-height:inherit}.messenger-compose-popover .messenger-new-header{cursor:default}.messenger-compose-popover::backdrop{display:none}.messenger-compose-popover[hidden]{display:none!important}@media(max-width:760px){.ce-clerk-floating-dialog,.clerk-workspace-dialog{left:8px!important;top:8px!important;width:calc(100vw - 16px)!important;height:calc(100vh - 16px)!important;min-width:0!important;min-height:0!important;margin:0!important}.ce-window-resize-handle{display:none!important}.messenger-compose-popover{left:12px!important;right:12px!important;width:auto!important;max-height:70vh!important}}


/* v11.0 compact Messenger compose + Clerk History header + inline Arrival Alerts switch */
.clerk-inline-switch{margin-left:auto;width:42px;height:24px;border-radius:999px;background:#c6d0d8;display:inline-flex;align-items:center;padding:2px;box-sizing:border-box;transition:background .16s ease;flex:0 0 auto}
.clerk-inline-switch>span{width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.22);transform:translateX(0);transition:transform .16s ease}
.clerk-inline-switch.is-on{background:#173f5d}.clerk-inline-switch.is-on>span{transform:translateX(18px)}
#clerkArrivalAlertsMenuButton[aria-checked="true"]{background:#f3f8fb}
.clerk-workspace-dialog>.court-history-view>.court-history-window-header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;flex:0 0 auto}
.court-history-window-header .dialog-close-button{margin-left:auto;flex:0 0 auto;width:38px;height:38px;border-radius:9px;display:grid;place-items:center;line-height:1}
.court-history-window-header .dialog-close-button:hover{background:#eef3f7}
.court-history-toolbar{flex:0 0 auto;padding:12px 20px;border-bottom:1px solid #e5ebf0;background:#fff}
.clerk-workspace-dialog .court-history-browser{padding-top:14px}
.messenger-compose-popover .messenger-new-header{grid-template-columns:32px 1fr 32px;padding:10px 12px 9px;align-items:center}
.messenger-compose-popover .messenger-new-header h2{margin:0;font-size:1.05rem}
.messenger-compose-popover .messenger-back-button{width:30px;height:30px;font-size:1.25rem}
.messenger-compose-popover .messenger-recipient-search{grid-template-columns:22px minmax(0,1fr);gap:6px;padding:6px 12px;border-bottom:1px solid #edf1f4}
.messenger-compose-popover .messenger-search-icon{color:#6d7c88;display:grid;place-items:center}
.messenger-compose-popover .messenger-search-icon>svg{width:18px;height:18px}
.messenger-compose-popover .messenger-recipient-search input{padding:6px 2px!important;min-width:0}
.messenger-compose-popover .messenger-selected-people{gap:5px;padding:6px 10px 3px;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap;scrollbar-width:thin}
.messenger-compose-popover .messenger-selected-chip{font-size:.76rem;padding:3px 6px 3px 3px;gap:4px}
.messenger-compose-popover .messenger-selected-chip>span{width:20px;height:20px;font-size:.64rem}
.messenger-compose-popover .messenger-group-name-field{gap:3px;padding:6px 12px 3px}
.messenger-compose-popover .messenger-group-name-field span,.messenger-compose-popover .messenger-people-label{font-size:.69rem}
.messenger-compose-popover .messenger-group-name-field input{padding:8px 9px;border-radius:9px}
.messenger-compose-popover .messenger-people-label{padding:8px 12px 3px}
.messenger-compose-popover .messenger-user-choice{grid-template-columns:40px 1fr 26px;gap:8px;padding:7px 12px}
.messenger-compose-popover .messenger-picker-avatar{width:36px;height:36px}
.messenger-compose-popover .messenger-picker-copy strong{font-size:.9rem}
.messenger-compose-popover .messenger-picker-copy small{font-size:.76rem}
.messenger-compose-popover .messenger-choice-check{width:22px;height:22px}
.messenger-compose-popover .messenger-new-footer{padding:8px 12px 10px;gap:8px}
.messenger-compose-popover .messenger-new-footer button{min-width:78px;padding-top:8px;padding-bottom:8px}

/* =========================================================
   v11.1 CLERK VIEW — CRISP OPERATIONS FACELIFT
   Moderate visual refresh only; preserves existing workflow.
   ========================================================= */
#clerkView{
    --clerk-ink:#152b3b;
    --clerk-muted:#647786;
    --clerk-line:#d7e1e8;
    --clerk-soft:#f4f8fb;
    --clerk-panel:#ffffff;
}

#clerkView>.section-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:24px;
    margin:0 0 18px;
    padding:2px 0 18px;
    border-bottom:1px solid var(--clerk-line);
}
#clerkView>.section-heading>div:first-child{
    position:relative;
    padding-left:16px;
}
#clerkView>.section-heading>div:first-child::before{
    content:"";
    position:absolute;
    left:0;
    top:3px;
    bottom:3px;
    width:4px;
    border-radius:999px;
    background:var(--primary);
}
#clerkView>.section-heading h2{
    margin:0;
    color:var(--clerk-ink);
    font-size:1.7rem;
    line-height:1.05;
    letter-spacing:-.025em;
}
#clerkView>.section-heading p{
    margin:6px 0 0;
    color:var(--clerk-muted);
    font-size:.92rem;
}
#clerkView .clerk-utility-actions{
    top:0;
}
#clerkView .clerk-more-menu-button{
    width:42px;
    height:42px;
    border-color:#c8d5de;
    border-radius:11px;
    box-shadow:0 1px 2px rgba(21,43,59,.05);
}
#clerkView .clerk-more-menu-button:hover,
#clerkView .clerk-more-menu-button[aria-expanded="true"]{
    background:#f0f6fa;
    border-color:#9eb4c4;
}

#clerkView .clerk-search-toolbar{
    display:flex;
    align-items:center;
    margin:0 0 22px;
    padding:0;
    border:0;
    background:transparent;
}
#clerkView .clerk-shared-search-field{
    position:relative;
    display:block;
    width:min(430px,100%);
    margin:0;
}
#clerkView .clerk-shared-search-field .clerk-search-icon{
    position:absolute;
    z-index:1;
    left:14px;
    top:50%;
    width:19px;
    height:19px;
    transform:translateY(-50%);
    color:#6d8190;
    pointer-events:none;
}
#clerkView .clerk-shared-search-field .clerk-search-icon>svg{
    width:19px;
    height:19px;
}
#clerkView .clerk-shared-search-field input{
    width:100%;
    min-height:44px;
    padding:10px 14px 10px 43px;
    border:1px solid #cbd8e1;
    border-radius:11px;
    background:#fff;
    color:var(--clerk-ink);
    box-shadow:0 1px 2px rgba(21,43,59,.04);
    font-size:.95rem;
    transition:border-color .15s ease,box-shadow .15s ease,background .15s ease;
}
#clerkView .clerk-shared-search-field input::placeholder{
    color:#81919d;
}
#clerkView .clerk-shared-search-field input:focus{
    outline:none;
    border-color:#809caf;
    box-shadow:0 0 0 3px rgba(23,59,87,.10);
    background:#fff;
}

#clerkView #clerkArrivalsPanel{
    position:relative;
    min-height:390px;
    padding:14px;
    border:1px solid #dbe5ec;
    border-radius:16px;
    background:linear-gradient(180deg,#f9fbfd 0%,#f4f8fb 100%);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.85);
}
#clerkView .arrival-section{
    margin-bottom:16px;
}
#clerkView .acknowledged-arrivals-section{
    margin:0;
    padding:0;
    border-top:0;
}
#clerkView .arrival-section-toggle,
#clerkView .acknowledged-arrivals-heading{
    min-height:74px;
    padding:14px 16px;
    border:1px solid #cfdce5;
    border-radius:12px;
    background:rgba(255,255,255,.96);
    box-shadow:0 1px 2px rgba(21,43,59,.04);
}
#clerkView .arrival-section-toggle strong{
    color:var(--clerk-ink);
    font-size:1rem;
    letter-spacing:-.01em;
}
#clerkView .arrival-section-toggle small{
    margin-top:3px;
    color:var(--clerk-muted);
    font-size:.81rem;
}
#clerkView .acknowledged-count-badge{
    min-width:32px;
    height:32px;
    padding:0 9px;
    border:1px solid #d8e2e9;
    background:#edf3f7;
    color:#173b57;
    font-size:.84rem;
    font-weight:800;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
}
#clerkView #acknowledgedArrivalContent{
    margin-top:10px;
}
#clerkView #clerkAcknowledgedList,
#clerkView #clerkArrivalList{
    display:grid;
    gap:10px;
}
#clerkView #clerkAcknowledgedList>.empty-message,
#clerkView #clerkArrivalList>.empty-message{
    display:grid;
    place-items:center;
    min-height:235px;
    margin:0;
    padding:32px 20px;
    border:1px dashed #cad7e0;
    border-radius:12px;
    background:rgba(255,255,255,.56);
    color:#6c7e8c;
    text-align:center;
    font-size:.9rem;
}
#clerkView #clerkAcknowledgedList>.empty-message::before,
#clerkView #clerkArrivalList>.empty-message::before{
    content:"";
    width:42px;
    height:42px;
    margin-bottom:10px;
    border:1px solid #c9d6df;
    border-radius:12px;
    background:
        linear-gradient(#8aa0af,#8aa0af) 12px 13px/18px 2px no-repeat,
        linear-gradient(#8aa0af,#8aa0af) 12px 20px/13px 2px no-repeat,
        linear-gradient(#8aa0af,#8aa0af) 12px 27px/16px 2px no-repeat,
        #f7fafc;
}
#clerkView .person-card,
#clerkView .clerk-arrival-card,
#clerkView .acknowledged-arrival-card{
    border-color:#d2dee6;
    border-radius:12px;
    box-shadow:0 2px 7px rgba(21,43,59,.05);
}

#clerkView .arrival-alert-banner{
    margin:0 0 14px;
    border-radius:12px;
    box-shadow:0 2px 8px rgba(21,43,59,.08);
}

#clerkView .clerk-more-menu{
    border-color:#ccd8e0;
    border-radius:12px;
    box-shadow:0 18px 38px rgba(21,43,59,.17);
}
#clerkView .clerk-inline-switch{
    margin-left:auto;
}

@media(max-width:700px){
    #clerkView>.section-heading{
        padding-right:0;
    }
    #clerkView>.section-heading>div:first-child{
        padding-left:12px;
    }
    #clerkView #clerkArrivalsPanel{
        min-height:300px;
        padding:10px;
        border-radius:12px;
    }
    #clerkView #clerkAcknowledgedList>.empty-message,
    #clerkView #clerkArrivalList>.empty-message{
        min-height:170px;
    }
}


/* v11.2 streamlined clerk arrivals, upload dialog, and notification center */
#clerkView .current-arrivals-section{border:1px solid #d7e1e8;border-radius:14px;background:#fff;box-shadow:0 8px 24px rgba(25,49,66,.06);overflow:hidden}
#clerkView .current-arrivals-heading{display:flex;align-items:center;justify-content:space-between;padding:15px 18px;border-bottom:1px solid #e5edf2;background:linear-gradient(180deg,#fbfdfe,#f5f9fb)}
#clerkView .current-arrivals-heading strong{font-size:1rem;letter-spacing:.01em}
#clerkView .current-arrivals-heading small{display:block;color:#6d7c86;margin-top:3px}
#clerkView #currentArrivalContent{padding:14px}
#clerkView .current-arrival-card.new-arrival-card{background:#eef7ff;border-color:#99c7e9;box-shadow:inset 4px 0 0 #2f84bd,0 5px 18px rgba(39,103,145,.08)}
#clerkView .new-arrival-label{display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;background:#d7edfc;color:#155f8d;font-size:.7rem;font-weight:850;letter-spacing:.08em;margin-bottom:8px}
#clerkView .acknowledgment-status,.acknowledge-arrival-button,.undo-acknowledgment-button{display:none!important}
.upload-docket-floating-dialog{resize:both;overflow:auto;min-width:560px;min-height:420px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px)}
.global-notifications-menu{position:absolute;right:68px;top:52px;width:min(380px,calc(100vw - 24px));max-height:460px;overflow:auto;background:#fff;border:1px solid #d9e2e8;border-radius:12px;box-shadow:0 18px 48px rgba(17,39,54,.18);z-index:13000;padding:8px}
.global-notifications-header{display:flex;align-items:center;justify-content:space-between;padding:8px 9px 10px;border-bottom:1px solid #e7edf1}.global-notifications-header button{border:0;background:transparent;color:#317aa6;font-weight:700;cursor:pointer}
.global-notifications-list{display:grid;gap:4px;padding-top:5px}.global-notification-item{display:grid;text-align:left;border:0;background:#fff;padding:10px 11px;border-radius:9px;cursor:pointer}.global-notification-item:hover{background:#f2f7fa}.global-notification-item.is-unread{background:#eef7fd}.global-notification-item strong{font-size:.9rem}.global-notification-item span{font-size:.82rem;color:#50616c;margin-top:2px}.global-notification-item small{font-size:.72rem;color:#82909a;margin-top:5px}.global-notifications-empty{padding:24px 12px;text-align:center;color:#75858f}
@media(max-width:760px){.global-notifications-menu{position:fixed;right:8px;left:8px;top:64px;width:auto}.upload-docket-floating-dialog{min-width:0;min-height:0;resize:none}}


/* =========================================================
   v11.3 COURTENTRY BRAND + OFFICER VIEW DECLUTTER
   ========================================================= */
.courtentry-brand-link{display:flex;align-items:center;gap:12px;text-decoration:none;color:#fff}.courtentry-header-logo{width:58px;height:58px;object-fit:contain;border-radius:10px}.courtentry-header-wordmark{display:flex;flex-direction:column;gap:2px}.courtentry-header-wordmark strong{font-size:1.8rem;letter-spacing:-.02em}.courtentry-header-wordmark small{font-size:.92rem;font-weight:500;opacity:.82}.officer-more-menu-wrap{position:relative}.officer-more-menu{right:0;top:48px}.officer-global-search-toolbar{position:relative;margin:16px 0 10px}.officer-global-search-toolbar .officer-search-field{position:relative;display:block;width:100%}.officer-global-search-toolbar .officer-search-field input{width:100%;height:46px;padding-left:42px;border-radius:10px;background:#fff}.officer-search-icon{position:absolute;left:14px;top:50%;transform:translateY(-50%);z-index:1;color:#667786;pointer-events:none}.driver-license-scanner-panel{display:inline-flex!important;width:auto!important;max-width:100%;min-height:36px!important;margin:0 0 16px!important;padding:7px 11px!important;border-radius:999px!important;gap:8px!important;box-shadow:none!important}.driver-license-scanner-copy{display:flex!important;align-items:center!important;gap:8px!important}.driver-license-scanner-copy strong{font-size:.86rem!important}.driver-license-scanner-copy span{display:none!important}.driver-license-scanner-indicator{width:9px!important;height:9px!important;flex:0 0 9px!important}.sub-navigation{margin-top:2px!important;margin-bottom:14px!important;gap:6px!important;border-bottom:1px solid #d8e2e9}.sub-navigation .sub-nav-button{min-height:38px;padding:8px 14px;border-radius:8px 8px 0 0}.officer-status-section{margin:10px 0 14px!important}.officer-status-heading{padding:10px 12px!important;background:#fff!important;border:1px solid #d8e2e9!important;border-radius:10px!important;box-shadow:none!important}.officer-status-heading:hover{background:#f7fafc!important}.officer-warrant-filter-bar{padding:0!important;margin:8px 0 14px!important;border:0!important;background:transparent!important;gap:7px!important}.officer-warrant-filter-label{display:none!important}.officer-warrant-filter-button{min-height:36px!important;padding:6px 11px!important}.officer-warrant-filter-button strong{min-width:22px!important;min-height:22px!important}.officer-status-list .empty-message,.officer-tab-panel>.empty-message{padding:16px 4px!important;color:#71808d!important}.section-heading-actions #officerMessagesButton{display:none!important}
@media(max-width:700px){.courtentry-header-logo{width:48px;height:48px}.courtentry-header-wordmark strong{font-size:1.4rem}.courtentry-header-wordmark small{display:none}.driver-license-scanner-copy span{display:none!important}}

/* =========================================================
   COURTENTRY v11.4 — HEADER BRAND + OFFICER HEADING POLISH
   ========================================================= */
.courtentry-header-logo{
    width:78px;
    height:78px;
    border-radius:12px;
}
.courtentry-header-wordmark strong{
    font-size:1.95rem;
}

#courtCheckInView>.section-heading{
    display:flex;
    flex-direction:row;
    align-items:flex-start;
    justify-content:space-between;
    gap:24px;
    width:100%;
    margin:0 0 16px;
}
#courtCheckInView>.section-heading>div:first-child{
    min-width:0;
}
#courtCheckInView>.section-heading h2{
    margin:0;
}
#courtCheckInView>.section-heading p{
    margin:4px 0 0;
}
#courtCheckInView>.section-heading .section-heading-actions{
    width:auto;
    flex:0 0 auto;
    margin-left:auto;
    justify-content:flex-end;
}
#courtCheckInView .officer-more-menu-wrap{
    margin:0;
}
#courtCheckInView .clerk-more-menu-button{
    width:40px;
    height:38px;
    padding:0;
    display:grid;
    place-items:center;
    border-color:#c8d5de;
    border-radius:10px;
    background:#fff;
    box-shadow:0 1px 2px rgba(21,43,59,.05);
    font-size:1.45rem;
}
#courtCheckInView .clerk-more-menu-button:hover,
#courtCheckInView .clerk-more-menu-button[aria-expanded="true"]{
    background:#f0f6fa;
    border-color:#9eb4c4;
}
#courtCheckInView .officer-more-menu{
    left:auto;
    right:0;
    top:46px;
}

@media(max-width:700px){
    .courtentry-header-logo{
        width:60px;
        height:60px;
    }
    .courtentry-header-wordmark strong{
        font-size:1.5rem;
    }
    #courtCheckInView>.section-heading{
        flex-direction:row;
        align-items:flex-start;
        gap:12px;
    }
    #courtCheckInView>.section-heading .section-heading-actions{
        width:auto;
        justify-content:flex-end;
    }
    #courtCheckInView .officer-more-menu{
        left:auto;
        right:0;
    }
}


/* =========================================================
   COURTENTRY v11.5 — CONSISTENT WORKSPACE DECLUTTERING
   Dashboard, Person Search, DA, PD, Active Alerts/NCIC, Admin
   ========================================================= */
.ce-modern-workspace{
    --ce-work-border:#d7e1e8;
    --ce-work-soft:#f6f9fb;
    --ce-work-muted:#667786;
}
.ce-modern-workspace>.section-heading{
    display:flex;
    flex-direction:row;
    align-items:flex-start;
    justify-content:space-between;
    gap:22px;
    width:100%;
    margin:0 0 18px;
    padding:0 0 14px;
    border-bottom:1px solid var(--ce-work-border);
}
.ce-modern-workspace>.section-heading>div:first-child{min-width:0}
.ce-modern-workspace>.section-heading h2{margin:0;letter-spacing:-.018em}
.ce-modern-workspace>.section-heading p{margin:4px 0 0;color:var(--ce-work-muted);max-width:760px}
.ce-modern-workspace>.section-heading .section-heading-actions{
    width:auto;
    flex:0 0 auto;
    margin-left:auto;
    justify-content:flex-end;
    align-items:center;
}

/* Dashboard: keep the glanceable information, lose the oversized feel. */
#dashboardView .dashboard-eyebrow{font-size:.72rem;letter-spacing:.14em;color:#6d7f8e}
#dashboardView .clerk-dashboard-actions{gap:8px}
#dashboardView .clerk-dashboard-actions .primary-button,
#dashboardView .clerk-dashboard-actions .secondary-button{min-height:38px;padding:8px 13px;border-radius:9px}
#dashboardView .clerk-dashboard-summary{gap:10px;margin-bottom:14px}
#dashboardView .clerk-dashboard-summary .summary-card{
    min-height:82px;
    padding:14px 16px;
    border:1px solid var(--ce-work-border);
    border-radius:11px;
    box-shadow:none;
}
#dashboardView .clerk-dashboard-summary .summary-label{font-size:.84rem;color:#60717f}
#dashboardView .clerk-dashboard-summary strong{font-size:1.65rem;margin-top:5px}
#dashboardView .clerk-dashboard-grid{gap:12px}
#dashboardView .dashboard-panel{border-color:var(--ce-work-border);border-radius:11px;box-shadow:none;padding:16px 18px}
#dashboardView .dashboard-panel-heading{margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid #e4ebf0}
#dashboardView .dashboard-panel-heading h3{font-size:1rem}
#dashboardView .dashboard-panel-heading p{font-size:.84rem;color:var(--ce-work-muted)}

/* Person Search: compact search tools first, results second. */
#personSearchView .person-history-search-panel{
    margin:0 0 18px;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
}
#personSearchView .person-history-search-grid{gap:10px;align-items:end}
#personSearchView .person-history-search-grid .form-field{gap:5px}
#personSearchView .person-history-search-grid .form-field>span{font-size:.78rem;font-weight:750;color:#627482}
#personSearchView .person-history-search-grid input{min-height:44px;border-radius:10px;background:#fff}
#personSearchView .person-history-search-button{min-height:44px;border-radius:10px;padding-inline:18px}
#personSearchView .person-history-search-note{margin:7px 0 0;font-size:.82rem;color:#788692}
#personSearchView .person-history-results-heading{margin:0 0 10px;padding:10px 12px;border:1px solid var(--ce-work-border);border-radius:10px;background:#fff}
#personSearchView .person-history-results>.empty-message{padding:16px 4px;color:#74838f}

/* Prosecutor / Public Defender: summary + search without form-heavy chrome. */
#districtAttorneyView .role-summary-grid,
#publicDefenderView .role-summary-grid{gap:10px;margin-bottom:14px}
#districtAttorneyView .role-summary-grid .summary-card,
#publicDefenderView .role-summary-grid .summary-card{
    min-height:78px;
    padding:13px 15px;
    border:1px solid var(--ce-work-border);
    border-radius:11px;
    box-shadow:none;
}
#districtAttorneyView .role-summary-grid .summary-label,
#publicDefenderView .role-summary-grid .summary-label{font-size:.82rem;color:#627482}
#districtAttorneyView .role-summary-grid strong,
#publicDefenderView .role-summary-grid strong{font-size:1.6rem;margin-top:4px}
#districtAttorneyView .role-toolbar,
#publicDefenderView .role-toolbar{
    gap:10px;
    margin:0 0 8px;
    padding:0;
    background:transparent;
}
#districtAttorneyView .role-search-field,
#districtAttorneyView .role-filter-field,
#publicDefenderView .role-search-field,
#publicDefenderView .role-filter-field{gap:5px}
#districtAttorneyView .role-search-field>span,
#districtAttorneyView .role-filter-field>span,
#publicDefenderView .role-search-field>span,
#publicDefenderView .role-filter-field>span{font-size:.76rem;color:#687987;font-weight:750}
#districtAttorneyView .role-search-field input,
#districtAttorneyView .role-filter-field select,
#publicDefenderView .role-search-field input,
#publicDefenderView .role-filter-field select{min-height:44px;border-radius:10px;background:#fff}
#districtAttorneyView .role-view-note,
#publicDefenderView .role-view-note{
    margin:0 0 14px;
    padding:7px 2px;
    border:0;
    border-radius:0;
    background:transparent;
    color:#74838f;
    font-size:.8rem;
}

/* Active Alerts / NCIC: preserve the warning, reduce everything around it. */
#activeAlertsView .alert-hub-navigation{
    display:flex;
    gap:6px;
    margin:0 0 16px;
    padding:0 0 8px;
    border-bottom:1px solid var(--ce-work-border);
}
#activeAlertsView .alert-hub-tab{min-height:38px;padding:8px 13px;border-radius:8px}
#activeAlertsView .alert-subheading{margin:0 0 12px;padding:0;border:0;align-items:center}
#activeAlertsView .alert-subheading h3{margin:0;font-size:1.03rem}
#activeAlertsView .alert-subheading p{margin:3px 0 0;font-size:.84rem;color:var(--ce-work-muted)}
#activeAlertsView .alert-subheading .primary-button{min-height:38px;padding:8px 13px;border-radius:9px}
#activeAlertsView .active-alert-warning{
    margin:0 0 12px;
    padding:10px 12px;
    border-radius:9px;
    font-size:.82rem;
    line-height:1.4;
}
#activeAlertsView .active-alert-toolbar{gap:10px;margin-bottom:14px}
#activeAlertsView .active-alert-toolbar label{gap:5px}
#activeAlertsView .active-alert-toolbar label>span{font-size:.76rem;color:#687987;font-weight:750}
#activeAlertsView .active-alert-toolbar input,
#activeAlertsView .active-alert-toolbar select{min-height:42px;border-radius:9px;background:#fff}

/* Administration: cleaner left rail and less boxed-in content. */
#administrationView .admin-layout{grid-template-columns:190px minmax(0,1fr);gap:18px}
#administrationView .admin-navigation{
    gap:4px;
    padding:6px;
    border:1px solid var(--ce-work-border);
    border-radius:11px;
    background:#fff;
}
#administrationView .admin-nav-button{
    padding:9px 10px;
    border:0;
    border-radius:7px;
    background:transparent;
    color:#3e5566;
    font-size:.88rem;
    font-weight:700;
}
#administrationView .admin-nav-button:hover{background:#f0f5f8}
#administrationView .admin-nav-button.active{
    background:#e9f1f6;
    color:#123f5e;
    box-shadow:inset 3px 0 0 #174c70;
}
#administrationView .admin-content{min-width:0}
#administrationView .admin-panel-heading{margin-bottom:14px;padding-bottom:11px;border-bottom:1px solid #e2e9ee}
#administrationView .admin-panel-heading h3{font-size:1.03rem}
#administrationView .admin-panel-heading p{font-size:.84rem;color:var(--ce-work-muted)}
#administrationView .admin-panel-heading .primary-button{min-height:38px;padding:8px 13px;border-radius:9px}

@media(max-width:800px){
    .ce-modern-workspace>.section-heading{flex-direction:row;gap:12px}
    .ce-modern-workspace>.section-heading .section-heading-actions{width:auto}
    #dashboardView .clerk-dashboard-actions{flex-wrap:wrap;justify-content:flex-end}
    #administrationView .admin-layout{grid-template-columns:1fr}
    #administrationView .admin-navigation{position:static;display:flex;flex-direction:row;flex-wrap:wrap}
    #administrationView .admin-nav-button{width:auto;flex:1 1 145px;text-align:center}
    #administrationView .admin-nav-button.active{box-shadow:inset 0 -3px 0 #174c70}
}
@media(max-width:620px){
    .ce-modern-workspace>.section-heading{flex-direction:column}
    .ce-modern-workspace>.section-heading .section-heading-actions{margin-left:0;justify-content:flex-start}
    #personSearchView .person-history-search-grid,
    #districtAttorneyView .role-toolbar,
    #publicDefenderView .role-toolbar{grid-template-columns:1fr}
}

/* v11.6 Officer Field Workspace */
.officer-field-workspace{max-width:1180px;margin:0 auto}.officer-field-heading{align-items:center;gap:24px;margin-bottom:16px}.workspace-eyebrow{display:block;margin-bottom:4px;font-size:.72rem;font-weight:800;letter-spacing:.12em;color:#5f7185}.officer-field-status{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid #d7e0e8;border-radius:999px;background:#fff;font-size:.82rem;font-weight:700;color:#33485c}.officer-field-status-dot{width:9px;height:9px;border-radius:50%;background:#28a35a;box-shadow:0 0 0 3px rgba(40,163,90,.12)}.officer-field-navigation{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:6px;margin-bottom:18px;border:1px solid #d9e2ea;border-radius:14px;background:#edf2f6}.officer-field-tab{min-height:52px;display:inline-flex;align-items:center;justify-content:center;gap:9px;border:0;border-radius:10px;background:transparent;color:#31485c;font-weight:800;cursor:pointer}.officer-field-tab:hover{background:rgba(255,255,255,.7)}.officer-field-tab.active{background:#173f5d;color:#fff;box-shadow:0 2px 8px rgba(14,43,65,.16)}.officer-field-tab-badge{min-width:21px;padding:2px 6px;border-radius:999px;background:#b42318;color:#fff;font-size:.72rem}.officer-field-panel[hidden]{display:none!important}.officer-field-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:14px}.officer-field-panel-heading h3{margin:0 0 4px}.officer-field-panel-heading p{margin:0;color:#607386}.officer-field-callout{display:flex;flex-direction:column;gap:4px;padding:14px 16px;margin-bottom:14px;border:1px solid #d7e1e9;border-left:4px solid #d5a63b;border-radius:10px;background:#fff}.officer-field-preview{min-height:120px;padding:14px;border:1px solid #dbe3ea;border-radius:12px;background:#fff}@media(max-width:700px){.officer-field-workspace{padding-left:12px;padding-right:12px}.officer-field-status{display:none}.officer-field-navigation{position:sticky;top:0;z-index:12;gap:4px}.officer-field-tab{min-height:56px;padding:8px 6px;flex-direction:column;gap:3px;font-size:.78rem}.officer-field-panel-heading{align-items:stretch;flex-direction:column}.officer-field-panel-heading .primary-button{width:100%;min-height:48px}}


/* =========================================================
   COURTENTRY v11.7 — OFFICER VIEW / FUTURE MOBILE APP BASE
   ========================================================= */
.officer-dashboard-v117{max-width:1180px}
.officer-field-heading-actions{display:flex;align-items:center;gap:10px}
.officer-dashboard-panel{margin:0 0 18px;padding:18px;border:1px solid #d9e2ea;border-radius:14px;background:#fff;box-shadow:0 3px 12px rgba(25,49,70,.05)}
.officer-dashboard-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:14px}
.officer-dashboard-panel-heading h3{margin:2px 0 3px;font-size:1.2rem}
.officer-dashboard-panel-heading p{margin:0;color:#607386}
.officer-panel-kicker{display:block;font-size:.68rem;font-weight:800;letter-spacing:.12em;color:#6b7d8e}
.officer-scan-license-button{min-height:42px;white-space:nowrap}
.officer-court-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:14px}
.officer-court-stat{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 15px;border:1px solid #d9e2ea;border-radius:11px;background:#f8fafc;color:#31485c;text-align:left;cursor:pointer}
.officer-court-stat span{font-weight:750}
.officer-court-stat strong{font-size:1.35rem;color:#173f5d}
.officer-court-stat.active{border-color:#173f5d;background:#eef4f8;box-shadow:inset 0 0 0 1px #173f5d}
.officer-court-toolbar{margin-bottom:12px}
.officer-court-search-wrap{position:relative}
.officer-court-search-wrap .ce-icon{position:absolute;left:13px;top:50%;transform:translateY(-50%);pointer-events:none}
.officer-court-search-wrap input{width:100%;min-height:44px;padding-left:40px}
.officer-court-today-list{display:grid;gap:8px}
.officer-court-person-card{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 14px;border:1px solid #e0e7ed;border-radius:10px;background:#fff}
.officer-court-person-main{display:flex;flex-direction:column;gap:3px;min-width:0}
.officer-court-person-main strong{font-size:.96rem;color:#1d3347}
.officer-court-person-main span{font-size:.82rem;color:#66798b}
.officer-court-person-actions{display:flex;align-items:center;gap:12px;flex:0 0 auto}
.officer-presence-pill{padding:5px 9px;border-radius:999px;background:#edf1f4;color:#5d6e7e;font-size:.74rem;font-weight:800}
.officer-presence-pill.is-present,.officer-at-court-card .officer-presence-pill{background:#e8f5ed;color:#247244}
.officer-notify-toggle{display:flex;align-items:center;gap:7px;font-size:.78rem;font-weight:750;color:#42576a;cursor:pointer}
.officer-notify-toggle input{position:absolute;opacity:0;pointer-events:none}
.officer-notify-switch{position:relative;width:36px;height:20px;border-radius:999px;background:#c9d2da;transition:.15s}
.officer-notify-switch:after{content:"";position:absolute;width:16px;height:16px;left:2px;top:2px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.22);transition:.15s}
.officer-notify-toggle input:checked + .officer-notify-switch{background:#173f5d}
.officer-notify-toggle input:checked + .officer-notify-switch:after{transform:translateX(16px)}
.officer-alerts-panel .alert-hub-navigation{margin-top:8px}
.officer-alerts-panel #watchListsPanel{display:none}
.officer-priority-alert-banner{margin-bottom:14px}
.officer-tool-dialog{width:min(880px,calc(100vw - 32px));min-width:420px;min-height:320px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px)}
.officer-scan-dialog{width:min(620px,calc(100vw - 32px));min-height:360px}
.officer-license-scan-body{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;padding:30px 24px}
.officer-license-scan-icon{display:grid;place-items:center;width:72px;height:72px;border-radius:16px;background:#eef4f8;color:#173f5d;font-size:2.2rem}
.officer-license-scan-body>strong{font-size:1.2rem;color:#173f5d}
.officer-license-scan-body>p{max-width:500px;margin:0;color:#607386}
.officer-license-scan-body .officer-field-callout{text-align:left;width:100%;margin-top:10px}
.officer-dashboard-v117 .officer-more-menu-wrap{position:relative}

@media(max-width:700px){
  .officer-dashboard-v117{padding-left:10px;padding-right:10px}
  .officer-field-heading-actions .officer-field-status{display:none}
  .officer-dashboard-panel{padding:14px;border-radius:12px}
  .officer-dashboard-panel-heading{align-items:stretch;flex-direction:column}
  .officer-scan-license-button{width:100%;min-height:48px}
  .officer-court-summary{grid-template-columns:1fr}
  .officer-court-stat{min-height:52px}
  .officer-court-person-card{align-items:flex-start;flex-direction:column}
  .officer-court-person-actions{width:100%;justify-content:space-between}
  .officer-notify-toggle{min-height:40px}
  .officer-tool-dialog{min-width:0;width:calc(100vw - 12px);max-width:calc(100vw - 12px)}
}

/* v11.8 — Officer View cleanup */
.officer-tool-source{display:none}
#officerHotListDialog #activeAlertsView.officer-tool-source{display:block}


/* v11.9 — Officer More menu uses the exact Clerk View control */
#officerView .clerk-more-menu-button{
    width:42px;
    height:42px;
    border-color:#c8d5de;
    border-radius:11px;
    box-shadow:0 1px 2px rgba(21,43,59,.05);
}
#officerView .clerk-more-menu-button:hover,
#officerView .clerk-more-menu-button[aria-expanded="true"]{
    background:#f0f6fa;
    border-color:#9eb4c4;
}
#officerView .officer-more-menu{
    right:0;
    left:auto;
}
@media(max-width:800px){
    #officerView .officer-more-menu{
        right:0;
        left:auto;
        width:min(260px,calc(100vw - 24px));
    }
}


/* =========================================================
   v11.10 — Officer tools menu mirrors Clerk View
   ========================================================= */
#officerView .clerk-tools{
    position:relative;
    display:flex;
    align-items:center;
}
#officerView .clerk-tools-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:42px;
    height:42px;
    min-width:42px;
    padding:0;
    border:1px solid #c8d5de;
    border-radius:11px;
    background:#fff;
    color:#183d58;
    font-size:25px;
    line-height:1;
    font-weight:700;
    cursor:pointer;
    box-shadow:0 1px 2px rgba(21,43,59,.05);
}
#officerView .clerk-tools-button:hover,
#officerView .clerk-tools-button[aria-expanded="true"]{
    background:#f0f6fa;
    border-color:#9eb4c4;
}
#officerView .clerk-tools-menu{
    min-width:220px;
    padding:6px;
    border:1px solid #d5dfe7;
    border-radius:12px;
    background:#fff;
    box-shadow:0 14px 36px rgba(24,55,78,.18);
}
#officerView .clerk-tools-menu[hidden]{
    display:none !important;
}
#officerView .clerk-tools-menu button{
    display:flex;
    width:100%;
    align-items:center;
    padding:10px 12px;
    border:0;
    border-radius:8px;
    background:transparent;
    color:#203a4e;
    font:inherit;
    font-weight:650;
    text-align:left;
    cursor:pointer;
}
#officerView .clerk-tools-menu button:hover,
#officerView .clerk-tools-menu button:focus{
    background:#eef4f8;
    outline:none;
}


/* =========================================================
   v11.11 — Administration audit / licensed features
   ========================================================= */
.admin-license-note{
    display:flex;
    gap:12px;
    align-items:flex-start;
    margin:0 0 16px;
    padding:13px 15px;
    border:1px solid #d8e2ea;
    border-radius:11px;
    background:#f7fafc;
    color:#40576a;
}
.admin-license-note strong{color:#173f5d;white-space:nowrap}
.admin-licensed-feature-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.admin-license-card{
    padding:14px 15px;
    border:1px solid #d8e2ea;
    border-radius:11px;
    background:#fff;
}
.admin-license-card-heading{display:flex;justify-content:space-between;gap:12px;align-items:center}
.admin-license-card-heading strong{color:#1c3549}
.admin-license-card p{margin:6px 0 0;color:#647789;font-size:.86rem;line-height:1.4}
.admin-license-status{
    padding:4px 8px;
    border-radius:999px;
    font-size:.7rem;
    font-weight:800;
    white-space:nowrap;
}
.admin-license-card.is-licensed .admin-license-status{background:#e9f6ee;color:#247145}
.admin-license-card.is-unlicensed .admin-license-status{background:#f1f3f5;color:#697784}

.access-permission-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px 12px;
}
.access-permission-group-heading{
    grid-column:1/-1;
    margin-top:10px;
    padding:8px 2px 4px;
    border-bottom:1px solid #dfe7ed;
    color:#526b7e;
    font-size:.72rem;
    font-weight:850;
    letter-spacing:.09em;
    text-transform:uppercase;
}
.access-permission-option{
    align-items:flex-start;
    min-height:52px;
}
.access-permission-copy{display:flex;flex-direction:column;gap:2px}
.access-permission-title{font-weight:650}
.access-permission-copy small{color:#6c7f8f;line-height:1.25}
.access-permission-unlicensed{opacity:.72;background:#f8f9fa}
.access-license-badge{
    display:inline-flex;
    align-self:flex-start;
    margin-top:3px;
    padding:2px 7px;
    border-radius:999px;
    background:#eceff2;
    color:#6e7881;
    font-size:.65rem;
    font-style:normal;
    font-weight:800;
    letter-spacing:.02em;
}
@media(max-width:760px){
    .admin-licensed-feature-grid,.access-permission-grid{grid-template-columns:1fr}
    .admin-license-note{flex-direction:column;gap:4px}
}


/* =========================================================
   v11.12 — CourtEntry Role Selector
   ========================================================= */
.ce-role-selector{
    position:relative;
    width:100%;
}
.ce-role-selector-native{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    overflow:hidden !important;
    clip:rect(0 0 0 0) !important;
    clip-path:inset(50%) !important;
    white-space:nowrap !important;
    opacity:0 !important;
    pointer-events:none !important;
}
.ce-role-selector-button{
    width:100%;
    min-height:50px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:0 16px;
    border:1px solid #9eb3c3;
    border-radius:10px;
    background:#fff;
    color:#182f43;
    font:inherit;
    font-size:1rem;
    text-align:left;
    cursor:pointer;
    box-shadow:0 1px 2px rgba(21,43,59,.04);
}
.ce-role-selector-button:hover,
.ce-role-selector-button[aria-expanded="true"]{
    border-color:#1c5274;
    box-shadow:0 0 0 2px rgba(28,82,116,.08);
}
.ce-role-selector-chevron{
    flex:0 0 auto;
    color:#45657b;
    font-size:1.1rem;
    transform:translateY(-1px);
}
.ce-role-selector-menu{
    position:absolute;
    z-index:4500;
    left:0;
    right:0;
    top:calc(100% + 7px);
    padding:7px;
    border:1px solid #d0dde6;
    border-radius:12px;
    background:#fff;
    box-shadow:0 16px 40px rgba(23,54,77,.18);
}
.ce-role-selector-menu[hidden]{
    display:none !important;
}
.ce-role-selector-option{
    width:100%;
    display:flex;
    align-items:center;
    min-height:43px;
    padding:9px 12px;
    border:0;
    border-radius:8px;
    background:transparent;
    color:#203a4d;
    font:inherit;
    font-size:.96rem;
    font-weight:600;
    text-align:left;
    cursor:pointer;
}
.ce-role-selector-option:hover,
.ce-role-selector-option:focus{
    background:#eef4f8;
    outline:none;
}
.ce-role-selector-option.is-selected{
    background:#e4eef4;
    color:#0f4768;
    box-shadow:inset 3px 0 0 #14587d;
}


/* =========================================================
   v11.13 — Role selector matches CourtEntry navigation tabs
   ========================================================= */
.ce-role-selector-button{
    min-height:46px;
    padding:0 14px;
    border:1px solid #d8e0e6;
    border-radius:9px;
    background:#fff;
    color:#111;
    font-size:.98rem;
    font-weight:700;
    box-shadow:none;
}
.ce-role-selector-button:hover,
.ce-role-selector-button[aria-expanded="true"]{
    border-color:#c5d0d8;
    background:#f7f8f9;
    box-shadow:none;
}
.ce-role-selector-chevron{
    color:#1a4968;
    font-size:1rem;
}

.ce-role-selector-menu{
    top:calc(100% + 5px);
    padding:6px;
    border:1px solid #d8e0e6;
    border-radius:9px;
    background:#fff;
    box-shadow:0 8px 22px rgba(28,51,67,.10);
}

.ce-role-selector-option{
    min-height:40px;
    padding:8px 12px;
    border-radius:8px;
    color:#111;
    font-size:.94rem;
    font-weight:700;
}
.ce-role-selector-option:hover,
.ce-role-selector-option:focus{
    background:#f1f1f1;
    color:#111;
}
.ce-role-selector-option.is-selected{
    background:#173f5d;
    color:#fff;
    box-shadow:none;
}


/* v11.14 — Officer View is a real workspace permission */
.access-permission-group-heading{
    margin-top:14px;
}
.access-permission-group-heading:first-child{
    margin-top:4px;
}
.access-permission-option:has(input:disabled){
    opacity:.68;
}


/* =========================================================
   v11.16 — Officer tools + NCIC/Records repair
   ========================================================= */
#officerHotListDialog .officer-dialog-active-panel{
    display:block !important;
    width:100%;
}
#officerHotListDialog .officer-dialog-active-panel > [data-feature-content]{
    display:block;
}
#officerHotListDialogBody{
    min-height:180px;
}


/* =========================================================
   v11.17 — NCIC / Records visual refinement
   ========================================================= */

.ncic-records-workspace{
    max-width:1440px;
    margin:0 auto;
    padding:30px 34px 46px;
}

.ncic-records-workspace > .section-heading{
    margin-bottom:22px;
    padding:0 2px 18px;
    border-bottom:1px solid #d8e1e8;
}

.ncic-records-workspace > .section-heading h2{
    margin:0 0 5px;
    font-size:1.42rem;
    letter-spacing:-0.02em;
    color:#173f5c;
}

.ncic-records-workspace > .section-heading p{
    margin:0;
    color:#64788a;
    font-size:.98rem;
}

.ncic-records-workspace .alert-hub-tabs{
    width:max-content;
    max-width:100%;
    margin:0 auto 18px;
    padding:4px;
    border:1px solid #d5e0e8;
    border-radius:12px;
    background:#edf3f7;
    box-shadow:0 1px 2px rgba(23,63,92,.04);
}

.ncic-records-workspace .alert-hub-tab{
    min-height:38px;
    padding:8px 16px;
    border:0;
    border-radius:9px;
    background:transparent;
    color:#536a7b;
    font-weight:700;
}

.ncic-records-workspace .alert-hub-tab.active{
    background:#fff;
    color:#173f5c;
    box-shadow:0 1px 5px rgba(23,63,92,.12);
}

.ncic-records-workspace .alert-hub-panel{
    max-width:1160px;
    margin:0 auto;
    padding:26px 28px 30px;
    border:1px solid #d7e1e8;
    border-radius:16px;
    background:#fff;
    box-shadow:0 8px 24px rgba(23,63,92,.055);
}

.ncic-records-workspace .alert-subheading,
.ncic-records-workspace .admin-panel-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:22px;
    margin:0 0 20px;
    padding:0;
    border:0;
}

.ncic-records-workspace .alert-subheading > div,
.ncic-records-workspace .admin-panel-heading > div{
    flex:1;
}

.ncic-records-workspace .alert-subheading h3,
.ncic-records-workspace .admin-panel-heading h3{
    margin:0 0 4px;
    font-size:1.16rem;
    color:#173f5c;
}

.ncic-records-workspace .alert-subheading p,
.ncic-records-workspace .admin-panel-heading p{
    margin:0;
    color:#6b7e8d;
    line-height:1.45;
}

.ncic-records-workspace .alert-subheading .primary-button{
    flex:0 0 auto;
    min-height:40px;
    padding:9px 18px;
    border-radius:9px;
}

.ncic-records-workspace .active-alert-warning{
    margin:0 0 20px;
    padding:12px 15px;
    border-left-width:4px;
    border-radius:9px;
    font-size:.9rem;
    line-height:1.4;
}

.ncic-records-workspace .active-alert-toolbar{
    display:grid;
    grid-template-columns:minmax(0,1fr) 150px;
    gap:14px;
    align-items:end;
    margin:0 0 18px;
    padding:16px;
    border:1px solid #e0e7ec;
    border-radius:12px;
    background:#f8fafb;
}

.ncic-records-workspace .active-alert-toolbar label{
    display:flex;
    flex-direction:column;
    gap:6px;
    margin:0;
    color:#51697b;
    font-size:.78rem;
    font-weight:800;
    letter-spacing:.015em;
}

.ncic-records-workspace .active-alert-toolbar input,
.ncic-records-workspace .active-alert-toolbar select{
    width:100%;
    min-height:42px;
    margin:0;
    border:1px solid #c9d5de;
    border-radius:9px;
    background:#fff;
    font-size:.96rem;
}

.ncic-records-workspace .active-alert-toolbar input:focus,
.ncic-records-workspace .active-alert-toolbar select:focus{
    outline:2px solid rgba(23,63,92,.18);
    outline-offset:1px;
    border-color:#6f8ba0;
}

.ncic-records-workspace .active-alert-list:empty::after,
.ncic-records-workspace .admin-record-list:empty::after,
.ncic-records-workspace .watch-history-list:empty::after{
    content:"No records to display.";
    display:block;
    padding:26px 18px;
    border:1px dashed #d5dfe6;
    border-radius:11px;
    background:#fbfcfd;
    color:#708290;
    text-align:center;
}

@media (max-width:760px){
    .ncic-records-workspace{
        padding:20px 14px 34px;
    }

    .ncic-records-workspace .alert-hub-panel{
        padding:20px 16px 24px;
        border-radius:13px;
    }

    .ncic-records-workspace .alert-subheading,
    .ncic-records-workspace .admin-panel-heading{
        flex-direction:column;
    }

    .ncic-records-workspace .active-alert-toolbar{
        grid-template-columns:1fr;
    }

    .ncic-records-workspace .alert-subheading .primary-button{
        width:100%;
    }
}


/* =========================================================
   v11.18 — True phone layout
   Header/workspace navigation + Messenger single-pane flow
   ========================================================= */

.mobile-workspace-menu-button,
.messenger-mobile-back-button{
    display:none;
}

@media(max-width:760px){
    /* Header becomes one compact app-style bar. */
    .app-header{
        position:relative;
        z-index:2200;
        display:flex;
        flex-direction:row;
        align-items:center;
        justify-content:space-between;
        gap:10px;
        padding:12px 14px;
        min-height:78px;
    }

    .app-title-area{
        min-width:0;
        flex:1 1 auto;
    }

    .courtentry-brand-link{
        gap:9px;
        min-width:0;
    }

    .courtentry-header-logo{
        width:52px;
        height:52px;
        flex:0 0 52px;
        border-radius:10px;
    }

    .courtentry-header-wordmark{
        min-width:0;
    }

    .courtentry-header-wordmark strong{
        font-size:1.45rem;
        white-space:nowrap;
    }

    .courtentry-header-wordmark small{
        display:none;
    }

    .header-utility-area{
        flex:0 0 auto;
        display:flex;
        flex-direction:row;
        align-items:center;
        gap:2px;
    }

    .mobile-workspace-menu-button,
    .header-utility-icon-button,
    .account-menu-button{
        width:40px;
        height:40px;
        min-height:40px;
        padding:0;
        display:grid;
        place-items:center;
        border:0;
        border-radius:50%;
        background:transparent;
        color:#fff;
    }

    .mobile-workspace-menu-button{
        cursor:pointer;
    }

    .mobile-workspace-menu-button:hover,
    .mobile-workspace-menu-button:focus-visible,
    .mobile-workspace-menu-button[aria-expanded="true"]{
        background:rgba(255,255,255,.14);
        outline:none;
    }

    .mobile-workspace-menu-button .ce-icon,
    .mobile-workspace-menu-button svg{
        width:21px;
        height:21px;
    }

    .header-utility-bar{
        display:flex;
        gap:0;
        padding:0;
        border:0;
    }

    .account-menu-wrap{
        position:static;
    }

    .account-avatar{
        width:34px;
        height:34px;
    }

    .account-menu-chevron,
    .account-menu-name{
        display:none!important;
    }

    /* Keep the account card entirely on-screen. */
    .account-menu{
        position:fixed;
        top:72px;
        left:10px;
        right:10px;
        width:auto;
        max-width:none;
        z-index:2400;
        border-radius:12px;
    }

    .global-notifications-menu{
        top:72px;
        z-index:2400;
    }

    /* Desktop workspace row becomes an app-launcher panel on phones. */
    .main-navigation{
        display:none;
        position:fixed;
        top:72px;
        left:10px;
        right:10px;
        z-index:2350;
        padding:10px;
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:7px;
        background:#fff;
        border:1px solid #d6e0e7;
        border-radius:13px;
        box-shadow:0 18px 42px rgba(13,37,58,.22);
    }

    .main-navigation.mobile-nav-open{
        display:grid;
    }

    .main-navigation .navigation-button{
        min-width:0;
        width:100%;
        min-height:46px;
        padding:10px 9px;
        border:1px solid transparent;
        border-radius:9px;
        background:#fff;
        color:#173f5c;
        text-align:left;
        font-size:.9rem;
        font-weight:750;
    }

    .main-navigation .navigation-button:hover,
    .main-navigation .navigation-button:focus-visible{
        background:#f0f5f8;
        outline:none;
    }

    .main-navigation .navigation-button.active{
        background:#173f5c;
        color:#fff;
    }

    .app-main{
        margin:16px 12px;
    }

    /* Messenger is a real single-pane phone flow. */
    .messages-panel.messenger-shell{
        left:8px!important;
        right:8px!important;
        top:8px!important;
        width:calc(100vw - 16px)!important;
        height:calc(100dvh - 16px)!important;
        max-height:calc(100dvh - 16px)!important;
        border-radius:14px;
        resize:none!important;
    }

    .messenger-topbar{
        min-height:72px;
        padding:13px 16px;
    }

    .messenger-topbar h2{
        font-size:1.65rem;
    }

    .messenger-layout{
        display:block;
        position:relative;
        flex:1;
        min-height:0;
        overflow:hidden;
    }

    .messenger-sidebar,
    .messenger-chat{
        position:absolute;
        inset:0;
        width:100%;
        height:100%;
        min-width:0;
        border:0;
        background:#fff;
    }

    .messenger-sidebar{
        display:flex;
        border-right:0;
    }

    .messenger-chat{
        display:none!important;
    }

    .messages-panel.mobile-chat-open .messenger-sidebar{
        display:none;
    }

    .messages-panel.mobile-chat-open .messenger-chat{
        display:block!important;
    }

    .messenger-sidebar-heading{
        height:58px;
        padding:0 16px;
    }

    .messenger-sidebar-heading strong{
        font-size:1.2rem;
    }

    .messenger-search{
        padding:12px 14px;
    }

    .messenger-search input{
        min-height:44px;
        font-size:16px;
    }

    .messenger-conversation-row{
        grid-template-columns:42px minmax(0,1fr) auto;
        gap:10px;
        padding:12px 14px;
    }

    .messenger-avatar{
        width:40px;
        height:40px;
    }

    .messenger-conversation-meta{
        display:flex;
    }

    .messenger-empty-state{
        display:none!important;
    }

    .messenger-conversation-view{
        height:100%;
    }

    .messenger-chat-header{
        min-height:58px;
        padding:9px 12px;
        gap:8px;
    }

    .messenger-mobile-back-button{
        flex:0 0 38px;
        width:38px;
        height:38px;
        display:grid;
        place-items:center;
        border:0;
        border-radius:50%;
        background:transparent;
        color:#173f5c;
        font-size:2rem;
        line-height:1;
        cursor:pointer;
    }

    .messenger-mobile-back-button:hover,
    .messenger-mobile-back-button:focus-visible{
        background:#eef4f8;
        outline:none;
    }

    .messenger-message{
        max-width:86%;
    }

    .messenger-message-stream{
        padding:14px 12px;
    }

    .messenger-composer{
        padding:10px;
    }

    /* Compose picker stays inside the phone viewport. */
    .messenger-new-dialog{
        left:10px!important;
        right:10px!important;
        width:auto!important;
        max-width:none!important;
    }
}


/* =========================================================
   v11.19 — iPhone/mobile polish
   ========================================================= */
.admin-mobile-more-button{display:none;}

@media(max-width:760px){
    /* Messenger back button: visible, normal navigation affordance. */
    .messenger-mobile-back-button{
        display:grid!important;
        place-items:center;
        width:44px;
        height:44px;
        flex:0 0 44px;
        padding:0;
        border:1px solid #d4dfe7;
        border-radius:50%;
        background:#fff;
        color:#173f5c;
        box-shadow:0 1px 3px rgba(23,63,92,.06);
    }
    .messenger-mobile-back-icon{
        display:block;
        font-size:1.55rem;
        font-weight:700;
        line-height:1;
        transform:translateY(-1px);
    }

    /* Dashboard already has the global workspace launcher on phones. */
    #dashboardView .clerk-dashboard-actions{
        display:none!important;
    }

    /* iOS Safari zooms form controls below 16px on focus. */
    input, textarea, select{
        font-size:16px!important;
    }
    html, body{
        width:100%;
        max-width:100%;
        overflow-x:hidden;
    }
    .app-shell, .app-main, .app-view{
        min-width:0;
        max-width:100%;
    }

    /* Messenger must always sit above the fixed app header. */
    .messages-panel.messenger-shell{
        z-index:5000!important;
        top:max(8px, env(safe-area-inset-top))!important;
        height:calc(100dvh - max(16px, env(safe-area-inset-top) + 8px))!important;
        max-height:calc(100dvh - max(16px, env(safe-area-inset-top) + 8px))!important;
    }
    .messenger-topbar{
        position:relative;
        z-index:2;
        background:#f8fafc;
    }
    #closeMessagesPanelButton{
        position:relative;
        z-index:3;
        width:44px;
        height:44px;
        flex:0 0 44px;
    }

    /* Administration's internal sections become a page-level three-dot menu. */
    #administrationView .administration-heading{
        position:relative;
        padding-right:56px;
    }
    .admin-mobile-more-button{
        display:grid;
        place-items:center;
        position:absolute;
        right:0;
        top:0;
        width:46px;
        height:42px;
        padding:0;
        border:1px solid #cbd7e0;
        border-radius:10px;
        background:#fff;
        color:#173f5c;
        font-size:1.5rem;
        font-weight:800;
        line-height:1;
        box-shadow:0 1px 3px rgba(23,63,92,.06);
        cursor:pointer;
    }
    #administrationView .admin-layout{
        display:block;
    }
    #adminSectionMenu.admin-navigation{
        display:none!important;
        position:fixed!important;
        z-index:4500;
        margin:0!important;
        padding:8px!important;
        grid-template-columns:1fr!important;
        gap:4px!important;
        border:1px solid #d4dfe7;
        border-radius:12px;
        background:#fff;
        box-shadow:0 16px 36px rgba(23,63,92,.20);
    }
    #adminSectionMenu.admin-navigation.mobile-admin-menu-open{
        display:grid!important;
    }
    #adminSectionMenu .admin-nav-button{
        width:100%!important;
        min-height:44px;
        padding:10px 12px!important;
        border:0!important;
        border-radius:8px!important;
        background:#fff!important;
        color:#173f5c!important;
        text-align:left!important;
        box-shadow:none!important;
    }
    #adminSectionMenu .admin-nav-button:hover,
    #adminSectionMenu .admin-nav-button:focus-visible,
    #adminSectionMenu .admin-nav-button.active{
        background:#eef4f7!important;
        color:#173f5c!important;
    }
}


/* =========================================================
   v11.21 — Organization Training Mode
   ========================================================= */

.training-mode-banner{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:24px;
    min-height:46px;
    padding:9px 24px;
    border-top:1px solid #d89d23;
    border-bottom:1px solid #c98a10;
    background:#fff3cf;
    color:#5f4308;
    box-shadow:0 2px 8px rgba(102,72,12,.08);
}

.training-mode-banner[hidden]{
    display:none!important;
}

.training-mode-banner-main{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:0;
}

.training-mode-banner-main strong{
    flex:0 0 auto;
    padding:4px 9px;
    border-radius:6px;
    background:#7a5200;
    color:#fff;
    font-size:.76rem;
    letter-spacing:.09em;
}

.training-mode-banner-main span,
.training-mode-banner-note{
    font-size:.88rem;
    font-weight:650;
}

.training-mode-banner-note{
    color:#80611d;
}

.training-mode-admin-card{
    margin-top:24px;
    padding:22px;
    border:1px solid #d7c28e;
    border-radius:14px;
    background:#fffaf0;
    box-shadow:0 4px 14px rgba(75,54,13,.05);
}

.training-mode-admin-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
}

.training-mode-admin-heading h4{
    margin:3px 0 6px;
    color:#173f5c;
    font-size:1.18rem;
}

.training-mode-admin-heading p{
    max-width:760px;
    margin:0;
    color:#617181;
    line-height:1.5;
}

.training-mode-admin-eyebrow{
    color:#8a681c;
    font-size:.72rem;
    font-weight:850;
    letter-spacing:.09em;
}

.training-mode-admin-status{
    flex:0 0 auto;
    padding:6px 10px;
    border:1px solid #cad6de;
    border-radius:999px;
    background:#fff;
    color:#667886;
    font-size:.78rem;
    font-weight:800;
}

.training-mode-admin-status.is-active{
    border-color:#d5a33c;
    background:#fff0c7;
    color:#674500;
}

.training-mode-admin-rules{
    display:grid;
    gap:7px;
    margin:18px 0;
    padding:14px 16px;
    border:1px solid #eadbb8;
    border-radius:10px;
    background:rgba(255,255,255,.68);
    color:#5f6f7c;
    font-size:.88rem;
}

.training-mode-admin-rules span::before{
    content:"✓";
    margin-right:8px;
    color:#7a5b13;
    font-weight:900;
}

.training-mode-admin-actions{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.training-mode-stop-button{
    border-color:#8d2b23!important;
    background:#8d2b23!important;
}

body.training-mode-active .panic-launch-button{
    display:none!important;
}

@media(max-width:760px){
    .training-mode-banner{
        align-items:flex-start;
        flex-direction:column;
        gap:4px;
        padding:9px 14px;
    }

    .training-mode-banner-main{
        align-items:flex-start;
        flex-direction:column;
        gap:5px;
    }

    .training-mode-banner-main span,
    .training-mode-banner-note{
        font-size:.8rem;
    }

    .training-mode-admin-heading{
        flex-direction:column;
        gap:12px;
    }

    .training-mode-admin-actions{
        flex-direction:column;
    }

    .training-mode-admin-actions button{
        width:100%;
    }
}


/* =========================================================
   v11.22 — Clerk dialog polish + synchronized arrivals
   ========================================================= */

/* Old pink arrival strip is retired. Current Arrivals + NEW badge are the cue. */
#clerkView .retired-arrival-banner{
    display:none!important;
}

/* Clerk Settings: consistent header rhythm and a more legible workspace eyebrow. */
.clerk-settings-dialog.ce-clerk-floating-dialog{
    width:min(720px,calc(100vw - 32px));
    height:min(560px,calc(100vh - 32px));
}
.clerk-settings-dialog .clerk-settings-card{
    padding:0!important;
}
.clerk-settings-dialog .clerk-settings-heading{
    padding:20px 22px 17px;
    border-bottom:1px solid #dde5eb;
    background:#fff;
}
.clerk-settings-dialog .dashboard-eyebrow{
    display:block;
    margin-bottom:5px;
    font-size:.82rem;
    font-weight:850;
    letter-spacing:.09em;
}
.clerk-settings-dialog .clerk-settings-heading h3{
    font-size:1.35rem;
    line-height:1.2;
}
.clerk-settings-dialog .clerk-settings-heading p{
    margin-top:5px;
}
.clerk-settings-dialog .clerk-settings-options{
    margin:0;
    padding:18px 22px 14px;
    gap:10px;
}
.clerk-settings-dialog .clerk-settings-note{
    margin:0 22px;
}
.clerk-settings-dialog .dialog-actions{
    margin:0;
    padding:16px 22px 20px;
}

/* Court History: the global .section-heading used column flex;
   force a real title bar so the X stays beside the heading. */
.clerk-workspace-dialog>.court-history-view>.court-history-window-header{
    display:flex!important;
    flex-direction:row!important;
    align-items:flex-start!important;
    justify-content:space-between!important;
    gap:18px!important;
    min-height:0!important;
    padding:18px 20px!important;
}
.clerk-workspace-dialog>.court-history-view>.court-history-window-header>div{
    min-width:0;
}
.clerk-workspace-dialog>.court-history-view>.court-history-window-header h2{
    margin:0!important;
    line-height:1.2;
}
.clerk-workspace-dialog>.court-history-view>.court-history-window-header p{
    margin:4px 0 0!important;
}
.clerk-workspace-dialog .court-history-toolbar{
    padding:12px 20px!important;
}
.clerk-workspace-dialog .court-history-browser{
    padding:16px!important;
}

/* Upload Docket: one title bar only, organized content, no prototype sample-data control. */
#clerkUploadDocketDialog{
    width:min(760px,calc(100vw - 32px));
    height:min(610px,calc(100vh - 32px));
}
#clerkUploadDocketDialog>#uploadView{
    display:block!important;
    height:calc(100% - 76px);
    padding:0!important;
    overflow:auto;
}
#clerkUploadDocketDialog>#uploadView>.section-heading{
    display:none!important;
}
#clerkUploadDocketDialog .upload-panel{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:16px;
    align-items:end;
    padding:22px;
}
#clerkUploadDocketDialog .file-upload-area{
    display:grid;
    gap:5px;
    min-width:0;
}
#clerkUploadDocketDialog .file-upload-area input{
    width:100%;
    box-sizing:border-box;
    margin-top:7px;
}
#clerkUploadDocketDialog #uploadDocketButton{
    min-height:42px;
    white-space:nowrap;
}
#clerkUploadDocketDialog .pdf-import-results{
    grid-column:1 / -1;
    margin:8px 0 0;
    padding:20px;
    border:1px solid #dbe5ec;
    border-radius:12px;
    background:#fff;
}
#clerkUploadDocketDialog .pdf-import-results h3{
    margin:0 0 14px;
}
#clerkUploadDocketDialog .pdf-import-results p{
    margin:9px 0;
}
#clerkUploadDocketDialog .import-message{
    margin-top:16px!important;
}

/* Add Person: same title-bar construction as other CourtEntry dialogs. */
#personDialog{
    width:min(720px,calc(100vw - 32px));
    max-width:720px;
}
#personDialog .dialog-heading{
    align-items:flex-start;
    padding:20px 26px 17px;
}
#personDialog .dialog-heading>div:first-child{
    min-width:0;
}
#personDialog .dialog-heading h2{
    margin:0!important;
    font-size:1.35rem;
    line-height:1.2;
}
#personDialog .dialog-heading p{
    margin:5px 0 0!important;
}
#personDialog .admin-form-grid{
    padding-top:22px;
}
#personDialog .dialog-actions{
    margin-top:2px;
}

@media(max-width:760px){
    .clerk-settings-dialog.ce-clerk-floating-dialog,
    #clerkUploadDocketDialog{
        width:calc(100vw - 16px)!important;
        height:calc(100dvh - 16px)!important;
    }

    #clerkUploadDocketDialog .upload-panel{
        grid-template-columns:1fr;
        padding:18px 16px;
    }

    #clerkUploadDocketDialog #uploadDocketButton{
        width:100%;
    }

    #personDialog{
        width:calc(100vw - 20px);
        max-width:none;
    }

    #personDialog .dialog-heading{
        padding:17px 18px 15px;
    }

    #personDialog .admin-form-grid{
        grid-template-columns:1fr;
        padding:18px;
    }

    #personDialog .dialog-actions{
        padding:14px 18px 18px;
    }
}


/* =========================================================
   v11.23 — Arrival acknowledgement + mobile Clerk polish
   ========================================================= */

/* The legacy pink Clerk arrival banner is permanently retired on every viewport. */
#arrivalAlertBanner,
#clerkView #arrivalAlertBanner,
#clerkView .retired-arrival-banner{
    display:none!important;
}

/* NEW is now a deliberate acknowledgment pill, not a side effect of opening a card. */
.new-arrival-label.new-arrival-acknowledge{
    cursor:pointer;
    font:inherit;
    font-size:.72rem;
    font-weight:850;
    letter-spacing:.055em;
}
.new-arrival-label.new-arrival-acknowledge:hover,
.new-arrival-label.new-arrival-acknowledge:focus-visible{
    transform:translateY(-1px);
    outline:2px solid rgba(23,63,92,.18);
    outline-offset:2px;
}

/* Keep Clerk View page tools in the same upper-right position as other workspaces. */
@media(max-width:800px){
    #clerkView>.section-heading{
        padding-right:58px;
    }

    #clerkView .clerk-utility-actions{
        position:absolute!important;
        top:0!important;
        right:0!important;
        width:auto!important;
    }

    #clerkView .clerk-more-menu{
        left:auto!important;
        right:0!important;
    }
}


/* =========================================================
   v11.24 — Mobile Clerk and Court Check-In polish
   ========================================================= */
@media(max-width:800px){
    #clerkView > .section-heading{
        display:grid!important;
        grid-template-columns:minmax(0,1fr) 48px!important;
        align-items:start!important;
        gap:12px!important;
        width:100%!important;
        padding-right:0!important;
    }

    #clerkView > .section-heading > div:first-child{
        grid-column:1!important;
        min-width:0!important;
    }

    #clerkView .section-heading-actions.clerk-utility-actions{
        position:static!important;
        grid-column:2!important;
        grid-row:1!important;
        justify-self:end!important;
        align-self:start!important;
        width:44px!important;
        margin:0!important;
    }

    #clerkView .clerk-more-menu-wrap{
        position:relative!important;
        width:44px!important;
    }

    #clerkView .clerk-more-menu-button{
        width:44px!important;
        margin:0!important;
    }

    #clerkView .clerk-more-menu{
        left:auto!important;
        right:0!important;
    }

    #courtCheckInView .person-card .person-actions{
        display:grid!important;
        grid-template-columns:1fr!important;
        gap:8px!important;
        width:100%!important;
    }

    #courtCheckInView .person-card .person-actions > button{
        display:flex!important;
        align-items:center!important;
        justify-content:center!important;
        width:100%!important;
        min-width:0!important;
        min-height:48px!important;
        margin:0!important;
    }
}

/* v11.27 — Clerk Arrival Inbox */
.clerk-arrival-inbox-menu{position:absolute;right:116px;top:52px;width:min(390px,calc(100vw - 24px));max-height:480px;overflow:auto;background:#fff;border:1px solid #d9e2e8;border-radius:12px;box-shadow:0 18px 48px rgba(17,39,54,.18);z-index:13000;padding:8px}
.clerk-arrival-inbox-menu[hidden]{display:none!important}
.clerk-arrival-inbox-subtitle{display:block;margin-top:2px;color:#71818d;font-size:.72rem;font-weight:600}
.clerk-arrival-inbox-list{display:grid;gap:5px;padding-top:6px}
.clerk-arrival-inbox-item{width:100%;min-height:56px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px;border:0;border-radius:9px;background:#fff;color:#17212b;text-align:left;cursor:pointer}
.clerk-arrival-inbox-item:hover,.clerk-arrival-inbox-item:focus-visible{background:#eef6fb;outline:none}
.clerk-arrival-inbox-item:disabled{opacity:.6;cursor:wait}
.clerk-arrival-inbox-item-copy{min-width:0;display:flex;flex-direction:column;gap:3px}
.clerk-arrival-inbox-item-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.9rem}
.clerk-arrival-inbox-item-copy small{color:#71818d;font-size:.75rem}
.clerk-arrival-ack-pill{flex:0 0 auto;padding:5px 8px;border-radius:999px;background:#173f5c;color:#fff;font-size:.7rem;font-weight:800}
@media(max-width:760px){.clerk-arrival-inbox-menu{position:fixed;left:8px;right:8px;top:64px;width:auto;max-height:min(520px,calc(100dvh - 82px))}}


/* =========================================================
   v11.28 — Access-loading privacy, simpler Admin, swipe Messenger
   ========================================================= */

/* Prevent a non-admin account from briefly seeing Administrator UI on refresh. */
body.access-control-loading .app-header,
body.access-control-loading .main-navigation,
body.access-control-loading .app-main,
body.access-control-loading #accessPreviewBar{
    visibility:hidden!important;
}

body.access-control-loading{
    background:#f4f7f9;
}

/* Preview Role testing card was removed; permissions now use the available width. */
.role-permission-layout{
    grid-template-columns:minmax(0,1fr)!important;
}

.role-permission-card{
    width:100%;
    box-sizing:border-box;
}

/* Mobile swipe actions for Messenger conversations. */
.messenger-swipe-row{
    position:relative;
    overflow:hidden;
    background:#eef2f5;
}

.messenger-swipe-actions{
    position:absolute;
    inset:0 0 0 auto;
    width:152px;
    display:grid;
    grid-template-columns:76px 76px;
    align-items:stretch;
    justify-content:end;
}

.messenger-swipe-action{
    border:0;
    border-radius:0;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:4px;
    min-width:0;
    font:inherit;
    font-size:.72rem;
    font-weight:800;
    cursor:pointer;
}

.messenger-swipe-action.mute{
    background:#dbe7ef;
    color:#173f5c;
}

.messenger-swipe-action.delete{
    background:#9d332c;
    color:#fff;
}

.messenger-swipe-action .ce-icon,
.messenger-swipe-action svg{
    width:18px;
    height:18px;
}

.messenger-swipe-action.delete > span:first-child{
    font-size:1.55rem;
    line-height:.8;
}

.messenger-swipe-row .messenger-conversation-row{
    position:relative;
    z-index:1;
    transition:transform .18s ease;
    touch-action:pan-y;
}

.messenger-swipe-row.is-swiped .messenger-conversation-row{
    transform:translateX(-152px);
}

@media(min-width:761px){
    .messenger-swipe-actions{
        display:none!important;
    }

    .messenger-swipe-row.is-swiped .messenger-conversation-row{
        transform:none!important;
    }
}


/* =========================================================
   v11.29 — Officer View three-dot alignment and menu
   ========================================================= */

#officerView > .officer-field-heading{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:start!important;
    gap:16px!important;
    width:100%!important;
}

#officerView > .officer-field-heading > div:first-child{
    grid-column:1!important;
    min-width:0!important;
}

#officerView .officer-field-heading-actions{
    grid-column:2!important;
    justify-self:end!important;
    align-self:start!important;
    display:flex!important;
    align-items:center!important;
    gap:10px!important;
    margin-left:auto!important;
}

#officerView .officer-field-more-menu-wrap{
    position:relative!important;
}

#officerView #officerFieldMoreMenu{
    position:absolute!important;
    top:48px!important;
    right:0!important;
    left:auto!important;
    z-index:12000!important;
}

@media(max-width:800px){
    #officerView > .officer-field-heading{
        grid-template-columns:minmax(0,1fr) 46px!important;
        gap:12px!important;
    }

    #officerView .officer-field-heading-actions{
        width:46px!important;
        justify-content:flex-end!important;
    }

    #officerView .officer-field-status{
        display:none!important;
    }

    #officerView .officer-field-more-menu-wrap{
        width:44px!important;
        margin-left:auto!important;
    }

    #officerView #officerFieldMoreButton{
        width:44px!important;
        min-width:44px!important;
        height:44px!important;
        margin:0!important;
    }

    #officerView #officerFieldMoreMenu{
        right:0!important;
        left:auto!important;
        width:min(260px,calc(100vw - 24px))!important;
    }
}


/* =========================================================
   v11.30 — Court History detail scrolling + print control
   ========================================================= */

.clerk-workspace-dialog .court-history-browser{
    align-items:stretch!important;
    min-height:0!important;
}

.clerk-workspace-dialog .court-history-list-panel,
.clerk-workspace-dialog .court-history-detail-panel{
    min-height:0!important;
    max-height:100%!important;
}

.clerk-workspace-dialog .court-history-detail-panel{
    height:100%!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain;
    scrollbar-gutter:stable;
}

.clerk-workspace-dialog .court-history-list-panel{
    height:100%!important;
    display:flex;
    flex-direction:column;
}

.clerk-workspace-dialog .court-history-session-list{
    flex:1;
    min-height:0;
    max-height:none!important;
    overflow-y:auto;
}

.court-history-toolbar{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}

#printCourtHistoryButton:disabled{
    opacity:.5;
    cursor:not-allowed;
}


/* =========================================================
   v11.32 — Mobile Officer tools + Messenger usability
   ========================================================= */

@media(max-width:760px){
    /* Officer View tools must render above the workspace and stay tappable. */
    #officerView{
        overflow:visible!important;
    }

    #officerView > .officer-field-heading,
    #officerView .officer-field-heading-actions,
    #officerView .officer-field-more-menu-wrap{
        overflow:visible!important;
    }

    #officerView #officerFieldMoreButton{
        position:relative!important;
        z-index:12002!important;
        touch-action:manipulation!important;
        -webkit-tap-highlight-color:transparent;
    }

    #officerView #officerFieldMoreMenu{
        position:absolute!important;
        top:50px!important;
        right:0!important;
        left:auto!important;
        z-index:12003!important;
        pointer-events:auto!important;
    }

    /* Messenger: larger initial mobile window so conversations are visible. */
    #messagesPanel,
    .messenger-panel{
        position:fixed!important;
        left:8px!important;
        right:8px!important;
        top:72px!important;
        bottom:10px!important;
        width:auto!important;
        height:auto!important;
        max-width:none!important;
        max-height:none!important;
        border-radius:16px 16px 0 0!important;
    }

    #messagesPanel .messenger-shell{
        height:100%!important;
        min-height:0!important;
    }

    #messagesPanel .messenger-sidebar{
        min-height:0!important;
    }

    #messagesPanel #conversationList{
        min-height:180px!important;
        overflow-y:auto!important;
        -webkit-overflow-scrolling:touch;
    }

    .messenger-swipe-actions{
        width:164px!important;
        grid-template-columns:82px 82px!important;
    }

    .messenger-swipe-row.is-swiped .messenger-conversation-row{
        transform:translateX(-164px)!important;
    }

    .messenger-swipe-row .messenger-conversation-row{
        touch-action:pan-y!important;
        -webkit-user-select:none;
        user-select:none;
    }
}


/* =========================================================
   v11.33 — reliable Officer tools, swipe actions, Messenger size
   ========================================================= */

#officerFieldMoreMenu:not([hidden]){
    display:block!important;
    visibility:visible!important;
    pointer-events:auto!important;
}

@media(max-width:760px){
    #officerFieldMoreMenu:not([hidden]){
        position:fixed!important;
        z-index:25000!important;
    }

    .messenger-swipe-row{
        position:relative!important;
        overflow:hidden!important;
    }

    .messenger-swipe-actions{
        position:absolute!important;
        top:0!important;
        right:0!important;
        bottom:0!important;
        width:168px!important;
        display:grid!important;
        grid-template-columns:84px 84px!important;
        z-index:0!important;
    }

    .messenger-swipe-row .messenger-conversation-row{
        position:relative!important;
        z-index:1!important;
        background:#fff!important;
        touch-action:pan-y!important;
        will-change:transform;
    }

    .messenger-swipe-row.is-swiped .messenger-conversation-row{
        transform:translate3d(-168px,0,0)!important;
    }
}

@media(min-width:761px){
    .messages-panel.messenger-shell{
        width:min(980px,calc(100vw - 32px));
        height:min(680px,calc(100vh - 32px));
        min-width:760px;
        min-height:520px;
    }

    .messenger-sidebar{
        min-width:310px;
    }
}


/* =========================================================
   v11.34 — iPhone-style CourtEntry Messenger on mobile
   Behavior model: list -> conversation -> back to list.
   Only the list screen has Done; no X in a conversation.
   ========================================================= */

.messenger-mobile-list-title,
.messenger-mobile-done-button,
.messenger-mobile-back-label{
    display:none;
}

@media(max-width:760px){
    body:has(#messagesPanel.is-open){
        overflow:hidden!important;
    }

    #messagesPanel.messages-panel{
        position:fixed!important;
        inset:0!important;
        width:100%!important;
        height:100%!important;
        max-width:none!important;
        max-height:none!important;
        min-width:0!important;
        min-height:0!important;
        margin:0!important;
        border:0!important;
        border-radius:0!important;
        box-shadow:none!important;
        background:#f5f5f7!important;
        z-index:30000!important;
        resize:none!important;
    }

    #messagesPanel .ce-window-resize-handle{
        display:none!important;
    }

    #messagesPanel .messenger-topbar{
        position:relative!important;
        height:58px!important;
        min-height:58px!important;
        display:flex!important;
        align-items:center!important;
        justify-content:center!important;
        padding:0 14px!important;
        border-bottom:1px solid #d9d9dd!important;
        background:rgba(249,249,251,.96)!important;
        cursor:default!important;
    }

    #messagesPanel .messenger-desktop-title,
    #messagesPanel #closeMessagesPanelButton{
        display:none!important;
    }

    #messagesPanel .messenger-mobile-list-title{
        display:block!important;
        font-size:1.05rem!important;
        line-height:1!important;
        color:#111!important;
    }

    #messagesPanel .messenger-mobile-done-button{
        display:block!important;
        position:absolute!important;
        right:14px!important;
        top:7px!important;
        min-width:54px!important;
        min-height:44px!important;
        padding:0 8px!important;
        border:0!important;
        background:transparent!important;
        color:#1976d2!important;
        font:inherit!important;
        font-size:1rem!important;
        font-weight:600!important;
    }

    #messagesPanel .messenger-layout{
        display:block!important;
        height:calc(100% - 58px)!important;
        min-height:0!important;
        background:#fff!important;
    }

    #messagesPanel .messenger-sidebar{
        display:flex!important;
        flex-direction:column!important;
        width:100%!important;
        height:100%!important;
        min-width:0!important;
        border:0!important;
        background:#fff!important;
    }

    #messagesPanel .messenger-sidebar-heading{
        min-height:54px!important;
        padding:6px 18px 4px!important;
        display:flex!important;
        align-items:center!important;
        justify-content:space-between!important;
        border:0!important;
        background:#fff!important;
    }

    #messagesPanel .messenger-sidebar-heading-label{
        font-size:1.8rem!important;
        line-height:1!important;
        letter-spacing:-.02em!important;
        color:#111!important;
    }

    #messagesPanel .messenger-compose-button{
        width:44px!important;
        height:44px!important;
        border:0!important;
        background:transparent!important;
        color:#1976d2!important;
    }

    #messagesPanel .messenger-search{
        margin:4px 14px 8px!important;
        padding:0!important;
    }

    #messagesPanel .messenger-search input{
        width:100%!important;
        min-height:38px!important;
        padding:8px 12px!important;
        border:0!important;
        border-radius:11px!important;
        background:#eeeeef!important;
        font-size:16px!important;
    }

    #messagesPanel #conversationList{
        flex:1!important;
        min-height:0!important;
        overflow-y:auto!important;
        -webkit-overflow-scrolling:touch!important;
        padding:0 0 18px!important;
        background:#fff!important;
    }

    #messagesPanel .messenger-swipe-row{
        border-bottom:1px solid #e5e5e7!important;
        background:#fff!important;
    }

    #messagesPanel .messenger-conversation-row{
        min-height:76px!important;
        padding:10px 14px!important;
        border:0!important;
        border-radius:0!important;
        background:#fff!important;
        box-shadow:none!important;
        display:grid!important;
        grid-template-columns:50px minmax(0,1fr) auto!important;
        align-items:center!important;
        gap:10px!important;
    }

    #messagesPanel .messenger-conversation-row.active{
        background:#fff!important;
    }

    #messagesPanel .messenger-avatar{
        width:48px!important;
        height:48px!important;
        font-size:1.05rem!important;
        border-radius:50%!important;
    }

    #messagesPanel .messenger-conversation-copy strong{
        font-size:1rem!important;
        color:#111!important;
    }

    #messagesPanel .messenger-conversation-copy small{
        margin-top:3px!important;
        display:-webkit-box!important;
        -webkit-line-clamp:2!important;
        -webkit-box-orient:vertical!important;
        overflow:hidden!important;
        color:#75757a!important;
        line-height:1.2!important;
    }

    #messagesPanel .messenger-conversation-meta{
        align-self:start!important;
        padding-top:3px!important;
        color:#8e8e93!important;
    }

    /* iPhone list relies on swipe; remove competing three-dot/long-press cue. */
    #messagesPanel .messenger-row-menu-button{
        display:none!important;
    }

    /* Conversation becomes the whole Messenger screen. */
    #messagesPanel .messenger-chat{
        display:none!important;
        position:absolute!important;
        inset:58px 0 0!important;
        width:100%!important;
        height:auto!important;
        min-width:0!important;
        background:#fff!important;
    }

    #messagesPanel.mobile-chat-open .messenger-sidebar{
        display:none!important;
    }

    #messagesPanel.mobile-chat-open .messenger-chat{
        display:block!important;
    }

    #messagesPanel.mobile-chat-open .messenger-mobile-list-title,
    #messagesPanel.mobile-chat-open .messenger-mobile-done-button{
        visibility:hidden!important;
        pointer-events:none!important;
    }

    #messagesPanel .messenger-empty-state{
        display:none!important;
    }

    #messagesPanel .messenger-conversation-view{
        height:100%!important;
        min-height:0!important;
        display:grid!important;
        grid-template-rows:auto minmax(0,1fr) auto auto!important;
        background:#fff!important;
    }

    #messagesPanel .messenger-conversation-view[hidden]{
        display:none!important;
    }

    #messagesPanel .messenger-chat-header{
        min-height:58px!important;
        padding:4px 12px!important;
        display:grid!important;
        grid-template-columns:minmax(94px,1fr) minmax(0,2fr) minmax(94px,1fr)!important;
        align-items:center!important;
        border-bottom:1px solid #e3e3e6!important;
        background:rgba(249,249,251,.96)!important;
    }

    #messagesPanel .messenger-mobile-back-button{
        display:flex!important;
        align-items:center!important;
        justify-content:flex-start!important;
        gap:2px!important;
        width:auto!important;
        min-width:94px!important;
        min-height:44px!important;
        padding:0!important;
        border:0!important;
        background:transparent!important;
        color:#1976d2!important;
        font-size:1rem!important;
    }

    #messagesPanel .messenger-mobile-back-icon{
        font-size:2.15rem!important;
        line-height:.8!important;
        font-weight:300!important;
        transform:translateY(-1px);
    }

    #messagesPanel .messenger-mobile-back-label{
        display:inline!important;
    }

    #messagesPanel .messenger-chat-header-copy{
        grid-column:2!important;
        min-width:0!important;
        text-align:center!important;
    }

    #messagesPanel .messenger-chat-header-copy strong{
        display:block!important;
        overflow:hidden!important;
        text-overflow:ellipsis!important;
        white-space:nowrap!important;
        color:#111!important;
        font-size:.98rem!important;
    }

    #messagesPanel .messenger-chat-header-copy span{
        display:block!important;
        overflow:hidden!important;
        text-overflow:ellipsis!important;
        white-space:nowrap!important;
        color:#8e8e93!important;
        font-size:.72rem!important;
    }

    #messagesPanel .messenger-message-stream{
        min-height:0!important;
        overflow-y:auto!important;
        -webkit-overflow-scrolling:touch!important;
        padding:12px 10px 16px!important;
        background:#fff!important;
    }

    #messagesPanel .messenger-message{
        max-width:82%!important;
        margin-bottom:7px!important;
    }

    #messagesPanel .messenger-bubble{
        border-radius:18px!important;
        padding:8px 12px!important;
        box-shadow:none!important;
    }

    #messagesPanel .messenger-message.mine .messenger-bubble{
        background:#1976d2!important;
        color:#fff!important;
    }

    #messagesPanel .messenger-message.theirs .messenger-bubble{
        background:#e9e9eb!important;
        color:#111!important;
    }

    #messagesPanel .message-typing-indicator{
        padding:4px 12px!important;
        background:#fff!important;
    }

    #messagesPanel .messenger-composer{
        min-height:58px!important;
        padding:7px 8px calc(7px + env(safe-area-inset-bottom))!important;
        display:grid!important;
        grid-template-columns:40px minmax(0,1fr) 40px!important;
        align-items:end!important;
        gap:6px!important;
        border-top:1px solid #e5e5e7!important;
        background:#fafafa!important;
    }

    #messagesPanel .messenger-attachment-selection{
        grid-column:1/-1!important;
    }

    #messagesPanel .messenger-attach-button{
        width:38px!important;
        height:38px!important;
        border-radius:50%!important;
        border:0!important;
        background:#e9e9eb!important;
    }

    #messagesPanel #messageText{
        min-height:38px!important;
        max-height:112px!important;
        padding:8px 12px!important;
        border:1px solid #d2d2d6!important;
        border-radius:19px!important;
        background:#fff!important;
        font-size:16px!important;
        line-height:1.25!important;
        resize:none!important;
    }

    #messagesPanel .messenger-send-button{
        width:38px!important;
        min-width:38px!important;
        height:38px!important;
        min-height:38px!important;
        padding:0!important;
        border-radius:50%!important;
        display:flex!important;
        align-items:center!important;
        justify-content:center!important;
    }

    #messagesPanel .messenger-send-button span:last-child{
        display:none!important;
    }

    /* Swipe actions mirror the familiar iPhone list gesture. */
    #messagesPanel .messenger-swipe-actions{
        width:168px!important;
        grid-template-columns:84px 84px!important;
    }

    #messagesPanel .messenger-swipe-action{
        font-size:.74rem!important;
    }

    #messagesPanel .messenger-swipe-action.mute{
        background:#8e8e93!important;
        color:#fff!important;
    }

    #messagesPanel .messenger-swipe-action.delete{
        background:#d63a31!important;
        color:#fff!important;
    }

    #messagesPanel .messenger-swipe-row.is-swiped .messenger-conversation-row{
        transform:translate3d(-168px,0,0)!important;
    }
}

@media(max-width:760px){
    #newConversationDialog.messenger-new-dialog{
        position:fixed!important;
        inset:0!important;
        width:100%!important;
        height:100%!important;
        max-width:none!important;
        max-height:none!important;
        margin:0!important;
        border-radius:0!important;
        z-index:31000!important;
        background:#fff!important;
    }

    #newConversationDialog .messenger-new-conversation-form{
        height:100%!important;
        display:flex!important;
        flex-direction:column!important;
    }

    #newConversationDialog .messenger-new-header{
        min-height:58px!important;
        padding:6px 12px!important;
        display:grid!important;
        grid-template-columns:80px 1fr 80px!important;
        align-items:center!important;
        border-bottom:1px solid #e5e5e7!important;
    }

    #newConversationDialog .messenger-new-header > div{
        grid-column:2!important;
        text-align:center!important;
    }

    #newConversationDialog .messenger-new-header h2{
        margin:0!important;
        font-size:1rem!important;
    }

    #newConversationDialog #closeNewConversationDialogButton{
        grid-column:1!important;
        width:auto!important;
        justify-self:start!important;
    }

    #newConversationDialog .messenger-recipient-search,
    #newConversationDialog .messenger-selected-people,
    #newConversationDialog .messenger-group-name-field,
    #newConversationDialog .messenger-people-label{
        margin-left:14px!important;
        margin-right:14px!important;
    }

    #newConversationDialog .messenger-user-picker{
        flex:1!important;
        min-height:0!important;
        overflow-y:auto!important;
        -webkit-overflow-scrolling:touch!important;
    }
}

.audit-log-filters{display:grid;grid-template-columns:1.2fr 1.5fr 1fr 1fr;gap:12px;margin:16px 0 12px}
.audit-log-summary{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 12px;border-bottom:1px solid #dfe3e8}
.audit-log-summary span{color:#667085;font-size:.88rem}
.audit-log-list{max-height:620px;overflow:auto;border:1px solid #dfe3e8;border-radius:12px;background:#fff}
.audit-log-entry{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;padding:13px 14px;border-bottom:1px solid #edf0f2}
.audit-log-entry:last-child{border-bottom:0}.audit-log-entry-main{min-width:0}
.audit-log-entry-main>strong,.audit-log-entry-main>span{display:block}
.audit-log-entry-main>span,.audit-log-entry>time{margin-top:3px;color:#667085;font-size:.84rem}
.audit-log-entry>time{white-space:nowrap}.audit-log-details{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:7px;color:#475467;font-size:.8rem}
@media(max-width:760px){.audit-log-filters{grid-template-columns:1fr 1fr}.audit-log-entry{grid-template-columns:1fr;gap:5px}}

/* v11.41 — Clerk current-arrival checkpoint photographs */
.clerk-arrival-summary-row{display:flex;align-items:flex-start;gap:12px;min-width:0}
.clerk-arrival-summary-row>.clerk-card-summary{flex:1;min-width:0}
.clerk-arrival-photo{width:72px;height:90px;flex:0 0 72px;object-fit:cover;object-position:center;border-radius:10px;border:1px solid #d8dee8;background:#eef2f6}
@media(max-width:620px){.clerk-arrival-photo{width:60px;height:75px;flex-basis:60px}}


/* v11.46 — larger Court History default + linked off-docket witnesses */
#courtHistoryDialog.court-history-dialog{
    width:min(1440px,calc(100vw - 48px));
    height:min(920px,calc(100vh - 48px));
    min-width:min(1000px,calc(100vw - 16px));
    min-height:min(650px,calc(100vh - 16px));
}
.linked-witness-section{
    margin:14px 0 0;
    padding:12px;
    border:1px solid #d7e1e8;
    border-radius:12px;
    background:#f7fafc;
}
.linked-witness-heading{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
    color:#324b5f;
    font-size:.9rem;
}
.linked-witness-heading span{
    min-width:26px;
    height:26px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    background:#e8f0f5;
    font-weight:800;
}
.linked-witness-section .linked-witness-card{
    margin:8px 0 0;
    border-left:4px solid #214f6d;
    background:#fff;
    box-shadow:none;
}
.linked-witness-section .linked-witness-card:first-of-type{margin-top:0;}
@media(max-width:760px){
    #courtHistoryDialog.court-history-dialog{width:calc(100vw - 16px)!important;height:calc(100vh - 16px)!important;}
}


/* =========================================================
   v11.48 — Officer View tool-dialog presentation repair
   Panels moved into the Officer View modal must retain the same
   polished NCIC / Records workspace context they use normally.
   ========================================================= */
#officerHotListDialog{
    width:min(1180px,calc(100vw - 32px));
    min-width:min(760px,calc(100vw - 32px));
    min-height:520px;
    max-width:calc(100vw - 16px);
    max-height:calc(100vh - 16px);
    padding:0;
    overflow:hidden;
}
#officerHotListDialog .ce-dialog-titlebar{
    position:sticky;
    top:0;
    z-index:5;
    background:#fff;
}
#officerHotListDialogBody.officer-tool-dialog-workspace{
    box-sizing:border-box;
    width:100%;
    max-width:none;
    margin:0;
    padding:22px 24px 28px;
    overflow:auto;
    max-height:calc(100vh - 150px);
}
#officerHotListDialogBody.officer-tool-dialog-workspace .alert-hub-panel{
    box-sizing:border-box;
    width:100%;
    max-width:none;
    margin:0;
}
#officerHotListDialogBody.officer-tool-dialog-workspace .alert-subheading,
#officerHotListDialogBody.officer-tool-dialog-workspace .admin-panel-heading{
    width:100%;
}
#officerHotListDialogBody.officer-tool-dialog-workspace .active-alert-toolbar{
    width:100%;
}
@media(max-width:800px){
    #officerHotListDialog{
        min-width:0;
        width:calc(100vw - 12px);
        max-width:calc(100vw - 12px);
        min-height:min(620px,calc(100vh - 12px));
    }
    #officerHotListDialogBody.officer-tool-dialog-workspace{
        padding:14px;
        max-height:calc(100vh - 130px);
    }
    #officerHotListDialogBody.officer-tool-dialog-workspace .alert-hub-panel{
        padding:18px 16px 22px;
    }
    #officerHotListDialogBody.officer-tool-dialog-workspace .active-alert-toolbar{
        grid-template-columns:1fr;
    }
}

/* =========================================================
   v11.55 — Panic control in global blue header
   Presentation only: legacy workspace launchers remain wired
   but are never displayed while the header control is active.
   ========================================================= */
.panic-launch-button {
    display: none !important;
}

.header-panic-button {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 13px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 10px;
    background: #b42318;
    color: #fff;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .20);
    white-space: nowrap;
}

.header-panic-button:hover {
    background: #982018;
}

.header-panic-button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.header-panic-button[hidden] {
    display: none !important;
}

.header-panic-button > span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}

@media (max-width: 760px) {
    .header-panic-button {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        padding: 0;
        border-radius: 10px;
        flex: 0 0 40px;
    }

    .header-panic-label {
        display: none;
    }
}

/* =========================================================
   v11.57 — Off-docket visitor / accompanying-person workflow
   ========================================================= */
.off-docket-recent-wrap {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
}

.off-docket-helper-label {
    color: #5f6b7a;
    font-weight: 700;
}

.off-docket-recent-people {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.off-docket-recent-person {
    appearance: none;
    border: 1px solid #b9c6d6;
    background: #f7f9fc;
    color: #17365d;
    border-radius: 999px;
    padding: 6px 10px;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
}

.off-docket-recent-person:hover,
.off-docket-recent-person:focus-visible {
    border-color: #6b86a8;
    background: #edf3fa;
    outline: none;
}

.off-docket-create-link {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border: 1px dashed #b9c6d6;
    border-radius: 10px;
    background: #fafbfd;
}

.off-docket-create-link > small {
    color: #5f6b7a;
    line-height: 1.35;
}

.off-docket-create-link-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(125px, 0.7fr) auto;
    gap: 8px;
    align-items: end;
}

@media (max-width: 760px) {
    .off-docket-create-link-grid {
        grid-template-columns: 1fr 1fr;
    }

    .off-docket-create-link-grid .secondary-button {
        width: 100%;
    }
}

/* =========================================================
   v11.58 — Case-link workflow + Clerk off-docket grouping
   ========================================================= */
.off-docket-link-panel {
    min-width: 0;
}

.off-docket-create-link-grid,
.off-docket-create-link-grid-witness {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.off-docket-create-link-grid label {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.off-docket-create-link-grid label > span {
    color: #4f5f72;
    font-size: 0.78rem;
    font-weight: 700;
}

.off-docket-create-link-grid input,
.off-docket-create-link-grid select,
.off-docket-create-link-grid button {
    width: 100%;
    min-width: 0;
}

.off-docket-create-link-grid .secondary-button {
    min-height: 42px;
}

.clerk-off-docket-related {
    display: grid;
    gap: 7px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #d8e1ea;
}

.clerk-off-docket-related-heading {
    color: #526274;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.clerk-off-docket-related-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid #d9e2ec;
    border-radius: 9px;
    background: #fff;
}

.clerk-off-docket-related-row > div:first-child {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;
}

.clerk-related-role {
    color: #5c6b7a;
    font-size: 0.86rem;
}

.clerk-related-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.not-on-docket-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff1c7;
    border: 1px solid #e4c76a;
    color: #785700;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.025em;
}

.clerk-related-checkin {
    color: #18324d;
    font-size: 0.82rem;
    font-weight: 700;
}

.clerk-related-checkin.muted {
    color: #6b7785;
    font-weight: 600;
}

@media (max-width: 760px) {
    .off-docket-create-link-grid,
    .off-docket-create-link-grid-witness {
        grid-template-columns: 1fr;
    }

    .clerk-off-docket-related-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .clerk-related-meta {
        justify-content: flex-start;
    }
}


/* =========================================================
   v11.59 — Compact off-docket linking + direct primary action
   ========================================================= */
#offDocketDialog {
    max-height: calc(100vh - 32px);
}

#offDocketDialog > form {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

#offDocketDialog .off-docket-link-panel > input[type="search"],
#offDocketLinkedDefendantField > input[type="search"] {
    margin-top: 0;
}

#offDocketWitnessDefendantId,
#offDocketLinkedDefendantId {
    width: 100%;
    min-height: 150px;
    max-height: 190px;
    margin-top: 7px;
    border: 1px solid #c9d5df;
    border-radius: 9px;
    background: #fff;
}

#offDocketWitnessDefendantId optgroup,
#offDocketLinkedDefendantId optgroup {
    font-weight: 800;
    color: #17365d;
}

#offDocketWitnessDefendantId option,
#offDocketLinkedDefendantId option {
    padding: 4px 7px;
    color: #172b3a;
}

#offDocketDialog .off-docket-create-link {
    margin-top: 8px;
    padding: 9px;
}

#offDocketDialog .off-docket-create-link-grid {
    gap: 7px;
}

.checkin-add-offdocket-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 13px;
    font-weight: 750;
    white-space: nowrap;
}

.checkin-add-offdocket-button .ce-icon {
    width: 18px;
    height: 18px;
}

@media (max-width: 700px) {
    #courtCheckInView > .section-heading .section-heading-actions {
        flex-wrap: wrap;
    }

    .checkin-add-offdocket-button {
        flex: 1 1 auto;
    }
}


/* =========================================================
   v11.60 — compact off-duty person workflow + correction tools
   ========================================================= */
#offDocketDialog {
    width: min(720px, calc(100vw - 28px));
    max-width: 720px;
}

#offDocketDialog > form {
    max-height: calc(100vh - 28px);
    overflow: hidden;
}

#offDocketDialog .dialog-heading {
    padding: 18px 22px 15px;
}

#offDocketDialog .admin-form-grid.off-docket-compact-grid {
    padding: 18px 22px 10px;
    gap: 14px 18px;
    max-height: calc(100vh - 210px);
    overflow-y: auto;
    align-items: start;
}

#offDocketDialog .off-docket-full-row {
    grid-column: 1 / -1;
}

#offDocketDialog .form-field {
    min-width: 0;
}

#offDocketDialog .form-field > span {
    font-weight: 700;
}

#offDocketDialog .form-field input,
#offDocketDialog .form-field select {
    width: 100%;
    box-sizing: border-box;
}

#offDocketWitnessDefendantId,
#offDocketLinkedDefendantId {
    min-height: 112px;
    max-height: 136px;
    margin-top: 6px;
}

#offDocketDialog .text-action-button {
    align-self: flex-start;
    margin-top: 6px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: #17496b;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

#offDocketDialog .text-action-button:hover,
#offDocketDialog .text-action-button:focus-visible {
    text-decoration: underline;
}

#offDocketDialog .compact-create-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(125px, auto) auto;
    gap: 8px;
    align-items: end;
    margin-top: 7px;
    padding: 9px;
}

#offDocketDialog .compact-create-link[hidden] {
    display: none !important;
}

#offDocketDialog .compact-inline-field {
    display: grid;
    gap: 4px;
    min-width: 0;
}

#offDocketDialog .compact-inline-field > span {
    color: #526274;
    font-size: .76rem;
    font-weight: 700;
}

#offDocketDialog .compact-role-field {
    max-width: 150px;
}

#offDocketDialog .dialog-actions {
    padding: 13px 22px 16px;
}

.remove-court-entry-button {
    color: #8a2222;
    border-color: #d7aaaa;
}

@media (max-width: 700px) {
    #offDocketDialog .admin-form-grid.off-docket-compact-grid {
        grid-template-columns: 1fr;
        max-height: calc(100vh - 230px);
    }
    #offDocketDialog .off-docket-full-row {
        grid-column: 1;
    }
    #offDocketDialog .compact-create-link {
        grid-template-columns: 1fr;
    }
    #offDocketDialog .compact-role-field {
        max-width: none;
    }
}
