/* =========================================================
   I-Block: this app's page layout, on Würth UI (wurth-ui/).
   Components come from the design system; everything here is
   arrangement, written with its tokens so light and dark both work.
   ========================================================= */

/* ── Frame: header, steps, the page, the action bar at the bottom ── */

.ib-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--surface);
}

.ib-page {
    flex: 1 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: var(--space);
    min-width: 0;
    padding: var(--space) var(--wh-edge) var(--wh-page-end, var(--space));
}

/* The page heading takes focus after navigation, for screen readers; no ring for it */
h1:focus {
    outline: none;
}

.ib-title {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A title and its status pill, 8 px apart */
.ib-title-row {
    display: flex;
    align-items: center;
    gap: var(--space-tight);
    min-width: 0;
}

.ib-title-row > .wh-pill {
    flex: none;
}

/* A title with its tools at the right */
.ib-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space);
    min-width: 0;
}

/* The Inbox's List / Timeline choice */
.ib-view {
    width: 152px;
}

/* A card title that ends at its text, so its pill follows 8 px after it */
.wh-card-title.ib-title-fit {
    flex: 0 1 auto;
}

.ib-option-line {
    display: flex;
    align-items: baseline;
    gap: var(--space-tight);
    min-width: 0;
    margin: var(--space-tight) 0 0;
    color: var(--muted);
}

/* A red line with the button that fixes it */
.ib-alert {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-tight) var(--space);
}

.ib-muted {
    color: var(--muted);
}

.ib-red {
    color: var(--red-text);
}

.ib-strong {
    font-weight: 600;
}

.ib-flat {
    margin: 0;
}

.ib-note {
    margin: var(--space-tight) 0 0;
}

.ib-line {
    display: block;
}

.ib-cut {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ib-pad {
    padding: var(--space);
}

/* The header's bell, with the count of unread notifications on its top right corner */
.ib-bell {
    position: relative;
}

.ib-bell-count {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 var(--space-hair);
    border-radius: var(--radius-pill);
    background: var(--red);
    box-shadow: 0 0 0 2px var(--surface);
    color: var(--on-red);
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Phones: the bell stays beside the menu button */
@media (max-width: 575.98px) {
    .wh-header-end > .ib-bell {
        display: inline-flex;
    }
}

/* The bell's list of notifications */
.ib-notifications {
    width: 360px;
}


/* ── Sheets and columns ───────────────────────────────────────── */

/* The request's details and pieces beside its history */
.ib-sheet {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: var(--space);
}

@media (min-width: 992px) {
    .ib-sheet {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    /* Without a history yet the content takes the whole row */
    .ib-sheet > :only-child {
        grid-column: 1 / -1;
    }
}

/* Form fields in a grid; wide fields take the row */
.ib-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: var(--space);
}

.ib-fields-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ib-span-2 {
    grid-column: span 2;
}

.ib-wide {
    grid-column: 1 / -1;
}

@media (max-width: 767.98px) {
    .ib-fields-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .ib-span-2 {
        grid-column: auto;
    }
}

/* Checkboxes on the line of the fields beside them */
.ib-checks {
    align-items: center;
    min-height: var(--control-40);
}

.ib-field-narrow {
    width: min(100%, 200px);
}

/* Cards in a grid: users to sign in as, requests in a stage */
.ib-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: var(--space);
}

/* Room for the section heads, which reach 8 px past the content edge */
.ib-sections {
    min-width: 0;
    margin: 0 calc(-1 * var(--space-tight));
    padding: 0 var(--space-tight);
}

/* Panels down the page: the stages of the inbox */
.ib-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space);
    min-width: 0;
}

/* The Inbox and My requests: a 1200 px column, with room above the title row and between the stages */
.ib-list-page {
    --wh-page-max: 1200px;
    row-gap: calc(2 * var(--space));
    padding-top: calc(2 * var(--space));
}

.ib-list-page .ib-panels {
    gap: calc(2 * var(--space));
}

