/* Final quality layer: one coherent visual contract for every photographer page. */
:root {
    --quality-ink: #10363e;
    --quality-muted: #5d7378;
    --quality-line: rgba(16, 54, 62, 0.14);
    --quality-soft: #f3f7f6;
    --quality-accent: var(--studio-accent-color, #e58a32);
    --quality-accent-dark: var(--studio-accent-dark-color, #b8651e);
    --quality-shadow: 0 12px 34px rgba(14, 48, 55, 0.08);
    --quality-shadow-raised: 0 20px 48px rgba(14, 48, 55, 0.12);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 150px;
}

body {
    color: var(--quality-ink);
    background:
        radial-gradient(circle at 88% 2%, rgba(229, 138, 50, 0.08), transparent 24rem),
        linear-gradient(145deg, #f7faf9 0%, #edf4f2 100%);
}

.main-content {
    min-width: 0;
}

.main-content > :not(.messages) {
    min-width: 0;
}

/* Long back-office screens should not pay the layout cost of off-screen sections. */
.main-content > section,
.main-content > div > section,
.stats-cockpit > section,
.production-page > section,
.education-api-page > section {
    content-visibility: auto;
    contain-intrinsic-size: auto 420px;
}

p,
li,
dd,
dt,
label,
button,
input,
select,
textarea {
    text-wrap: pretty;
}

small,
.table-subtext,
.section-head p,
.form-field > small,
.note-block,
.mail-page-shell small,
.production-page small,
.dynamic-template-builder-page small,
.secretariat-mail-state-strip span,
.secretariat-mail-workspace .mail-inbox-stats span {
    font-size: max(0.8125rem, 13px) !important;
    line-height: 1.42 !important;
}

.main-content label > span,
.main-content time,
.main-content [class*="-kicker"],
.main-content [class*="-loading"],
.mail-ticket-context span,
.mail-conversation-line span,
.planning-agenda-event-top span,
.account-v2-hero span,
.administration-page span[class*="meta"] {
    font-size: max(0.75rem, 12px) !important;
}

.leaflet-control-attribution,
.leaflet-control-attribution a {
    font-size: 11px !important;
}

.pouch-pair-preview .dynamic-template-canvas > small,
.pouch-pair-preview .dynamic-template-canvas-label,
.pouch-pair-preview [class*="canvas-label"] {
    min-height: 20px;
    font-size: max(0.75rem, 12px) !important;
    line-height: 1.2 !important;
}

.eyebrow,
.stat-label,
[class*="-label"] {
    text-underline-offset: 0.15em;
}

.eyebrow {
    font-size: max(0.8125rem, 13px) !important;
}

a,
button,
input,
select,
textarea,
summary,
[tabindex] {
    outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(229, 138, 50, 0.42);
    outline-offset: 3px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.section-card,
.stat-card,
.mini-stat-card,
[class*="-panel"],
[class*="-card"] {
    min-width: 0;
}

.section-card,
.stat-card,
.mini-stat-card {
    border-color: var(--quality-line);
    box-shadow: var(--quality-shadow);
}

.section-head {
    gap: 14px;
}

.section-head > div,
.section-head h2,
.section-head h3,
.section-head p {
    min-width: 0;
}

.section-head h2,
.section-head h3,
.modal-head h3 {
    line-height: 1.12;
    text-wrap: balance;
}

.hero.compact,
.dashboard-simple-hero,
.stats-cockpit-hero,
.account-v2-hero,
.parent-offers-hero {
    border: 1px solid var(--quality-line);
    box-shadow: var(--quality-shadow-raised);
}

.hero.compact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.65fr);
    align-items: center;
    gap: 24px;
}

.hero.compact > div:first-child {
    min-width: 0;
}

.hero.compact .selector-card {
    width: 100%;
    max-width: none;
    padding: 14px;
}

.hero.compact .selector-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.hero.compact .selector-pill {
    flex: 1 1 126px;
    justify-content: center;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid rgba(16, 54, 62, 0.12);
    border-radius: 10px;
    background: #f4f8f7;
    color: var(--quality-ink);
    text-align: center;
}

.hero.compact .selector-pill:hover,
.hero.compact .selector-pill:focus-visible,
.hero.compact .selector-pill.active {
    border-color: rgba(229, 138, 50, 0.34);
    background: rgba(229, 138, 50, 0.11);
}

.stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
}

.stat-card strong {
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.topbar {
    border-bottom-color: var(--quality-line);
    background: rgba(247, 250, 249, 0.92);
    backdrop-filter: blur(18px);
}

.topbar > div:first-child {
    min-width: 0;
}

.topbar h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Keep dense ledgers readable without turning every action cell into a tall block. */
.quote-ledger-actions,
.row-actions,
.table-actions {
    flex-wrap: wrap;
    gap: 6px;
}

.quote-ledger-actions .button-link,
.row-actions .button-link,
.table-actions .button-link {
    min-height: 34px;
}

/* Catalogue: twelve products per page are enough for a fast, visual scan. */
.catalog-v2-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.catalog-v2-product-card {
    grid-template-rows: 178px minmax(0, 1fr) auto;
}

.catalog-v2-media {
    padding: 20px 18px 14px;
}

.catalog-v2-product-body {
    padding: 15px 16px;
}

.catalog-v2-business-copy p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.catalog-v2-price-grid {
    gap: 7px;
}

/* Heavy reference and statistic pages stay quick while scrolling. */
.education-api-page [class*="school-card"],
.education-api-page [class*="record"],
.stats-cockpit-section,
.stats-cockpit-decision-grid,
.stats-cockpit-flow-grid,
.stats-cockpit-ranking-grid {
    content-visibility: auto;
    contain-intrinsic-size: auto 320px;
}

.stats-cockpit-kpi p,
.stats-cockpit-ratios p {
    min-height: 0;
}

.topbar-actions {
    min-width: 0;
}

.topbar-search-trigger {
    max-width: 220px;
}

.school-chip {
    min-width: 160px;
    max-width: 270px;
}

.school-chip strong,
.school-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1500px) {
    .quote-builder-page .quote-schedule-row {
        grid-template-columns: 30px minmax(110px, 0.75fr) minmax(105px, 0.65fr) minmax(160px, 1fr);
    }

    .quote-builder-page .quote-schedule-state {
        grid-column: 2 / 4;
    }

    .quote-builder-page .quote-schedule-remove {
        grid-column: 4;
    }

    .school-chip {
        min-width: 120px;
        max-width: 180px;
    }

    .school-chip span {
        display: none;
    }

    .administration-v2-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .administration-v2-nav {
        position: static;
    }

    .administration-v2-nav nav {
        grid-template-columns: repeat(6, minmax(130px, 1fr));
    }

    .admin-email-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-email-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-height: 430px;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-right: 4px;
    }
}

