/* Shared screen controls. Document/PDF layouts and calculations are not changed. */
@media screen {
    html body .workspace-ui {
        --control-gap: 12px;
        line-height: 1.55;
    }
    html body .workspace-ui :is(.panel, .card, .field, form, .formgrid) {
        min-width: 0;
        box-sizing: border-box;
    }
    html body .workspace-ui :is(.btn, button:not(.app-overlay), summary.action-toggle) {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-height: 44px !important;
        max-width: 100%;
        padding: 10px 14px !important;
        border: 1px solid #153e56 !important;
        border-radius: 9px !important;
        background: #153e56 !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        font-size: 13px !important;
        font-weight: 650;
        line-height: 1.4 !important;
        white-space: normal;
        word-break: normal;
        overflow-wrap: normal;
        box-sizing: border-box;
        text-align: center;
        vertical-align: middle;
        text-decoration: none !important;
    }
    html body .workspace-ui :is(.btn, button):hover {
        background: #0e2d40 !important;
        border-color: #0e2d40 !important;
    }
    html body .workspace-ui :is(.btn, button):focus-visible {
        outline: 3px solid #65b9e3;
        outline-offset: 3px;
    }
    html body .workspace-ui :is(.actions, .quick, .workspace-button-row) {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--control-gap) !important;
    }
    html body .workspace-ui :is(.actions, .quick, .workspace-button-row) > .btn {
        margin: 0 !important;
    }
    html body .workspace-ui :is(.actions, .quick) > form {
        margin: 0 !important;
        min-width: 0;
    }
    html body .workspace-ui .field {
        gap: 7px;
        min-width: 0;
    }
    html body .workspace-ui .field > label {
        line-height: 1.45;
        word-break: normal;
        overflow-wrap: normal;
    }
    html
        body
        .workspace-ui
        :is(
            input:not([type='checkbox']):not([type='radio']):not([type='hidden']),
            select,
            textarea
        ) {
        box-sizing: border-box;
        max-width: 100%;
        min-width: 0;
        line-height: 1.45;
    }
    html
        body
        .workspace-ui
        :is(input:not([type='checkbox']):not([type='radio']):not([type='hidden']), select) {
        min-height: 44px;
    }
    html body .workspace-ui form > .field + :is(.btn, button, .actions),
    html
        body
        .workspace-ui
        form
        > :is(input:not([type='hidden']), select, textarea)
        + :is(.btn, button) {
        margin-top: 14px !important;
    }
    html body .workspace-ui form > .field + .field {
        margin-top: 14px;
    }
    html body .workspace-ui form > .formgrid + .field {
        margin-top: 14px;
    }
    html body .workspace-ui .workspace-check {
        display: flex !important;
        align-items: center !important;
        gap: 9px !important;
        margin: 12px 0 !important;
        line-height: 1.5;
    }
    html body .workspace-ui .workspace-check input {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px;
        margin: 0 !important;
        flex: 0 0 18px;
    }
    html body .workspace-ui form + form {
        margin-top: 20px;
    }
    /* Multi-field GET forms are grids, never a single shrinking flex row. */
    html body .workspace-ui .workspace-filter-grid {
        display: block !important;
        max-width: 100%;
    }
    html body .workspace-ui .workspace-filter-grid > .formgrid {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
        gap: 16px !important;
        align-items: end;
    }
    html body .workspace-ui .workspace-filter-grid .field {
        width: auto !important;
        max-width: none;
        min-width: 0;
        margin: 0;
        align-self: stretch;
    }
    html body .workspace-ui .workspace-filter-grid .field > :is(input, select) {
        margin-top: auto;
    }
    html body .workspace-ui .workspace-filter-grid > .field {
        margin-top: 16px;
    }
    html body .workspace-ui .workspace-filter-grid > .actions {
        margin: 16px 0 0 !important;
        display: flex;
        flex-wrap: wrap;
    }
    /* One select with its action stays together, and can wrap on very narrow screens. */
    html body .workspace-ui .workspace-inline-filter {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: flex-end;
        gap: 12px !important;
    }
    html body .workspace-ui .workspace-inline-filter > .field {
        flex: 1 1 180px;
        max-width: 540px;
    }
    html body .workspace-ui .workspace-inline-filter > .btn,
    html body .workspace-ui .workspace-inline-filter > .actions {
        margin: 0 !important;
        flex: 0 0 auto;
    }
    html body .workspace-ui .workspace-inline-filter > .field + :is(.btn, button, .actions) {
        margin-top: 0 !important;
    }
    html body .workspace-ui .workspace-action-buttons {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end;
        gap: 10px !important;
    }
    html body .workspace-ui .workspace-action-buttons :is(.btn, form) {
        flex: 0 0 auto;
        width: auto !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }
    html body .workspace-ui .workspace-phone-cell {
        min-width: 150px !important;
        white-space: nowrap !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
    }
    html body .workspace-ui a[href^='tel:'],
    html body .workspace-ui a[href*='wa.me/'],
    html body .workspace-ui a[href*='api.whatsapp.com/'] {
        white-space: nowrap !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        min-width: max-content;
        max-width: none;
    }
    html body .workspace-ui .workspace-calendar-nav {
        display: grid !important;
        grid-template-columns: auto minmax(120px, 1fr) auto auto;
        align-items: center !important;
    }
    html body .workspace-ui .workspace-calendar-nav > strong {
        text-align: center;
    }
}
@media screen and (max-width: 760px) {
    html body .workspace-ui {
        width: 100%;
        max-width: 100%;
        padding: 18px 0 28px !important;
        font-size: 14px;
    }
    html body .workspace-ui .panel {
        padding: 16px !important;
        margin-bottom: 16px !important;
        border-radius: 14px !important;
    }
    html body .workspace-ui .head {
        align-items: stretch !important;
        gap: 12px;
    }
    html body .workspace-ui h1 {
        font-size: 23px !important;
        line-height: 1.3;
    }
    html body .workspace-ui h2 {
        font-size: 17px !important;
        line-height: 1.4;
        margin-bottom: 16px;
    }
    html body .workspace-ui .field label {
        font-size: 12px !important;
    }
    html
        body
        .workspace-ui
        :is(
            input:not([type='checkbox']):not([type='radio']):not([type='hidden']),
            select,
            textarea
        ) {
        font-size: 16px !important;
    }
    html body .workspace-ui :is(.quick, .workspace-button-row) {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px !important;
        align-items: stretch !important;
        width: 100% !important;
    }
    html body .workspace-ui :is(.quick, .workspace-button-row) > * {
        min-width: 0;
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0 !important;
    }
    html body .workspace-ui :is(.quick, .workspace-button-row) > .btn,
    html body .workspace-ui .quick > form > .btn {
        width: 100% !important;
        height: 100%;
        min-height: 44px !important;
        padding: 10px !important;
        font-size: 12px !important;
    }
    html body .workspace-ui .actions {
        gap: 12px !important;
        align-items: stretch;
    }
    html body .workspace-ui .actions > .btn {
        flex: 0 1 auto;
    }
    html body .workspace-ui .workspace-filter-grid > .formgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 16px 12px !important;
    }
    html
        body
        .workspace-ui
        .workspace-filter-grid
        .formgrid
        > .field:first-child:has(input[name='q']) {
        grid-column: 1/-1;
    }
    html body .workspace-ui .workspace-filter-grid .field label {
        min-height: 0;
        overflow-wrap: normal;
    }
    html body .workspace-ui .workspace-filter-grid > .actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
    html body .workspace-ui .workspace-filter-grid > .actions > .btn {
        width: 100%;
    }
    html body .workspace-ui .workspace-inline-filter > .field {
        flex-basis: 160px;
    }
    html body .workspace-ui .friendly-list-caption {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
        white-space: normal;
        line-height: 1.5;
        padding-bottom: 14px;
        overflow-wrap: normal;
    }
    html body .workspace-ui table:has(.workspace-phone-cell) {
        table-layout: auto !important;
        min-width: 800px !important;
    }
    html body .workspace-ui table:has(.workspace-phone-cell) :is(th, td) {
        width: auto !important;
    }
    html body .workspace-ui .workspace-action-cell {
        position: static !important;
        box-shadow: none !important;
        width: 1% !important;
    }
    html body .workspace-ui .workspace-action-cell :is(.btn, .team-action-select) {
        min-width: 100px;
        white-space: nowrap !important;
    }
    html body .workspace-ui .workspace-calendar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    html body .workspace-ui .workspace-calendar-nav > strong {
        grid-column: 1/-1;
        grid-row: 1;
        font-size: 16px;
        padding-bottom: 2px;
    }
    html body .workspace-ui .workspace-calendar-nav > .btn:last-child {
        grid-column: 1/-1;
    }
    html body .workspace-ui .supplier-month-grid {
        gap: 4px;
    }
    html body .workspace-ui .supplier-calendar-day {
        min-width: 0;
    }
    html body .workspace-ui .friendly-jump {
        padding: 12px;
        gap: 7px;
    }
    html body .workspace-ui .friendly-jump select {
        width: 100%;
        max-width: 100%;
    }
}
@media screen and (max-width: 359px) {
    html body .workspace-ui .workspace-filter-grid > .formgrid {
        grid-template-columns: 1fr !important;
    }
    html body .workspace-ui :is(.quick, .workspace-button-row) {
        grid-template-columns: 1fr;
    }
}
@media screen {
    html body .workspace-ui .quick + .quick {
        margin-top: 12px !important;
    }
    html body .workspace-ui .pc-stay-heading {
        display: flex !important;
        justify-content: space-between !important;
        text-align: left !important;
        width: 100%;
    }
    html body .workspace-ui .btn :is(span, strong, small) {
        color: inherit !important;
        -webkit-text-fill-color: inherit !important;
    }
}