/* Settings: four fields a row on wide screens, two on tablets, one on phones */
.ib-fields-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 991.98px) {
    .ib-fields-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .ib-fields-4 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* A length and a width side by side: the largest glued pieces */
.ib-pair {
    display: flex;
    align-items: center;
    gap: var(--space-tight);
}

.ib-pair > .wh-field {
    flex: none;
    width: 128px;
}

.ib-times {
    color: var(--muted);
}

.ib-cell-text {
    white-space: nowrap;
}

.ib-field-copies {
    width: 128px;
}

/* Notes keep the customer's line breaks */
.ib-notes {
    white-space: pre-wrap;
}

/* A multi-line field: the field box grows with its text */
.wh-field.ib-area {
    align-items: stretch;
    height: auto;
    padding-top: var(--space-tight);
    padding-bottom: var(--space-tight);
}

.wh-field.ib-area > textarea {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: calc(var(--wh-lh) * 3);
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    resize: vertical;
}


/* ── Tables that run to a card's sides ────────────────────────── */
/* The table's text lines up with the card's content; its last line is the card's border */

.ib-flush {
    padding: var(--space-hair) 0 0;
    margin: calc(var(--space) - var(--space-hair)) calc(-1 * var(--space)) calc(-1 * var(--space));
}

.ib-flush-x {
    padding: var(--space-hair) 0;
    margin: calc(var(--space-tight) - var(--space-hair)) calc(-1 * var(--space)) 0;
}

.ib-flush .wh-table tbody > tr:last-child > td,
.ib-request-lines .wh-table tbody > tr:last-child > td {
    border-bottom: 0;
}

.wh-card-head + .ib-flush,
.wh-card-head + .ib-flush-x {
    margin-top: calc(-1 * var(--space-hair));
}

.ib-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-tight) var(--space);
    margin-top: var(--space);
}

/* Stacked tables share their column widths */
.ib-inbox-table {
    table-layout: fixed;
    min-width: 1200px;
}

.ib-col-customer { width: 176px; }
.ib-col-count { width: 80px; }
.ib-col-thickness { width: 128px; }
.ib-col-date { width: 112px; }
.ib-col-time { width: 152px; }
.ib-col-person { width: 160px; }
.ib-col-status { width: 160px; }

.ib-pieces-edit {
    min-width: 760px;
}

.ib-col-reference { min-width: 160px; }
.ib-col-floor { width: 136px; }
.ib-col-thickness-edit { width: 128px; }
.ib-col-size { width: 128px; }
.ib-col-qty { width: 88px; }
.ib-col-price { width: 136px; }
.ib-col-check { width: 64px; }
.ib-col-check-wide { width: 104px; }
.ib-col-action { width: 56px; }

.ib-files td:first-child {
    width: 40%;
}

.ib-files tbody tr:last-child > td {
    border-bottom: 0;
}

/* A text button in the last cell keeps the 16 px edge, like the buttons above it */
.wh-table .wh-table-action.ib-action-text:last-child {
    padding-right: calc((var(--wh-panel-head-h, 56px) - 1px - var(--control-32)) / 2);
}

/* Create and Create all keep one width: each holds the other's label, hidden */
.ib-create .wh-btn-label {
    display: inline-grid;
    justify-items: start;
}

.ib-create .wh-btn-label > * {
    grid-area: 1 / 1;
}

.ib-create .wh-btn-label > [aria-hidden="true"] {
    visibility: hidden;
}

.ib-links {
    display: inline-flex;
    gap: var(--space);
}

/* History, newest first */
.ib-history {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    line-height: 20px;
}

.ib-history > li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--space-tight);
    padding: var(--space-tight) 0;
    border-bottom: 1px solid var(--line);
}

.ib-history > li:first-child {
    padding-top: 0;
}

.ib-history > li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.ib-history-event {
    font-weight: 600;
}

.ib-history-by {
    color: var(--muted);
}

.ib-history-time {
    flex-basis: 100%;
    order: -1;
    color: var(--muted);
    font-size: 12px;
    line-height: 16px;
    font-variant-numeric: tabular-nums;
}