@media (min-width: 721px) and (max-width: 1699px) {
    body[data-page="planning"] .planning-agenda-week-head,
    body[data-page="planning"] .planning-agenda-week-body,
    body[data-page="planning"] .planning-agenda-week-columns {
        min-width: 100% !important;
    }

    body[data-page="planning"] .planning-agenda-week-head {
        grid-template-columns: var(--calendar-time-axis) repeat(7, minmax(0, 1fr));
    }

    body[data-page="planning"] .planning-agenda-week-columns {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
}

@media (min-width: 861px) and (max-width: 1500px) {
    .quote-wizard-shell {
        grid-template-columns: 210px minmax(0, 1fr);
        gap: 14px;
    }

    .quote-step-panel-lite {
        padding: 18px;
    }

    .quote-step-card,
    .quote-sheet-block {
        padding: 14px;
    }

    .quote-sheet-toolbar {
        display: grid;
        grid-template-columns: minmax(140px, 0.8fr) minmax(190px, 1.2fr) auto;
        align-items: end;
    }

    .quote-sheet-toolbar .quote-inline-picker,
    .quote-sheet-toolbar .quote-catalog-search {
        min-width: 0;
        width: 100%;
    }

    .quote-sheet-table-head {
        display: none;
    }

    .quote-sheet-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        gap: 9px 12px;
    }

    .quote-sheet-row > .quote-sheet-cell:nth-child(1) {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .quote-sheet-row > .quote-sheet-cell:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }

    .quote-sheet-row > .quote-sheet-cell:nth-child(3) {
        grid-column: 2;
        grid-row: 2;
    }

    .quote-sheet-row > .quote-sheet-cell:nth-child(6) {
        grid-column: 3;
        grid-row: 2;
    }

    .quote-sheet-row > .quote-sheet-cell:nth-child(4) {
        grid-column: 1;
        grid-row: 3;
    }

    .quote-sheet-row > .quote-sheet-cell:nth-child(5) {
        grid-column: 2 / -1;
        grid-row: 3;
    }
}

