/* Opt-in command bars. All component overrides stay inside .page-toolbar. */
.page-toolbar {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    padding: 10px 16px;
    background: var(--ui-surface);
    color: var(--ui-text);
    border-bottom: 1px solid var(--ui-divider);
    font-size: 12px;
    line-height: 1.4;
    min-width: 0;
    overflow: visible;
    scrollbar-color: var(--ui-control-border-hover) var(--ui-surface-sunken);
}
.page-toolbar [hidden] { display: none !important; }
.page-toolbar ::selection { background: var(--ui-accent-soft-bg); color: var(--ui-text-strong); }
.page-toolbar :is(input, select) { caret-color: var(--ui-accent); accent-color: var(--ui-accent); }
.page-toolbar :is(button, select, input, [tabindex]):focus-visible {
    outline: 2px solid var(--ui-focus);
    outline-offset: 2px;
    box-shadow: none;
}
.page-toolbar button:focus:not(:focus-visible) { outline: none; }
.page-toolbar .page-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    min-width: 0;
}
.page-toolbar .page-toolbar-tail { display: flex; align-items: center; gap: 18px; margin-left: auto; min-width: 0; }
.page-toolbar .page-toolbar-row--actions {
    border-top: 1px solid var(--ui-divider);
    padding-top: 8px;
    gap: 8px 18px;
}
.page-toolbar :is(.btn, .toggle-btn, .multi-select-btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--ui-control-border);
    border-radius: 6px;
    background: var(--ui-control-bg);
    color: var(--ui-text);
    font: inherit;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    transform: none;
}
.page-toolbar :is(.btn, .toggle-btn, .multi-select-btn):hover:not(:disabled) {
    border-color: var(--ui-control-border-hover);
    background: var(--ui-control-bg-hover);
    color: var(--ui-text-strong);
    transform: none;
    box-shadow: none;
}
/* Secondary emphasis preserves one primary action in each row. */
.page-toolbar .btn.is-emphasis {
    color: var(--ui-accent-soft-text);
    background: var(--ui-accent-soft-bg);
    border-color: var(--ui-accent);
    font-weight: 600;
}
.page-toolbar .btn.is-emphasis:hover:not(:disabled) {
    color: var(--ui-accent-soft-text);
    background: var(--ui-accent-soft-hover, var(--ui-accent-soft-bg));
    border-color: var(--ui-accent-hover);
}
.page-toolbar .btn-primary {
    background: var(--ui-accent);
    border-color: var(--ui-accent);
    color: var(--ui-on-accent);
    font-weight: 600;
}
.page-toolbar .btn-primary:hover:not(:disabled) {
    background: var(--ui-accent-hover);
    border-color: var(--ui-accent-hover);
    color: var(--ui-on-accent);
}
.page-toolbar :is(button, input):disabled { opacity: .55; cursor: not-allowed; }
.page-toolbar .btn i { font-size: 12px; }
.page-toolbar .filter-field {
    display: inline-flex;
    align-items: center;
    gap: 0;
    height: 32px;
    min-width: 0;
    max-width: 100%;
    border: 1px solid var(--ui-control-border);
    border-radius: 6px;
    background: var(--ui-control-bg);
}
.page-toolbar .filter-field > :is(label, .filter-field-label) {
    padding: 0 4px 0 10px;
    color: var(--ui-text-muted);
    white-space: nowrap;
    font-size: 12px;
    font-weight: 400;
}
.page-toolbar .filter-field.is-active {
    border-color: var(--ui-accent-soft-border);
    background: var(--ui-accent-soft-bg);
}
/* A joined field has one focus boundary. Popover inputs are separate controls. */
.page-toolbar .filter-field:has(> :is(input, select):focus, > .unified-search-wrap > input:focus, > .multi-select-container > .multi-select-trigger:focus, > .date-dropdown-wrapper > .date-dropdown-btn:focus) {
    outline: 2px solid var(--ui-focus);
    outline-offset: -2px;
    border-color: transparent;
}
.page-toolbar .filter-field > :is(input, select):focus,
.page-toolbar .filter-field > .unified-search-wrap > input:focus,
.page-toolbar .filter-field > .multi-select-container > .multi-select-trigger:focus,
.page-toolbar .filter-field > .date-dropdown-wrapper > .date-dropdown-btn:focus {
    outline: none;
    box-shadow: none;
}
.page-toolbar .filter-field :is(input, select) {
    height: 30px;
    min-width: 0;
    max-width: 100%;
    padding: 0 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ui-text-strong);
    font: inherit;
    font-weight: 600;
    box-shadow: none;
}
.page-toolbar .filter-field select { appearance: auto; }
.page-toolbar input::placeholder { color: var(--ui-text-muted); opacity: 1; }
.page-toolbar .page-toolbar-search { flex: 0 1 400px; }
.page-toolbar .page-toolbar-search select { width: 124px; flex: 0 1 124px; }
.page-toolbar .page-toolbar-search :is(.unified-search-wrap, #searchInput) {
    flex: 1 1 160px;
    width: 0;
    min-width: 0;
    max-width: none;
}
.page-toolbar .page-toolbar-search .unified-search-wrap { display: inline-flex; }
.page-toolbar .page-toolbar-search #searchInput { font-weight: 400; padding-right: 25px; cursor: text; }
/* The shared search decoration uses !important; opt out inside this joined field. */
.page-toolbar .page-toolbar-search .unified-search {
    border: 0 !important;
    background-color: transparent !important;
    background-image: none;
    padding-left: 6px !important;
}
.page-toolbar .unified-search-clear { color: var(--ui-text-muted); }
.page-toolbar .unified-search-clear:hover { background: var(--ui-control-bg-hover); color: var(--ui-text); }
.page-toolbar .page-toolbar-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}
.page-toolbar .page-toolbar-group + .page-toolbar-group {
    padding-left: 18px;
    border-left: 1px solid var(--ui-divider);
}
.page-toolbar .page-toolbar-label { color: var(--ui-text-muted); font-weight: 600; margin-right: 2px; }
.page-toolbar .page-toolbar-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
}
.page-toolbar .integration-connection-notice {
    color: var(--ui-text-muted);
    background: transparent;
    border: 0;
    padding: 0;
    gap: 6px;
    max-width: 320px;
    font-size: 12px;
    overflow-wrap: anywhere;
}
.page-toolbar .integration-connection-notice a { color: var(--ui-accent-soft-text); }
.page-toolbar .page-toolbar-seg {
    display: inline-flex;
    align-items: center;
    height: 32px;
    max-width: 100%;
    position: relative;
    /* Reserve the 1px inset; ::after paints the single visible outline above children. */
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--ui-control-bg);
}
.page-toolbar .page-toolbar-seg input {
    width: 58px;
    min-width: 0;
    height: 30px;
    padding: 0 6px;
    border: 0;
    border-radius: 6px 0 0 6px;
    background: transparent;
    color: var(--ui-text-strong);
    font: inherit;
}
.page-toolbar .page-toolbar-seg > .btn {
    height: 30px;
    border: 0;
    border-left: 1px solid var(--ui-divider);
    border-radius: 0;
}
.page-toolbar .page-toolbar-seg > .btn:last-child { border-radius: 0 5px 5px 0; }
.page-toolbar .page-toolbar-seg::after {
    content: '';
    position: absolute;
    inset: -1px;
    border: 1px solid var(--ui-control-border);
    border-radius: inherit;
    pointer-events: none;
}
.page-toolbar .page-toolbar-seg:has(> input:focus)::after { border: 2px solid var(--ui-focus); }
.page-toolbar .page-toolbar-seg > input:focus { outline: none; box-shadow: none; }
.page-toolbar .page-filter-more {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin: 0 -16px;
    padding: 10px 16px;
    background: var(--ui-surface-sunken);
    border-top: 1px solid var(--ui-divider);
    min-width: 0;
}
.page-toolbar .page-filter-more input { width: 76px; }
.page-toolbar .page-filter-more .toggle-btn { height: 30px; border: 0; border-radius: 0; padding: 0 6px; }
.page-toolbar .page-filter-count {
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--ui-accent);
    color: var(--ui-on-accent);
    font-size: 12px;
    text-align: center;
}
.page-toolbar .page-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; max-width: 100%; }
.page-toolbar .page-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 26px;
    min-width: 0;
    max-width: 260px;
    padding: 0 4px 0 9px;
    border-radius: 13px;
    border: 1px solid var(--ui-accent-soft-border);
    background: var(--ui-accent-soft-bg);
    color: var(--ui-accent-soft-text);
    font: inherit;
}
.page-toolbar .page-filter-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-toolbar .page-filter-chip.is-default {
    border-style: dashed;
    border-color: var(--ui-control-border);
    background: transparent;
    color: var(--ui-text-muted);
    padding-right: 9px;
    cursor: pointer;
}
.page-toolbar .page-filter-chip button {
    flex: none;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
}
.page-toolbar .page-filter-chip button:hover { background: var(--ui-control-bg-hover); }
.page-toolbar .page-filter-apply-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.page-toolbar :is(.page-toolbar-menu, .page-toolbar-send) { position: relative; display: inline-flex; min-width: 0; }
.page-toolbar .page-toolbar-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: var(--z-index-dropdown);
    min-width: 250px;
    max-width: calc(100vw - 24px);
    padding: 6px;
    border: 1px solid var(--ui-divider);
    border-radius: 8px;
    background: var(--ui-surface-raised);
    box-shadow: var(--ui-shadow-popover);
    transform: translateX(var(--page-menu-shift, 0px));
}
.page-toolbar .page-toolbar-end .page-toolbar-menu-panel { left: auto; right: 0; }
.page-toolbar .page-toolbar-menu-panel .btn {
    width: 100%;
    height: auto;
    min-height: 32px;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
}
.page-toolbar .page-toolbar-menu-panel small { display: block; color: var(--ui-text-muted); font: inherit; margin-top: 2px; }
.page-toolbar .page-toolbar-menu-panel hr { border: 0; border-top: 1px solid var(--ui-divider); margin: 4px 2px; }
.page-toolbar .page-toolbar-tip {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: var(--z-index-tooltip);
    width: max-content;
    max-width: min(500px, calc(100vw - 24px));
    padding: 6px 10px;
    border: 1px solid var(--ui-divider);
    border-radius: 6px;
    background: var(--ui-surface-raised);
    box-shadow: var(--ui-shadow-popover);
    color: var(--ui-text);
    visibility: hidden;
    pointer-events: none;
    overflow-wrap: anywhere;
    transform: translateX(var(--page-menu-shift, 0px));
}
.page-toolbar:not(.is-suspended) .page-toolbar-send:not(.is-tip-dismissed):has(button:hover, button:focus) .page-toolbar-tip { visibility: visible; }
.page-toolbar .badge {
    margin-left: 2px;
    padding: 1px 5px;
    background: var(--ui-accent-soft-bg);
    color: var(--ui-accent-soft-text);
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
}
.page-toolbar .badge[hidden] { display: none; }
.page-toolbar .btn.has-unresolved,
.page-toolbar .btn.has-unresolved:hover:not(:disabled) {
    border-color: var(--ui-warning);
    background: linear-gradient(var(--ui-warning-soft-bg), var(--ui-warning-soft-bg)) var(--ui-surface);
    color: var(--ui-text-strong);
    /* Keep the label legible while the OS switches between light and dark. */
    transition: none;
}
.page-toolbar .btn.has-unresolved .badge {
    background: var(--ui-surface);
    color: var(--ui-warning);
}
.page-toolbar .btn-primary .badge { background: var(--ui-surface); color: var(--ui-accent-soft-text); }
.page-toolbar .multi-select-container { max-width: 150px; }
.page-toolbar .multi-select-trigger {
    min-height: 30px;
    height: 30px;
    padding: 0 8px 0 4px;
    background: transparent;
    border: 0;
    color: var(--ui-text-strong);
    box-shadow: none;
}
.page-toolbar .multi-select-trigger :is(span, i) { color: inherit; font-size: 12px; }
.page-toolbar .multi-select-trigger span { font-weight: 600; }
.page-toolbar .multi-select-dropdown {
    width: 280px;
    min-width: min(240px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    border-color: var(--ui-divider);
    background: var(--ui-surface-raised);
    color: var(--ui-text);
    box-shadow: var(--ui-shadow-popover);
}
.page-toolbar .multi-select-header { background: var(--ui-surface-sunken); border-color: var(--ui-divider); }
.page-toolbar .multi-select-search {
    width: 100%;
    height: 30px;
    border: 1px solid var(--ui-control-border);
    background: var(--ui-control-bg);
    color: var(--ui-text);
    font-weight: 400;
}
.page-toolbar .multi-select-btn { height: 28px; padding: 0 8px; }
.page-toolbar .multi-select-list { max-height: min(250px, 40vh); }
.page-toolbar .multi-select-option { color: var(--ui-text); font-size: 12px; }
.page-toolbar .multi-select-option[style] { color: var(--ui-text-muted) !important; }
.page-toolbar .multi-select-option:hover { background: var(--ui-control-bg-hover); }
.page-toolbar .multi-select-option :is(input, label) { height: auto; font: inherit; color: inherit; }
.page-toolbar .multi-select-option input { width: auto; accent-color: var(--ui-accent); }
/* Result totals for the current conditions: one muted line, values emphasized. */
.page-toolbar .page-result-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 18px;
    min-width: 0;
    color: var(--ui-text-muted);
}
.page-toolbar .page-result-summary-item { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.page-toolbar .page-result-summary-item + .page-result-summary-item { padding-left: 18px; border-left: 1px solid var(--ui-divider); }
.page-toolbar .page-result-summary-value {
    color: var(--ui-text-strong);
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.page-toolbar .page-result-summary-value.is-negative { color: var(--ui-danger); }
/* One-click on/off conditions that query immediately. */
.page-toolbar .page-quick-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px dashed var(--ui-control-border);
    border-radius: 16px;
    background: transparent;
    color: var(--ui-text);
    font: inherit;
    white-space: nowrap;
    cursor: pointer;
}
.page-toolbar .page-quick-filter:hover { background: var(--ui-control-bg-hover); color: var(--ui-text-strong); }
.page-toolbar .page-quick-filter[aria-pressed="true"] {
    border-style: solid;
    border-color: var(--ui-accent-soft-border);
    background: var(--ui-accent-soft-bg);
    color: var(--ui-accent-soft-text);
}
.page-toolbar .page-quick-filter-count { font-weight: 700; font-variant-numeric: tabular-nums; }
/* Period field: basis select + the existing date dropdown in one control. */
.page-toolbar .filter-field.date-field select { flex: none; width: auto; }
.page-toolbar .date-field .date-dropdown-wrapper { display: inline-flex; height: 30px; border-left: 1px solid var(--ui-divider); }
.page-toolbar .date-field .date-dropdown-btn {
    height: 30px;
    min-width: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 0 6px 6px 0;
    background: transparent;
    color: var(--ui-text-strong);
    font-size: 12px;
    font-weight: 600;
    box-shadow: none;
}
.page-toolbar .date-field .date-dropdown-btn:hover,
.page-toolbar .date-field .date-dropdown-btn.open { background: var(--ui-control-bg-hover); box-shadow: none; }
.page-toolbar .date-dropdown-arrow { color: var(--ui-text-muted); }
.page-toolbar .date-dropdown-menu {
    z-index: var(--z-index-dropdown);
    border-color: var(--ui-divider);
    background: var(--ui-surface-raised);
    color: var(--ui-text);
    box-shadow: var(--ui-shadow-popover);
    animation: none;
}
.page-toolbar .date-dropdown-divider { background: var(--ui-divider); }
.page-toolbar .date-custom-title { color: var(--ui-text-muted); font-size: 12px; letter-spacing: 0; text-transform: none; }
.page-toolbar .date-custom-row span { color: var(--ui-text-muted); }
.page-toolbar .date-dropdown-menu input[type="date"] {
    height: 30px;
    border: 1px solid var(--ui-control-border);
    border-radius: 6px;
    background: var(--ui-control-bg);
    color: var(--ui-text);
    font-weight: 400;
}
.page-toolbar :is(.multi-select-search, .date-dropdown-menu input[type="date"]):focus {
    outline: 2px solid var(--ui-focus);
    outline-offset: -2px;
    border-color: transparent;
    box-shadow: none;
}
.page-toolbar .date-preset-item {
    border-color: var(--ui-control-border);
    background: var(--ui-control-bg);
    color: var(--ui-text);
    font: inherit;
    padding: 5px;
}
.page-toolbar .date-preset-item:hover { border-color: var(--ui-control-border-hover); background: var(--ui-control-bg-hover); color: var(--ui-text-strong); }
.page-toolbar .date-preset-item.active { border-color: var(--ui-accent); background: var(--ui-accent); color: var(--ui-on-accent); }
/* Segmented tabs that split the same table (channel, kind). Selection uses aria state. */
.page-toolbar .page-segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--ui-divider);
    border-radius: 8px;
    background: var(--ui-surface-sunken);
}
.page-toolbar .page-segmented-item {
    height: 28px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ui-text-muted);
    font: inherit;
    white-space: nowrap;
    cursor: pointer;
}
.page-toolbar .page-segmented-item:hover { background: var(--ui-control-bg-hover); color: var(--ui-text-strong); }
.page-toolbar .page-segmented-item:is([aria-selected="true"], [aria-pressed="true"]) {
    background: var(--ui-control-bg);
    color: var(--ui-accent-soft-text);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .14);
}
/* Ordered work steps (left to right). Numbers show the order; no step is a primary. */
.page-toolbar .page-toolbar-steps {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    min-width: 0;
    row-gap: 6px;
}
.page-toolbar .page-toolbar-steps > li { display: inline-flex; align-items: center; gap: 4px; }
.page-toolbar .page-toolbar-steps > li + li::before { content: '›'; color: var(--ui-text-muted); font-size: 16px; line-height: 1; padding: 0 2px; }
.page-toolbar .page-toolbar-step-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ui-accent-soft-bg);
    color: var(--ui-accent-soft-text);
    border: 1px solid var(--ui-accent-soft-border);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