.ib-history-note {
    flex-basis: 100%;
    margin: var(--space-hair) 0 0;
    white-space: pre-wrap;
}


/* ── Inbox timeline ───────────────────────────────────────────── */

/* A colour for each status, mixed 60 % with the page */
:root {
    --ib-status-sent: color-mix(in srgb, #fde725 60%, var(--surface));
    --ib-status-in-progress: color-mix(in srgb, #3b528b 60%, var(--surface));
    --ib-status-proposal-sent: color-mix(in srgb, #21918c 60%, var(--surface));
    --ib-status-approved: color-mix(in srgb, #5ec962 60%, var(--surface));
    --ib-status-changes-requested: color-mix(in srgb, var(--red) 60%, var(--surface));
}

/* The request names at the left, the days beside them */
.ib-timeline {
    --ib-timeline-row: 32px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.ib-timeline-names {
    border-right: 1px solid var(--line);
}

.ib-timeline-names-head,
.ib-timeline-axis {
    height: 48px;
    background: var(--band);
    border-bottom: 1px solid var(--line);
}

.ib-timeline-names-head {
    display: flex;
    align-items: flex-end;
    padding: 0 var(--space) 4px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.ib-timeline-name {
    display: flex;
    align-items: center;
    height: var(--ib-timeline-row);
    padding: 0 var(--space);
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    white-space: nowrap;
}

/* The whole name row opens the request, with a table row's hover and press */
.ib-timeline-name:has(.wh-table-link) {
    position: relative;
    cursor: pointer;
}

.ib-timeline-name:has(.wh-table-link):hover {
    background: var(--hover);
}

.ib-timeline-name:has(.wh-table-link):active {
    background: var(--press);
}

.ib-timeline-name a {
    overflow: hidden;
    text-overflow: ellipsis;
}

.ib-timeline-scroll {
    position: relative;
    min-width: 0;
    overflow-x: auto;
}

/* The sideways bar has its own lane under the last row */
.ib-timeline-scroll.has-bar-h {
    padding-bottom: 16px;
}

.ib-timeline-canvas,
.ib-timeline-axis,
.ib-timeline-row {
    position: relative;
}

/* Month names above the day numbers; each stays at the left while its month is in view */
.ib-timeline-months {
    position: absolute;
    top: 4px;
    left: 0;
    display: flex;
}

.ib-timeline-month {
    flex: none;
    overflow: clip;
    border-left: 1px solid var(--edge);
}

.ib-timeline-month span {
    position: sticky;
    left: 24px;
    display: inline-block;
    box-sizing: border-box;
    max-width: 100%;
    padding: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    white-space: nowrap;
}

.ib-timeline-day {
    position: absolute;
    bottom: 4px;
    width: 22px;
    margin-left: 3px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
    text-align: center;
}

.ib-timeline-day.is-today {
    background: var(--ink);
    color: var(--on-ink);
    font-weight: 600;
}

.ib-timeline-row {
    height: var(--ib-timeline-row);
    border-bottom: 1px solid var(--line);
}

.ib-timeline-bar,
.ib-timeline-window {
    position: absolute;
    top: 8px;
    height: 16px;
    border-radius: 4px;
}

/* From the day received to the Wanted by date, behind the bar */
.ib-timeline-window {
    background: var(--press);
}

.ib-timeline-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.ib-timeline-bar.is-sent { background: var(--ib-status-sent); }
.ib-timeline-bar.is-in-progress { background: var(--ib-status-in-progress); }
.ib-timeline-bar.is-proposal-sent { background: var(--ib-status-proposal-sent); }
.ib-timeline-bar.is-changes-requested { background: var(--ib-status-changes-requested); }
.ib-timeline-bar.is-approved { background: var(--ib-status-approved); }

/* An approved bar ends in a tick */
.ib-timeline-done {
    display: grid;
    place-items: center;
    width: 12px;
    height: 12px;
    margin-right: 2px;
    border-radius: 50%;
    background: var(--surface);
}

.ib-timeline-done .wh-icon {
    width: 8px;
    height: 8px;
    stroke-width: 3;
    color: var(--ink);
}

/* Today, from under the axis to the bottom */
.ib-timeline-today {
    position: absolute;
    top: 48px;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--ink);
    pointer-events: none;
}

/* Tooltips keep their line breaks, such as the lines of a timeline bar's details */
.wh-tooltip {
    white-space: pre-line;
}

/* A panel head that ends in a checkbox keeps 16 px to its right edge */
.wh-panel-head:has(> .wh-panel-actions > .wh-check:last-child) {
    padding-right: 16px;
}


/* ── Calculation ──────────────────────────────────────────────── */

.ib-calculation {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: var(--space);
}

@media (min-width: 992px) {
    .ib-calculation {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    }
}

.ib-feed {
    display: grid;
    gap: var(--space-tight);
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    line-height: 20px;
    font-variant-numeric: tabular-nums;
}

.ib-feed > li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-tight);
    animation: ib-feed-in var(--duration-open) var(--ease);
}

.ib-feed > li > .wh-icon,
.ib-feed > li > .wh-spinner {
    margin-top: 2px;
    color: var(--muted);
}

.ib-feed > li.is-problem,
.ib-feed > li.is-problem > .wh-icon {
    color: var(--red-text);
}

.ib-feed > li.is-done {
    font-weight: 600;
}

@keyframes ib-feed-in {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: none; }
}

.ib-live {
    min-height: 192px;
}

/* The yield: the one big number */
.ib-yield {
    display: flex;
    align-items: baseline;
    gap: var(--space-tight);
    margin-bottom: var(--space-tight);
    white-space: nowrap;
}

.ib-yield > strong {
    font-size: 24px;
    line-height: 30px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ib-yield > span {
    color: var(--muted);
    font-size: 12px;
    line-height: 16px;
}


/* ── Drawings ─────────────────────────────────────────────────── */

.ib-drawing svg {
    display: block;
    width: 100%;
    height: auto;
    font-family: var(--font-sans);
}

/* In dark the blank, its offcuts and pieces take the dark greys; the cuts stay red */
[data-theme="dark"] .ib-drawing pattern rect[fill="#E6E4DF"] { fill: var(--press); }
[data-theme="dark"] .ib-drawing pattern circle { fill: var(--press-deep); }
[data-theme="dark"] .ib-drawing pattern rect[fill="#ECEAE6"] { fill: var(--band); }
[data-theme="dark"] .ib-drawing pattern line { stroke: var(--edge); }
[data-theme="dark"] .ib-drawing rect[fill="#FFFFFF"] { fill: var(--raised); }
[data-theme="dark"] .ib-drawing [stroke="#1A1A1A"] { stroke: var(--edge-hover); }
[data-theme="dark"] .ib-drawing [stroke="#4A4A4A"] { stroke: var(--muted); }
[data-theme="dark"] .ib-drawing text[fill="#1A1A1A"] { fill: var(--ink); }
[data-theme="dark"] .ib-drawing text[fill="#4A4A4A"] { fill: var(--muted); }
[data-theme="dark"] .ib-drawing [fill="#E3000F"] { fill: var(--red); }
[data-theme="dark"] .ib-drawing circle[stroke="#FFFFFF"] { stroke: var(--raised); }


/* ── Options ──────────────────────────────────────────────────── */

/* The selector stays under the steps while the patterns scroll */
.ib-option-bar {
    position: sticky;
    top: calc(var(--wh-header-h) + var(--steps-band));
    z-index: 20;
    display: grid;
    gap: var(--space);
    margin: calc(-1 * var(--space)) calc(-1 * var(--space)) 0;
    padding: var(--space);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

@media (max-width: 767.98px) {
    .ib-option-bar:not(.is-collapsed) {
        position: static;
    }
}

.ib-option-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-tight);
    min-width: 0;
}

.ib-option-tools > .text-small {
    flex: 1 1 200px;
    min-width: 0;
}

.ib-option-bar .wh-option {
    font-size: 14px;
}

.ib-option-yield {
    flex: none;
    font-variant-numeric: tabular-nums;
}

/* Options shown after a proposal went out cannot be chosen again */
.wh-option[aria-disabled="true"] {
    cursor: default;
}

.wh-option[aria-disabled="true"]:hover,
.wh-option[aria-disabled="true"]:active {
    background: var(--surface);
}

.wh-option[aria-disabled="true"]:not([aria-checked="true"]):hover,
.wh-option[aria-disabled="true"]:not([aria-checked="true"]):active {
    border-color: var(--line);
}

/* What if: a change that gains nothing reads in grey */
.ib-grid tr.is-worse td {
    color: var(--muted);
}

/* What follows a grid in its panel */
.ib-grid-foot {
    padding: var(--space);
}

.ib-grid-foot > .ib-card-foot {
    margin-top: 0;
}

/* Comparison: options as columns */
.ib-compare {
    min-width: 720px;
}

.ib-compare tbody th {
    width: 200px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.ib-compare tbody th.ib-indent {
    padding-left: calc(var(--space) * 2);
    font-weight: 400;
}

.ib-compare thead th.ib-chosen {
    color: var(--ink);
}

.ib-best {
    font-weight: 600;
}

/* Cutting patterns */
.ib-pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
    align-items: start;
    gap: var(--space);
}

.ib-pattern-yield {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-tight);
    font-size: 14px;
    line-height: 20px;
    white-space: nowrap;
}

.ib-pattern-yield > span {
    color: var(--muted);
    font-size: 12px;
    line-height: 16px;
}

.ib-pattern-yield > strong {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Floor key: a swatch and a name per floor of the thickness; the floors wrap under the first */
.ib-floor-key {
    display: flex;
    align-items: flex-start;
    gap: var(--space-tight);
    min-width: 0;
    margin-bottom: var(--space-tight);
    font-size: 14px;
    line-height: 20px;
}

.ib-floor-key-label {
    flex: none;
    color: var(--muted);
    font-size: 12px;
}

.ib-floor-key-items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-hair) var(--space);
    min-width: 0;
}

