/* ═══════════════════════════════════════════════════
   MwDataGrid mobile-mode test page (/dev/data-grid-mobile-test) — prefix mw-dgmt-*
   A desktop-inspectable phone frame around a forced-compact grid, plus synthetic
   chip/pill cells standing in for the entitlements facets.
   ═══════════════════════════════════════════════════ */

.mw-dgmt-stage {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
}

/* NOTE: The phone page — the surface at real size, nothing around it. dvh (not vh) so the mobile
   browser's collapsing URL bar does not leave a dead strip at the bottom. No transform here, unlike
   the preview frame: on a real phone the sheets SHOULD anchor to the real viewport. */
.mw-dgmt-phone {
    position: fixed;
    inset: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--mud-palette-background);
}

.mw-dgmt-phone-wait {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 100%;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

/* NOTE: transform != none makes this element the containing block for the grid's
   position:fixed sheet + scrim — that is the whole trick that keeps the bottom
   sheet inside the frame instead of pinning it to the browser viewport. */
.mw-dgmt-frame {
    position: relative;
    transform: translateZ(0);
    height: min(80dvh, 820px);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-table-lines);
    border-radius: 22px;
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
}

.mw-dgmt-statusbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 14px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--mud-palette-text-disabled);
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-table-lines);
}

/* NOTE: A definite-height flex column, NOT an auto-height scroller: the grid's swap viewport is
   flex:1 of the grid root, so an auto-height parent collapses the carousel to 0px (the grid's own
   Height="100%" needs something to be 100% OF). Scrolling happens inside the grid. */
.mw-dgmt-screen {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* NOTE: The facet switch now owns the toolbar's second row (SwapGridSwitchInOwnToolbarRow), so
   it stretches across the strip instead of hugging the search field's right edge. */
.mw-dgmt-facets {
    flex: 1;
    min-width: 0;
}

/* NOTE: The real sheet sizes itself in dvh (viewport truth on a phone). Inside the
   frame that would blow past the frame's own height, so the preview re-anchors the
   same fractions to the frame. Preview-only override — never a fix for the grid. */
.mw-dgmt-frame .mw-dg-sheet--twothirds {
    height: 68%;
}

.mw-dgmt-frame .mw-dg-sheet--third {
    height: 34%;
}

/* ── Left cell: the mockup's identity anatomy (name + membership mini-chips) ── */

.mw-dgmt-person {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.mw-dgmt-name {
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Facet cells: chips, pills, badge ── */

.mw-dgmt-cell {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.mw-dgmt-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 38%, transparent);
}

.mw-dgmt-chip-num {
    font-variant-numeric: tabular-nums;
    opacity: 0.75;
}

.mw-dgmt-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    white-space: nowrap;
    color: #fff;
    background: var(--c);
}

.mw-dgmt-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-action-disabled-background);
}

.mw-dgmt-empty {
    font-size: 0.6875rem;
    color: var(--mud-palette-text-disabled);
}

/* ── Row sheet content ── */

.mw-dgmt-sheet {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mw-dgmt-sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.mw-dgmt-sheet-name {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.25;
}

.mw-dgmt-sheet-mail {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.mw-dgmt-sheet-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.mw-dgmt-sheet-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

/* ── Notes panel: the running contract checklist next to the frame ── */

.mw-dgmt-notes {
    flex: 1 1 300px;
    min-width: 280px;
    padding: 16px 18px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-table-lines);
    border-radius: 12px;
}

.mw-dgmt-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8125rem;
}

.mw-dgmt-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.mw-dgmt-ok {
    color: var(--mud-palette-success);
    font-weight: 700;
}

.mw-dgmt-todo {
    color: var(--mud-palette-text-disabled);
    font-weight: 700;
}