/* On/off setting with a visible switch; the checkbox stays the accessible control. */
.page-toolbar .page-toolbar-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--ui-control-border);
    border-radius: 6px;
    background: var(--ui-control-bg);
    white-space: nowrap;
}
.page-toolbar .page-toolbar-switch label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--ui-text); }
.page-toolbar .page-toolbar-switch input[type="checkbox"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.page-toolbar .page-toolbar-switch-track {
    width: 28px;
    height: 16px;
    padding: 2px;
    border-radius: 999px;
    background: var(--ui-control-border-hover);
    box-sizing: border-box;
}
.page-toolbar .page-toolbar-switch-track::after {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ui-surface);
    transition: transform .12s ease;
}
.page-toolbar .page-toolbar-switch input:checked + .page-toolbar-switch-track { background: var(--ui-accent); }
.page-toolbar .page-toolbar-switch input:checked + .page-toolbar-switch-track::after { transform: translateX(12px); }
.page-toolbar .page-toolbar-switch input:focus-visible + .page-toolbar-switch-track { outline: 2px solid var(--ui-focus); outline-offset: 3px; }
.page-toolbar .page-toolbar-switch a { color: var(--ui-accent-soft-text); text-decoration: none; padding-left: 8px; border-left: 1px solid var(--ui-divider); }
.page-toolbar .page-toolbar-switch a:hover { text-decoration: underline; }
/* Attribute condition: item + condition + value in one field, with its own apply/clear. */
.page-toolbar .page-toolbar-attr { flex-wrap: wrap; height: auto; min-height: 32px; }
.page-toolbar .page-toolbar-attr select + select,
.page-toolbar .page-toolbar-attr select + input { border-left: 1px solid var(--ui-divider); border-radius: 0; }
.page-toolbar .page-toolbar-attr input { width: 120px; font-weight: 400; }
.page-toolbar .page-toolbar-attr > .btn {
    height: 30px;
    border: 0;
    border-left: 1px solid var(--ui-divider);
    border-radius: 0;
    background: transparent;
}
.page-toolbar .page-toolbar-attr > .btn:last-child { border-radius: 0 5px 5px 0; }
/* Split-view panels: denser toolbar inside a pane. */
.page-toolbar.page-toolbar--compact { padding: 6px 8px; gap: 6px; }
.page-toolbar.page-toolbar--compact :is(.btn, .filter-field, .page-toolbar-switch) { height: 30px; }
.page-toolbar.page-toolbar--compact .filter-field :is(input, select) { height: 28px; }
.page-toolbar.page-toolbar--compact .page-toolbar-attr > .btn { height: 28px; }
.page-toolbar.page-toolbar--compact .page-toolbar-row { gap: 6px; }
.page-toolbar.page-toolbar--compact .page-segmented-item { height: 26px; padding: 0 10px; }
/* Destructive or audited actions live below a menu divider. */
.page-toolbar .page-toolbar-menu-panel .is-danger,
.page-toolbar .page-toolbar-menu-panel .is-danger small { color: var(--ui-danger); }
.page-toolbar .page-toolbar-menu-panel .is-danger:hover:not(:disabled) { background: var(--ui-danger-soft-bg); color: var(--ui-danger); }
/* Shared triggers that stay hidden until their own access check passes. */
.page-toolbar .page-toolbar-menu-panel .historical-correction-trigger:not(.is-visible) { display: none; }
@media (max-width: 600px) {
    .page-toolbar { padding: 10px; }
    .page-toolbar .page-toolbar-search { flex: 1 1 100%; }
    .page-toolbar .page-toolbar-group + .page-toolbar-group { padding-left: 0; border-left: 0; }
    .page-toolbar .page-toolbar-end { margin-left: 0; }
    .page-toolbar .page-filter-more { margin: 0 -10px; padding: 10px; }
    .page-toolbar .page-toolbar-menu-panel {
        position: fixed;
        top: auto;
        bottom: 12px;
        left: 12px;
        right: 12px;
        width: auto;
        min-width: 0;
        max-height: 60vh;
        overflow-y: auto;
        transform: none;
        padding-bottom: max(6px, env(safe-area-inset-bottom));
    }
    .page-toolbar .page-toolbar-end .page-toolbar-menu-panel { left: 12px; right: 12px; }
    .page-toolbar .page-toolbar-menu-panel .btn { min-height: 44px; }
    .page-toolbar .page-filter-chip { max-width: 100%; }
}