.ib-floor-key-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-tight);
    min-width: 0;
    max-width: 100%;
}

.ib-floor-key-swatch {
    flex: none;
    width: 10px;
    height: 10px;
}

.ib-floor-key-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ── All options ──────────────────────────────────────────────── */

.wh-dialog-head:has(> .ib-dialog-count) > .wh-dialog-title {
    flex: 0 1 auto;
}

.ib-dialog-count {
    flex: 0 1 auto;
    margin-right: auto;
}

.ib-grid {
    table-layout: fixed;
    width: max-content;
    min-width: 100%;
}

/* Messages over a grid in its panel, such as what an import left out: the same room above and below */
.ib-grid-notes {
    display: grid;
    gap: var(--space-tight);
    padding: var(--space);
}

/* The notes' own lines: the gap spaces them, not their margins */
.ib-grid-notes > p {
    margin: 0;
}

/* A panel that takes a dropped file: the outline sits inside its border, over the pinned column */
.wh-panel.wh-dropzone::after {
    inset: 0;
    z-index: 5;
}

/* A grid that fills its box: the column without a width takes what is left; once the user has given
   that column a width too, an empty spare column before the row menu takes it */
.ib-grid.ib-grid-fill {
    width: 100%;
}

/* The spare column is empty and has no padding, even as the last cell of a row */
.wh-table.ib-grid :is(th, td).ib-col-spare:empty {
    padding: 0;
}