/* Unified fields, dropdowns and disclosure panels, 17 Oct revision 3. */
@media screen {
    html body :is(.workspace-ui, .login-wrap) {
        --ui-radius: 9px;
        --ui-field-height: 44px;
        --ui-field-border: var(--field-border, #d8dde3);
    }
    html
        body
        :is(.workspace-ui, .login-wrap)
        :is(
            input:not([type='hidden']):not([type='checkbox']):not([type='radio']),
            select,
            textarea
        ) {
        border: 1px solid var(--ui-field-border) !important;
        border-radius: var(--ui-radius) !important;
        background-color: var(--surface, #fff) !important;
        color: var(--ink, #17212b) !important;
        -webkit-text-fill-color: var(--ink, #17212b);
        padding: 10px 12px;
        box-shadow: none;
        outline: none;
        min-height: var(--ui-field-height);
        font-family: inherit;
        line-height: 1.45;
        box-sizing: border-box;
    }
    html body :is(.workspace-ui, .login-wrap) select:not([multiple]):not([size]) {
        appearance: none;
        -webkit-appearance: none;
        padding-right: 36px !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2375808d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
        background-repeat: no-repeat !important;
        background-position: right 12px center !important;
        background-size: 16px !important;
        cursor: pointer;
    }
    html body :is(.workspace-ui, .login-wrap) select[multiple],
    html body :is(.workspace-ui, .login-wrap) select[size] {
        min-height: 90px;
        background-image: none !important;
    }
    html body :is(.workspace-ui, .login-wrap) select option {
        background: var(--surface, #fff);
        color: var(--ink, #17212b);
    }
    html body :is(.workspace-ui, .login-wrap) textarea {
        width: 100%;
        min-height: 100px;
        resize: vertical;
    }
    html body :is(.workspace-ui, .login-wrap) input::placeholder,
    html body :is(.workspace-ui, .login-wrap) textarea::placeholder {
        color: var(--muted, #75808d);
        opacity: 1;
        -webkit-text-fill-color: var(--muted, #75808d);
    }
    html body :is(.workspace-ui, .login-wrap) :is(input, select, textarea):focus-visible {
        border-color: #357693 !important;
        outline: 3px solid #65b9e3 !important;
        outline-offset: 2px;
    }
    html body :is(.workspace-ui, .login-wrap) :is(input, select, textarea)[aria-invalid='true'] {
        border-color: var(--red, #b42318) !important;
    }
    html body :is(.workspace-ui, .login-wrap) :is(input, select, textarea):disabled {
        opacity: 0.65;
        cursor: not-allowed;
        background-color: var(--surface-alt, #fafbfc) !important;
    }
    html body :is(.workspace-ui, .login-wrap) input[readonly],
    html body :is(.workspace-ui, .login-wrap) textarea[readonly] {
        background-color: var(--surface-alt, #fafbfc) !important;
    }
    html body :is(.workspace-ui, .login-wrap) input[type='file'] {
        padding: 7px !important;
        overflow: hidden;
    }
    html body :is(.workspace-ui, .login-wrap) input[type='file']::file-selector-button {
        border: 0;
        border-radius: 6px;
        background: #153e56;
        color: #fff;
        padding: 8px 12px;
        margin-right: 10px;
        font-family: inherit;
        font-size: 12px;
        font-weight: 650;
        line-height: 1.4;
        cursor: pointer;
    }
    html body .workspace-ui .team-action-select {
        background-color: #153e56 !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        border-color: #153e56 !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    }
    html body :is(.workspace-ui, .login-wrap) .field > label {
        display: block;
        font-size: 12px;
        font-weight: 650;
        color: var(--ink);
        margin: 0;
        line-height: 1.5;
    }
    html body .workspace-ui details:not(.action-menu):not(.nav-group) > summary {
        padding: 12px;
        min-height: 44px;
        border: 1px solid var(--line);
        border-radius: 9px;
        background: var(--surface-alt);
        color: var(--ink);
        font-size: 13px;
        font-weight: 650;
        line-height: 1.5;
        cursor: pointer;
        overflow-wrap: anywhere;
    }
    html body .workspace-ui details[open]:not(.action-menu):not(.nav-group) > summary {
        margin-bottom: 12px;
    }
    html body .workspace-ui details + details {
        margin-top: 12px;
    }
    html body .workspace-ui .panel > h2:first-child {
        margin-top: 0;
    }
    html body .workspace-ui :is(.table-wrap, .friendly-table-wrap, .go-mobile-table) {
        border-radius: 9px;
    }
    html body .workspace-ui th {
        padding: 12px;
        vertical-align: middle;
        line-height: 1.45;
    }
    html body .workspace-ui td {
        padding: 12px;
        vertical-align: middle;
    }
    html body .workspace-ui .panel .section-note {
        line-height: 1.6;
    }
    html body .login-wrap .btn {
        min-height: 44px !important;
        border-radius: 9px !important;
        font-size: 13px !important;
        padding: 10px 14px !important;
        line-height: 1.4 !important;
    }
}
@media screen and (max-width: 760px) {
    html body .workspace-ui :is(.head > .quick, .integration-tools, .master-actions) {
        gap: 12px !important;
    }
    html body .workspace-ui .panel .formgrid {
        gap: 16px 12px !important;
    }
    html
        body
        .workspace-ui
        :is(input[type='date'], input[type='datetime-local'], input[type='time']) {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    html body .workspace-ui .workspace-filter-grid > .formgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media screen and (max-width: 359px) {
    html body .workspace-ui .workspace-filter-grid > .formgrid {
        grid-template-columns: 1fr !important;
    }
}
@media screen {
    html
        body
        :is(.workspace-ui, .login-wrap)
        input:is([type='submit'], [type='button'], [type='reset']) {
        display: inline-flex;
        min-height: 44px !important;
        padding: 10px 14px !important;
        border: 1px solid #153e56 !important;
        border-radius: 9px !important;
        background: #153e56 !important;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        font-weight: 650;
        cursor: pointer;
    }
}
@media screen {
    html body .workspace-ui .lead-contact-number {
        font-size: 12px;
        color: var(--muted);
        margin-top: 5px;
        white-space: nowrap;
    }
    html body .workspace-ui .lead-contact-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
    }
    html body .workspace-ui .lead-contact-actions > .btn {
        width: auto !important;
        min-width: 80px;
        flex: 0 0 auto;
        margin: 0 !important;
    }
}