/* Product category trees share the table's quiet dark palette; modals stay outside. */
@media (prefers-color-scheme: dark) {
    .page-tree.theme-ready {
        --tree-bg: #202630;
        --tree-heading: #29313d;
        --tree-text: #c2c9d2;
        --tree-muted: #a6afbc;
        --tree-divider: #35404d;
        --tree-hover: #2c3541;
        --tree-selected: #30465e;
        --tree-accent: #9db7cd;
        --tree-icon: #c8b48a;
        --tree-control: #252c36;
    }
}
.page-tree .tree-item:not(.selected):hover { background: var(--tree-hover, #e8f0fe); }
.page-tree .tree-item.selected { background: var(--tree-selected, #d4e6f1); font-weight: bold; }

/* Finance periods share a criterion and two dates without forcing row overflow. */
.page-toolbar .filter-field.date-field--range {
    flex-wrap: wrap;
    height: auto;
    min-height: 32px;
    max-width: 100%;
}
.page-toolbar .date-field--range input[type="date"] {
    width: 126px;
    min-width: 0;
    flex: 0 1 126px;
    border: 0;
    background: transparent;
    color: var(--ui-text);
    font: inherit;
}
.page-toolbar .date-field--range .date-separator { color: var(--ui-text-muted); }
.page-toolbar .page-segmented label { position: relative; cursor: pointer; }
.page-toolbar .page-segmented label:has(input:checked) {
    background: var(--ui-accent-soft-bg);
    color: var(--ui-accent);
}
.page-toolbar .page-segmented label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.page-toolbar .page-segmented label:has(input:focus-visible) { outline: 2px solid var(--ui-focus); outline-offset: 2px; }

/* Data meaning shared by settings pages. */
.page-info-note { display:flex; align-items:flex-start; gap:8px; margin:0 0 8px; padding:8px 12px; border-radius:6px; background:color-mix(in srgb, var(--ui-info) 10%, var(--ui-surface)); color:var(--ui-text); font-size:13px; line-height:1.6; }
.page-info-note > i { color:var(--ui-info); margin-top:3px; flex-shrink:0; }