/* While the spare column is empty and last, the column before it is the table's edge and keeps the
   outer cells' 16 px edge, as it would as the last cell */
.wh-table.ib-grid:not(.has-spare) :is(th, td):has(+ .ib-col-spare:last-child) {
    padding-right: var(--wh-cell-edge);
}

.wh-table-edit.ib-grid:not(.has-spare) td:has(+ .ib-col-spare:last-child):has(.wh-field, .wh-icon-btn) {
    padding-right: calc(var(--wh-cell-edge) - var(--wh-in-fx) - 1px);
}

/* The row menu stays in view at the right while a wide grid scrolls sideways, above the resize lines
   of the columns that slide under it; it does not clip, so the fade before it shows on every row */
.ib-grid .ib-stick {
    position: sticky;
    z-index: 4;
    overflow: visible;
    background: var(--surface);
}

.ib-grid thead .ib-stick {
    background: var(--band);
}

.ib-grid .ib-stick-actions { right: 0; }

/* With the menu pinned at the right the content slides under it, and the group heads stay pinned at
   both edges, so the box itself never fades; instead the content fades just before the pinned column
   while there is more to scroll, into the pinned cell's own colour (header band, hover, picked row).
   It fades in and out over duration-open, like the edge fades. */
.wh-scroll.ib-pinned-end {
    -webkit-mask-image: none;
    mask-image: none;
}