.page-anchor-nav {
    position: sticky;
    top: 82px;
    z-index: 24;
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    margin: 14px 0 18px;
    padding: 8px;
    overflow-x: auto;
    border: 1px solid var(--quality-line);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 22px rgba(14, 48, 55, 0.08);
    backdrop-filter: blur(14px);
    scrollbar-width: thin;
}

.page-anchor-nav a {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 13px;
    border-radius: 10px;
    color: var(--quality-muted);
    font-size: 0.84rem;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

.page-anchor-nav a:hover,
.page-anchor-nav a:focus-visible {
    background: var(--quality-soft);
    color: var(--quality-ink);
}

.campaign-tab-row,
.production-tabs,
.account-v2-tabs {
    scrollbar-width: thin;
}

body[data-page="campaign_detail"] .section-card:has(.campaign-tab-row) {
    position: sticky;
    top: 80px;
    z-index: 22;
    padding: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
}

body[data-page="campaign_detail"] .campaign-tab-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
}

body[data-page="campaign_detail"] .campaign-tab-row .tab-link {
    flex: 0 0 auto;
    white-space: nowrap;
}

.table-scroll,
.stats-cockpit-table-wrap,
[class*="table-wrap"] {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

table th {
    color: #456067;
    font-size: 0.78rem;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

table td,
table th {
    vertical-align: middle;
}

table tbody tr {
    transition: background-color 150ms ease, box-shadow 150ms ease;
}

table tbody tr:hover {
    background: rgba(229, 138, 50, 0.045);
}

.row-actions,
[class*="row-actions"],
.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.row-actions .button-link,
[class*="row-actions"] .button-link,
.table-actions .button-link {
    min-height: 34px;
    padding: 6px 10px;
}

.mail-page-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "title actions"
        "tabs search";
    align-items: end;
    gap: 14px;
}

.mail-page-title {
    grid-area: title;
    display: block;
}

.mail-page-title h2 {
    margin-bottom: 0;
}

.mail-channel-tabs {
    grid-area: tabs;
    overflow-x: auto;
    scrollbar-width: thin;
}

.mail-global-search {
    grid-area: search;
    min-width: min(100%, 300px);
}

.mail-toolbar-actions {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.mail-thread-empty,
.mail-inbox-empty,
[class*="mail-empty"] {
    min-height: 260px;
    place-content: center;
    text-align: center;
}

.secretariat-mail-workspace h2,
.secretariat-mail-workspace h3,
.secretariat-mail-workspace strong,
.mail-page-shell h2,
.mail-page-shell h3,
.mail-page-shell strong {
    overflow-wrap: anywhere;
}

.secretariat-mail-state-strip span,
.secretariat-mail-workspace .mail-inbox-stats span {
    min-height: 28px;
}

.stats-cockpit > section,
.account-company-v2 > section,
.parent-offers-page > section,
.parent-offers-form > section {
    scroll-margin-top: 150px;
}

.stats-cockpit-table td:first-child small {
    display: block;
    margin-top: 4px;
    color: var(--quality-muted);
}

.stats-cockpit-evolution {
    min-width: 64px;
    text-align: center;
}

.stats-cockpit-month-tooltip {
    min-width: 132px;
}

.stats-cockpit-month-tooltip span,
.stats-cockpit-month-tooltip small {
    font-size: max(0.78rem, 12.5px) !important;
}

.account-company-contract {
    scroll-margin-top: 150px;
}

.account-company-module-list > div,
.detail-list > div {
    gap: 14px;
}

.account-company-module-list span,
.account-license-card,
.account-license-card form,
.account-company-editor,
.account-editor-form {
    min-width: 0;
}

.account-form-section {
    scroll-margin-top: 150px;
}

.account-form-actions,
.parent-offers-footer {
    position: sticky;
    bottom: 12px;
    z-index: 20;
    border: 1px solid var(--quality-line);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 14px 34px rgba(14, 48, 55, 0.13);
    backdrop-filter: blur(14px);
}

.account-editor-form,
.parent-offers-form {
    padding-bottom: 18px;
}

.parent-offers-promotion summary {
    min-height: 58px;
}

.parent-offers-promotion-grid,
.parent-offers-pack-fields {
    align-items: start;
}

.parent-offers-board-copy {
    min-width: 0;
}

.parent-offers-board-copy strong,
.parent-offers-board-copy small {
    overflow-wrap: anywhere;
}

.dynamic-template-builder-page button,
.dynamic-template-builder-page .template-layer-icon,
.dynamic-template-builder-page .template-object-pose,
.production-action-grid small {
    font-size: max(0.78rem, 12.5px) !important;
}

.template-editor-toolbar {
    top: 80px;
    border: 1px solid var(--quality-line);
    box-shadow: var(--quality-shadow);
}

.template-editor-shell {
    gap: 16px;
}

.dynamic-template-builder-page .form-field > span,
.dynamic-template-library-card small,
.system-template-card small {
    font-size: max(0.8rem, 13px) !important;
}

.dynamic-template-builder-page .template-editor-controls label,
.dynamic-template-builder-page .template-editor-check,
.dynamic-template-builder-page .template-size-fields label,
.dynamic-template-builder-page .template-background-grid label,
.dynamic-template-builder-page label {
    font-size: max(0.8rem, 13px) !important;
    line-height: 1.35;
}

.catalog-v2-page .catalog-v2-family-icon,
.catalog-v2-page .catalog-v2-command-bar label > span,
.catalog-v2-page .catalog-v2-product-card span,
.catalog-v2-page .catalog-v2-product-card code,
.catalog-v2-page .catalog-v2-rule-grid span,
.catalog-v2-page .catalog-v2-visual-status,
.catalog-v2-page .catalog-v2-origin,
.catalog-v2-page .catalog-v2-price-grid span {
    font-size: max(0.78rem, 12.5px) !important;
}

.planning-agenda-time-axis > span,
.planning-agenda-day-head-top > span,
.planning-agenda-group-copy small,
.planning-agenda-week-corner small {
    font-size: max(0.78rem, 12.5px);
}

.planning-counter-badge,
.planning-agenda-day-head-counters span,
.planning-agenda-day-summary-strip span {
    min-height: 32px;
    font-size: max(0.75rem, 12px) !important;
}

.planning-counter-badge strong,
.planning-agenda-day-head-counters strong,
.planning-agenda-day-summary-strip strong {
    font-size: max(0.76rem, 12px) !important;
}

.planning-page .planning-agenda-head-chip,
.planning-page .planning-agenda-filter-grid label > span,
.planning-page .planning-agenda-sidebar button,
.planning-page .planning-agenda-group-stats,
.planning-page .planning-agenda-toolbar span,
.planning-page .planning-agenda-activity-label,
.planning-page .planning-agenda-view-pill,
.planning-page .planning-agenda-event-assignee,
.planning-page .planning-agenda-event-meta {
    font-size: max(0.75rem, 12px) !important;
}

.planning-page .planning-agenda-event-meta {
    line-height: 1.18 !important;
}

.planning-page .planning-agenda-filter-fields label > span,
.planning-page .planning-agenda-legend span,
.planning-page .planning-agenda-period-heading > span,
.planning-page .planning-agenda-period-heading > p,
.planning-page .planning-agenda-week-corner strong {
    font-size: max(0.75rem, 12px) !important;
}

dialog.modal-dialog {
    max-width: min(94vw, 980px);
    max-height: min(92vh, 900px);
}

dialog.modal-dialog::backdrop {
    background: rgba(8, 32, 38, 0.54);
    backdrop-filter: blur(4px);
}

.quality-scroll-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 70;
    display: grid;
    width: 44px;
    min-height: 44px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 14px;
    background: var(--quality-ink);
    color: #fff;
    box-shadow: 0 12px 30px rgba(14, 48, 55, 0.22);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.quality-scroll-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

@media (max-width: 1280px) {
    .topbar-search-trigger span {
        display: none;
    }

    .topbar-search-trigger {
        width: 42px;
        min-width: 42px;
        padding-inline: 10px;
    }

    .school-chip {
        min-width: 104px;
        max-width: 150px;
    }

    .school-chip span {
        display: none;
    }

    .hero.compact {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
    }
}

@media (max-width: 1400px) {
    body[data-page="campaign_detail"] .stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body[data-page="campaign_detail"] .stat-grid:has(> :nth-child(5):last-child) {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    body[data-page="campaign_detail"] .stat-grid:has(> :nth-child(5):last-child) > .stat-card {
        grid-column: span 2;
    }

    body[data-page="campaign_detail"] .stat-grid:has(> :nth-child(5):last-child) > .stat-card:nth-child(4),
    body[data-page="campaign_detail"] .stat-grid:has(> :nth-child(5):last-child) > .stat-card:nth-child(5) {
        grid-column: span 3;
    }

    body[data-page="campaign_detail"] .stat-grid:has(> :nth-child(4):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .hero.compact {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero.compact .selector-card {
        padding: 12px;
    }

    .page-anchor-nav {
        top: 72px;
    }

    .account-company-editor {
        grid-template-columns: minmax(0, 1fr);
    }

    .account-preview-stack {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mail-page-toolbar {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "title"
            "tabs"
            "search"
            "actions";
        align-items: stretch;
    }

    .mail-toolbar-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    html {
        scroll-padding-top: 120px;
    }

    .main-content {
        overflow-x: clip;
    }

    .topbar h1 {
        max-width: 100%;
        overflow: visible;
        font-size: clamp(1.35rem, 7vw, 1.8rem);
        line-height: 1.05;
        text-overflow: clip;
        white-space: normal;
    }

    .topbar > div:first-child {
        flex: 1 1 100%;
    }

    .topbar-actions {
        flex: 0 0 auto;
    }

    .administration-v2-nav {
        gap: 8px;
        padding: 10px;
    }

    .administration-v2-nav nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .administration-v2-nav-item {
        width: 100%;
        grid-template-columns: 30px minmax(0, 1fr);
        min-height: 48px;
        padding: 7px 8px;
    }

    .administration-v2-nav-item i {
        width: 30px;
        height: 30px;
    }

    .administration-v2-nav-item small {
        display: none;
    }

    .admin-email-list {
        display: flex;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 8px;
        padding: 2px 2px 8px;
        scroll-snap-type: x proximity;
    }

    .admin-email-item {
        flex: 0 0 min(278px, calc(100vw - 64px));
        min-height: 96px;
        scroll-snap-align: start;
    }

    .administration-v2-content .admin-team-row {
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: 10px !important;
        padding: 14px !important;
    }

    .administration-v2-content .admin-team-row-role,
    .administration-v2-content .admin-team-row-actions {
        justify-items: end;
        align-self: start;
    }

    .administration-v2-content .admin-team-row-access {
        grid-column: 1;
    }

    .administration-v2-content .admin-team-row-access p,
    .administration-v2-content .admin-team-row-groups {
        display: none;
    }

    .administration-v2-content .admin-team-row-actions {
        grid-column: 2;
    }

    body[data-page="campaign_detail"] .stat-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body[data-page="campaign_detail"] .stat-grid > .stat-card {
        grid-column: auto !important;
    }

    .school-chip,
    .topbar-logout-link {
        display: none;
    }

    .page-anchor-nav {
        top: 64px;
        margin-inline: -2px;
    }

    .page-anchor-nav,
    .account-v2-tabs,
    .campaign-tab-row,
    .production-tabs,
    .mail-channel-tabs {
        scrollbar-width: none;
    }

    .page-anchor-nav::-webkit-scrollbar,
    .account-v2-tabs::-webkit-scrollbar,
    .campaign-tab-row::-webkit-scrollbar,
    .production-tabs::-webkit-scrollbar,
    .mail-channel-tabs::-webkit-scrollbar {
        display: none;
    }

    .quote-ledger-head > div:first-child,
    .orders-ledger-shell .quote-ledger-head > div:first-child,
    .school-ledger-shell .quote-ledger-head > div:first-child {
        display: grid;
        align-items: start;
        justify-content: stretch;
        gap: 5px;
    }

    .quote-ledger-head > div:first-child p,
    .orders-ledger-shell .quote-ledger-head > div:first-child p,
    .school-ledger-shell .quote-ledger-head > div:first-child p {
        width: 100%;
        max-width: none;
    }

    .hero.compact .selector-pill {
        flex-basis: calc(50% - 7px);
    }

    body[data-page="campaign_detail"] .section-card:has(.campaign-tab-row) {
        top: 62px;
        margin-inline: -2px;
    }

    .account-preview-stack {
        grid-template-columns: minmax(0, 1fr);
    }

    .catalog-v2-product-card {
        grid-template-rows: 158px minmax(0, 1fr) auto;
        border-radius: 18px;
    }

    .catalog-v2-hero {
        gap: 16px;
        padding: 20px 18px;
    }

    .catalog-v2-hero h2 {
        font-size: 1.75rem;
    }

    .catalog-v2-hero-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .catalog-v2-hero-actions > :first-child {
        grid-column: 1 / -1;
    }

    .catalog-v2-hero-actions .button-link {
        min-width: 0;
        min-height: 42px;
        padding-inline: 10px;
    }

    .catalog-v2-media {
        padding: 17px 15px 12px;
    }

    .catalog-v2-product-body {
        padding: 14px;
    }

    .education-api-overview-grid,
    .education-api-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .education-api-overview-card,
    .education-api-summary-card {
        padding: 13px;
        border-radius: 16px;
    }

    .education-api-overview-step {
        width: 32px;
        height: 32px;
    }

    .education-api-overview-card .section-head {
        display: grid;
        gap: 5px;
    }

    .education-api-overview-card .section-head > span {
        justify-self: start;
    }

    .education-api-summary-card strong {
        margin-top: 5px;
        font-size: 1.4rem;
    }

    .education-api-summary-card small {
        margin-top: 5px;
    }

    .education-api-reference-table td:nth-child(2) .table-subtext:last-child,
    .education-api-reference-table td:nth-child(3) .table-subtext:last-child,
    .education-api-reference-table td:nth-child(4) .table-subtext {
        display: none;
    }

    .education-api-reference-table[data-responsive-table] tbody tr {
        padding: 8px 11px;
    }

    .education-api-reference-table[data-responsive-table] tbody td {
        padding-block: 6px;
    }

    .dynamic-template-hero + .photographer-page-brief + .stat-grid,
    body[data-page="pouch_templates"] .stat-grid,
    body[data-page="product_templates"] .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .dynamic-template-library-card {
        grid-template-columns: 80px minmax(0, 1fr) !important;
        justify-items: stretch !important;
        min-height: 126px;
        padding: 10px;
    }

    .dynamic-template-library-card .dynamic-template-canvas {
        width: 70px;
        max-height: 94px;
        justify-self: center !important;
    }

    .dynamic-template-library-card p {
        margin-block: 3px;
    }

    .dynamic-product-table[data-responsive-table] tbody td,
    .pouch-product-table[data-responsive-table] tbody td {
        padding-block: 6px;
    }

    .dynamic-product-table td:nth-child(3) .table-subtext:last-child,
    .pouch-product-table td:nth-child(3) .table-subtext:last-child {
        display: none;
    }

    .stats-cockpit-kpis,
    .stats-cockpit-ratios,
    .stats-cockpit-operation-grid,
    .stats-cockpit-finance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-cockpit-kpi,
    .stats-cockpit-ratios article,
    .stats-cockpit-operation-grid article,
    .stats-cockpit-finance-grid article {
        padding: 13px;
    }

    .stats-cockpit-kpi-head {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 9px;
    }

    .stats-cockpit-kpi > strong,
    .stats-cockpit-ratios strong {
        font-size: 1.25rem;
    }

    .stats-cockpit-month-tooltip strong,
    .stats-cockpit-month-tooltip span,
    .stats-cockpit-month-tooltip small,
    .stats-cockpit-month-chart > article > b {
        font-size: 12px !important;
    }

    .planning-agenda-week-head,
    .planning-agenda-week-body,
    .planning-agenda-week-columns {
        min-width: 720px !important;
    }

    .account-form-actions,
    .parent-offers-footer {
        bottom: 8px;
        flex-wrap: wrap;
    }

    .parent-offers-footer > div {
        flex: 1 0 100%;
    }

    table[data-responsive-table] {
        display: block;
        width: 100%;
    }

    table[data-responsive-table] thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    table[data-responsive-table] tbody,
    table[data-responsive-table] tr,
    table[data-responsive-table] td {
        display: block;
        width: 100%;
    }

    table[data-responsive-table] tbody {
        display: grid;
        gap: 12px;
    }

    table[data-responsive-table] tbody tr {
        padding: 10px 13px;
        border: 1px solid var(--quality-line);
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 7px 20px rgba(14, 48, 55, 0.06);
    }

    table[data-responsive-table] tbody td {
        display: grid;
        grid-template-columns: minmax(104px, 38%) minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        min-height: 0;
        padding: 8px 0;
        border: 0;
        border-bottom: 1px solid rgba(16, 54, 62, 0.09);
        text-align: right;
    }

    table[data-responsive-table] tbody td:last-child {
        border-bottom: 0;
    }

    table[data-responsive-table] tbody td::before {
        content: attr(data-label);
        color: var(--quality-muted);
        font-size: 0.75rem;
        font-weight: 800;
        letter-spacing: 0.025em;
        text-align: left;
        text-transform: uppercase;
    }

    table[data-responsive-table] tbody td[colspan] {
        grid-template-columns: minmax(0, 1fr);
        text-align: left;
    }

    table[data-responsive-table] tbody td[colspan]::before,
    table[data-responsive-table] tbody td:empty::before {
        display: none;
    }

    table[data-responsive-table] .row-actions,
    table[data-responsive-table] [class*="row-actions"],
    table[data-responsive-table] .table-actions {
        justify-content: flex-end;
    }

    .quality-scroll-top {
        right: 14px;
        bottom: 14px;
    }
}

@media (max-width: 480px) {
    .hero.compact .selector-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero.compact .selector-pill {
        width: 100%;
        min-width: 0;
    }

    .page-anchor-nav a {
        padding-inline: 11px;
    }

    table[data-responsive-table] tbody td {
        grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
    }

    .stats-cockpit-kpis,
    .stats-cockpit-ratios,
    .stats-cockpit-operation-grid,
    .stats-cockpit-finance-grid {
        gap: 8px;
    }

    .stats-cockpit-kpi-head > span,
    .stats-cockpit-ratios span,
    .stats-cockpit-operation-grid span,
    .stats-cockpit-finance-grid span {
        min-height: 0;
        font-size: 0.72rem;
    }

    .stats-cockpit-kpi p,
    .stats-cockpit-ratios p,
    .stats-cockpit-finance-grid p {
        font-size: 0.76rem;
    }

    dialog.modal-dialog {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        margin: 8px;
    }
}

@media (max-width: 340px) {
    .hero.compact .selector-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
