/* Owner mobile density: content first, white/grey type, controls remain touch-sized. */
.cmp-disc-sidebar>summary{display:none}.cmp-disc-actions-menu{position:relative;flex-shrink:0}.cmp-disc-actions-menu>summary{display:flex;align-items:center;justify-content:center;list-style:none;cursor:pointer;min-height:44px}.cmp-disc-actions-menu>summary::-webkit-details-marker{display:none}.cmp-disc-actions-menu>.cmp-disc-actions{display:grid;position:absolute;right:0;top:calc(100% + 8px);width:230px;padding:10px;z-index:12;background:#111319;border:1px solid #ffffff24;border-radius:12px;box-shadow:0 12px 30px #0008}.cmp-disc-actions-menu>.cmp-disc-actions>.cmp-btn{width:100%;justify-content:flex-start;white-space:normal;text-align:left;min-height:44px}.cmp-files-access-note{font-size:12px;color:var(--cmp-text-2,#c7c7ce)}.cmp-files-access-note>summary{cursor:pointer;min-height:44px;display:flex;align-items:center}.cmp-files-download>.cmp-icon{transform:rotate(90deg)}
@media(max-width:767px){
 .cmp-main{padding-inline:12px;padding-top:14px}
 .cmp-main .cmp-screen h1,.cmp-main .cmp-files-screen h1,.cmp-main .cmp-documents h1{font-size:24px;line-height:1.18;letter-spacing:-.03em}
 .cmp-main .cmp-screen h2,.cmp-main .cmp-files-screen h2{font-size:17px;line-height:1.4}
 .cmp-main input:not([type=checkbox]):not([type=radio]):not([type=file]),.cmp-main select,.cmp-main textarea{font-size:16px}
 .cmp-main .cmp-label{font-size:12px}.cmp-main .cmp-card{border-radius:14px}
 .cmp-files-screen{gap:12px}.cmp-files-upload{padding:14px;gap:10px}.cmp-files-upload>label{font-size:12px}.cmp-files-drop{padding:12px;border-radius:12px;gap:8px}.cmp-files-drop>strong,.cmp-files-drop>.cmp-files-hint{display:none}.cmp-files-drop>.cmp-btn{width:100%;min-height:44px}.cmp-files-item{flex-wrap:nowrap;padding:12px;gap:10px;align-items:center}.cmp-files-thumb{width:36px;height:36px;flex-basis:36px}.cmp-files-item-meta{gap:4px;min-width:0}.cmp-files-item-meta strong{font-size:13px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;line-height:1.4}.cmp-files-item-meta>span{font-size:10px;line-height:1.5}.cmp-files-item>.cmp-files-actions{width:auto;flex:0 0 auto;gap:6px;flex-wrap:nowrap;justify-content:flex-end}.cmp-files-item>.cmp-files-actions>.cmp-btn{width:44px;min-width:44px;min-height:44px;padding:0;justify-content:center}[data-cmp=files-saved-item] .cmp-files-actions .cmp-btn__label,.cmp-files-actions .cmp-files-download-label{display:none}.cmp-files-access-note>.cmp-files-note{font-size:12px;line-height:1.6}.cmp-files-pagination{font-size:11px;gap:8px}
 .cmp-docs-head{gap:12px}.cmp-docs-card,.cmp-docs-panel,.cmp-docs-create,.cmp-docs-issued{padding:14px}.cmp-docs-step{width:30px;height:30px;flex-basis:30px}.cmp-docs-hint,.cmp-docs-project{font-size:12px;line-height:1.6}.cmp-docs-actions{gap:8px}.cmp-docs-copy{padding:12px}.cmp-docs-copy__pages{gap:8px}
 .cmp-disc-head{margin-block:12px;gap:12px;align-items:flex-start}.cmp-disc-head p:not(.cmp-disc-eyebrow){font-size:12px;line-height:1.6}.cmp-disc-layout{grid-template-columns:minmax(0,1fr);gap:12px}.cmp-disc-detail{padding:14px;min-height:0}.cmp-disc-create{padding:14px;gap:12px;margin-bottom:12px}.cmp-disc-thread-head{gap:10px}.cmp-disc-thread-head h2{font-size:17px;margin-block:8px}.cmp-disc-thread-head .cmp-disc-muted{font-size:11px;line-height:1.6}.cmp-disc-actions-menu>summary{padding-inline:12px;font-size:12px}.cmp-disc-message{padding-block:14px}.cmp-disc-message-text{font-size:13px;line-height:1.75}.cmp-disc-composer-text{min-height:80px;height:90px;resize:vertical}.cmp-disc-list .cmp-disc-topic{padding:12px;min-height:64px;gap:5px}.cmp-disc-topic .cmp-btn__label{font-size:13px}.cmp-disc-topic-meta{font-size:10px}.cmp-disc-sidebar{display:block;border:1px solid var(--cmp-line,#ffffff20);border-radius:12px;background:#0d0f15b3;padding:0}.cmp-disc-sidebar>summary{display:list-item;list-style-position:inside;cursor:pointer;min-height:48px;padding:14px 12px;color:#f3f3f5;font-size:13px;line-height:1.5;overflow-wrap:anywhere}.cmp-disc-sidebar[open]{padding:0 12px 12px}.cmp-disc-sidebar[open]>summary{margin-inline:-12px}.cmp-disc-sidebar>.cmp-field,.cmp-disc-sidebar>select,.cmp-disc-sidebar>.cmp-btn{margin-bottom:10px;width:100%}
 .cmp-notify-head{gap:12px;margin-bottom:16px}.cmp-notify-head h1{margin-top:7px}.cmp-notify-row{padding:13px 14px;gap:10px}.cmp-notify-filters{margin-bottom:14px}.cmp-search-toolbar{margin-block:18px 12px}.cmp-search-row{padding:14px}.cmp-search-result-meta{font-size:10px}.cmp-search-result-link{font-size:14px}.cmp-search-empty{padding:24px 14px}
}
/* Empty visits must remain a short actionable row on a phone. */
@media (max-width: 767px) {
    /* The thread header wraps on phones; keep its actions inside that row. */
    .cmp-disc-thread-head > .cmp-disc-actions-menu { flex: 1 1 100%; min-width: 0; }
    .cmp-disc-actions-menu > summary { width: 100%; }
    .cmp-disc-actions-menu > .cmp-disc-actions { position: static; width: 100%; margin-top: 8px; }
    .cmp-p3-screen .cmp-vs-block { gap: 8px; padding: 14px; }
    .cmp-p3-screen .cmp-vs-nearest--none { min-height: 0; padding: 0; border: 0; }
    .cmp-p3-screen .cmp-vs-actions { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 8px; }
    .cmp-p3-screen .cmp-vs-actions .cmp-btn { min-width: 0; width: 100%; min-height: 44px; padding-inline: 8px; font-size: 12px; white-space: normal; }
    .cmp-p3-screen .cmp-vs-actions .cmp-btn:only-child { grid-column: 1 / -1; }
}


/* Board links are desktop-only, independent from the phone tabbar breakpoint. */
@media (max-width: 1023px) {
    .cmp-desktop-board-link { display: none !important; }
}

/* Mobile project work. Keep action groups aligned and form actions in view. */
@media (max-width: 767px) {
    .cmp-p3-filtertoggle, .cmp-p3-filterbody {
        background: var(--cmp-black-glass-bg);
        border: 1px solid var(--cmp-black-glass-line);
        border-radius: 12px;
    }
    .cmp-p3-filterbody { padding: 12px; }

    .cmp-main .cmp-btn, .cmp-dialog .cmp-btn {
        box-sizing: border-box;
        max-width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 10px 12px;
        font-size: 13px;
        line-height: 1.35;
        white-space: normal;
        word-break: normal;
        overflow-wrap: normal;
        text-align: center;
    }
    .cmp-btn > .cmp-icon { flex-shrink: 0; }
    .cmp-main .cmp-btn__label, .cmp-dialog .cmp-btn__label {
        min-width: 0;
        white-space: normal;
        word-break: normal;
        overflow-wrap: normal;
    }
    .cmp-p3-toolbar .cmp-inputgroup, .cmp-p3-picker .cmp-inputgroup,
    .cmp-p3-screen .cmp-inputgroup {
        background: var(--cmp-black-glass-bg);
    }
    .cmp-p3-screen .cmp-wf-actions, .cmp-p3-stagefold .cmp-wf-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 8px;
    }
    .cmp-p3-stagefold .cmp-wf-actions [data-cmp='stage-history'] { grid-column: auto; }
    .cmp-p3-screen .cmp-wf-actions > :only-child { grid-column: 1 / -1; }
    .cmp-p3-screen .cmp-wf-actions > .cmp-btn { width: 100%; height: 100%; }
    .cmp-wf-workactions { display: grid; grid-template-columns: minmax(0, 1fr); }
    .cmp-wf-workactions > .cmp-btn { width: 100%; }
    .cmp-wf-workstate { min-width: 0; overflow-wrap: anywhere; }
    .cmp-p3-screen .cmp-wf-quick {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 8px;
    }
    .cmp-wf-quick__label { grid-column: 1 / -1; margin: 0; }
    .cmp-p3-screen .cmp-wf-quick > .cmp-btn { width: 100%; height: 100%; }
    .cmp-p3-screen .cmp-wf-quick > .cmp-btn:last-child:nth-child(4) { grid-column: 1 / -1; }
    .cmp-formfoot { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .cmp-formfoot__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        width: 100%;
        margin: 0;
        gap: 8px;
    }
    .cmp-formfoot__actions > :only-child { grid-column: 1 / -1; }
    .cmp-formfoot__actions .cmp-btn { width: 100%; height: 100%; }
    .cmp-p3-action-menu__items {
        width: min(288px, calc(100vw - 48px));
        min-width: 0;
        max-width: calc(100vw - 48px);
    }
    [data-cmp='project-card-screen'] .cmp-p3-actions:has(.cmp-p3-action-menu[open]) > .cmp-p3-section-select,
    [data-cmp='project-card-screen'] .cmp-p3-actions > .cmp-p3-action-menu[open] { grid-column: 1 / -1; }
    [data-cmp='project-card-screen'] .cmp-p3-action-menu[open] .cmp-p3-action-menu__items {
        position: static;
        width: 100%;
        max-width: none;
        max-height: none;
        margin-top: 8px;
        overflow: visible;
    }
    .cmp-dialog[open], .cmp-dialog[data-cmp][open] {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: calc(100% - 24px);
        max-width: 480px;
        height: fit-content;
        max-height: calc(100dvh - 24px);
        margin: auto;
        padding: 16px;
        border: 1px solid var(--cmp-black-glass-line);
        border-radius: 16px;
        overflow: hidden;
    }
    .cmp-dialog > .cmp-dialog__title { flex: 0 0 auto; font-size: 19px; }
    .cmp-dialog > .cmp-dialog__body {
        flex: 0 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-inline: 2px;
        padding-bottom: 4px;
    }
    .cmp-dialog > .cmp-dialog__foot, .cmp-dialog[data-cmp] > .cmp-dialog__foot {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        flex: 0 0 auto;
        gap: 8px;
        margin-top: 12px;
    }
    .cmp-dialog > .cmp-dialog__foot > :only-child { grid-column: 1 / -1; }
    .cmp-dialog > .cmp-dialog__foot:has(> :nth-child(3)) { grid-template-columns: minmax(0, 1fr); }
    .cmp-dialog[data-cmp] > .cmp-dialog__foot > .cmp-btn,
    .cmp-dialog > .cmp-dialog__foot > .cmp-btn { width: 100%; height: 100%; }
}