.wh-scroll.ib-pinned-end .ib-stick-actions::before {
    content: "";
    position: absolute;
    top: 0;
    right: 100%;
    bottom: 0;
    width: 32px;
    background-color: inherit;
    -webkit-mask-image: linear-gradient(to right, transparent, #000);
    mask-image: linear-gradient(to right, transparent, #000);
    opacity: 0;
    transition: opacity var(--duration-open) var(--ease);
    pointer-events: none;
}

.wh-scroll.ib-pinned-end.is-more-right .ib-stick-actions::before {
    opacity: 1;
}

.ib-grid th,
.ib-grid td {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Each header holds its own resize handle, which reaches past its edge; the label cuts its own
   text, so the header never reads as cut text and shows no tooltip of its own */
.ib-grid thead th {
    position: relative;
    overflow: visible;
    text-overflow: clip;
}

/* The Compare checkbox column: last, pinned, wide enough for its header */
.ib-grid col.ib-grid-pick,
.ib-grid .ib-grid-pick {
    width: 120px;
}

/* A checkbox column with a menu: the label centred on the column, the marks and chevron at its right (rules 49, 55) */
.ib-grid th.wh-table-check .ib-grid-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, max-content) minmax(max-content, 1fr);
}

.ib-grid th.wh-table-check .ib-grid-label {
    grid-column: 2;
}

.ib-grid th.wh-table-check .ib-grid-marks {
    grid-column: 3;
    justify-self: end;
}

/* A table in a dialog: the dialog's body scrolls it, so the table keeps no scroller of its own */
.ib-grid-in-dialog {
    min-width: 0;
}

.ib-grid-head {
    display: flex;
    align-items: center;
    gap: var(--space-hair);
    min-width: 0;
}

.ib-grid-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ib-grid-label[draggable="true"] {
    cursor: grab;
}

/* Sort, filter and group marks and the menu button never shrink, so they always show */
.ib-grid-marks {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: var(--space-hair);
    color: var(--ink);
}

/* The chevron keeps a clear gap from the resize line, its grey square included */
.ib-grid .ib-grid-chevron {
    margin-right: 0;
}

.ib-col-resize {
    position: absolute;
    top: 0;
    right: -4px;
    z-index: 3;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
}

/* The line that shows a column can be resized: subtle, darker and taller under the pointer and
   while dragging; none after the last column */
.ib-col-resize::after {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    right: 4px;
    width: 1px;
    background: var(--edge);
    transition: background-color var(--duration-fast) var(--ease), top var(--duration-fast) var(--ease), bottom var(--duration-fast) var(--ease);
}

.ib-col-resize:hover::after,
th.resizing .ib-col-resize::after {
    top: 6px;
    bottom: 6px;
    background: var(--edge-hover);
}

/* While a column is being resized, a line runs down the whole table at its edge */
th.resizing .ib-col-resize::before {
    content: "";
    position: absolute;
    top: 0;
    right: 4px;
    width: 1px;
    height: var(--ib-resize-guide, 100%);
    background: var(--edge-hover);
    pointer-events: none;
}

.ib-grid th.drop-target {
    box-shadow: inset 2px 0 0 var(--edge-hover);
}

.ib-grid tbody tr.is-picked > td {
    background: var(--hover);
}

.ib-grid-yield {
    font-weight: 600;
}

/* A group head stays readable while the grid scrolls sideways: the value pinned at the left,
   the count at the right */
.ib-grid-group > td {
    overflow: visible;
    background: var(--band);
    font-weight: 600;
}

.ib-grid-group-line > :first-child {
    position: sticky;
    left: var(--space);
}

.ib-grid-group-line > .ib-grid-count {
    position: sticky;
    right: var(--space);
}

/* A group head: the value at the left, "Count: 3" at the right; the whole row folds the group */
.ib-grid-group-line {
    display: flex;
    align-items: center;
    gap: var(--space);
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.ib-grid-group-line:focus-visible {
    outline: 0;
    box-shadow: var(--focus-ring);
}

.ib-grid-group-line > :first-child {
    display: inline-flex;
    align-items: center;
    gap: var(--space-tight);
}

/* The fold chevron looks like the header chevrons: muted in a square that shows while the row is
   under the pointer. The icon stays on the 16 px edge and its square reaches past it. */
.ib-grid-group-fold {
    margin: 0 calc((var(--icon) - min(var(--wh-h), var(--control-32))) / 4) 0 calc((var(--icon) - min(var(--wh-h), var(--control-32))) / 2);
}

.ib-grid-group-line:hover .ib-grid-group-fold {
    background: var(--press);
    color: var(--ink);
}

.ib-grid-group-line:active .ib-grid-group-fold {
    background: var(--press-deep);
    color: var(--ink);
}

.ib-grid-group-chevron {
    transition: transform var(--duration-fast) var(--ease);
}

.ib-grid-group.is-collapsed .ib-grid-group-chevron {
    transform: rotate(-90deg);
}

.ib-grid-count {
    flex: none;
    margin-left: auto;
    color: var(--muted);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.ib-grid-end {
    display: flex;
    justify-content: center;
    padding: var(--space);
}

/* The dialog footer's first button sits at the left */
.ib-foot-start {
    margin-right: auto;
}

/* A column's filter, in a small panel under its header */
.ib-filter {
    gap: var(--space-tight);
    width: 288px;
    padding: var(--space);
}

.ib-filter-title {
    color: var(--ink);
}

.ib-filter-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-tight);
}

.ib-filter-actions {
    justify-content: flex-end;
    margin-top: var(--space-tight);
}


/* ── Proposal ─────────────────────────────────────────────────── */

.ib-language {
    align-items: flex-start;
}


/* ── Phones ───────────────────────────────────────────────────── */

/* Phones: buttons in a bar share a row only while their whole labels fit */
@media (max-width: 575.98px) {
    .wh-bar > .wh-btn,
    .wh-actionbar > .wh-btn,
    .wh-actionbar > .wh-actionbar-end > .wh-btn {
        flex: 1 0 auto;
    }

    .wh-actionbar-end {
        display: contents;
    }

    .ib-head > .wh-bar {
        flex: 1 1 100%;
    }

    .ib-option-tools > .wh-bar {
        flex: 1 1 auto;
    }

    .ib-dialog-count {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ib-feed > li {
        animation: none;
    }
}

/* Sign in: one centred card */
.ib-signin-page {
    align-content: center;
}

.ib-signin {
    width: 100%;
    max-width: 400px;
    justify-self: center;
}

.ib-signin-form {
    display: grid;
    gap: var(--space);
    margin-top: var(--space);
}

/* Change password, or back to Sign in: a text link under the button */
.ib-signin-form > .wh-link {
    justify-self: start;
}

/* A header that sorts when clicked */
.ib-grid-label.is-sortable {
    cursor: pointer;
}

/* A dropdown of numbers in a number column: its value on the right, like the other numbers */
.wh-table td.wh-num .wh-select-value {
    flex: 1 1 auto;
    text-align: right;
}

/* A filter condition: the operator, its value and its ×; on phones the value goes under the operator */
.ib-condition {
    display: grid;
    grid-template-columns: minmax(0, 192px) minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-tight);
    min-width: 0;
}

@media (max-width: 575.98px) {
    .ib-condition {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .ib-condition-value {
        grid-column: 1;
        grid-row: 2;
    }
}
