:root {
    --ink: #243746;
    --muted: #6f7f8d;
    --line: #dce9ee;
    --surface: #ffffff;
    --canvas: #f6fbfd;
    --brand: #1797a6;
    --brand-dark: #087987;
    --accent: #f08a5d;
    --indigo: #5f76d3;
    --mint: #2fbf9f;
    --soft: #e7f3f2;
    --warm: #fff4e8;
}

html, body {
    min-height: 100%;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, #eefaff 0, rgba(238, 250, 255, 0) 300px), var(--canvas);
}

a { color: var(--brand); font-weight: 700; text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }
.btn { border-radius: 6px; font-weight: 700; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.content { padding-top: 1.25rem; padding-bottom: 2rem; }
h1 { margin: 0; color: #1f3a4a; font-size: 2rem; font-weight: 800; letter-spacing: 0; }
h2 { margin: 0 0 1rem; font-size: 1.15rem; font-weight: 800; letter-spacing: 0; }
.lead { max-width: 760px; color: var(--muted); }
.eyebrow { margin: 0 0 .35rem; color: var(--brand-dark); font-size: .78rem; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.dashboard-header, .page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1.35rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(233, 248, 247, .9), rgba(255, 255, 255, .98) 56%, rgba(255, 243, 234, .78));
    box-shadow: 0 12px 26px rgba(21, 78, 92, .07);
}
.dashboard-header p:last-child,
.page-heading p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    font-weight: 600;
}
.section-title, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.metric-card, .work-surface { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 10px 24px rgba(16, 24, 40, .05); }
.metric-card { padding: 1rem; border-left: 4px solid var(--brand); }
.metric-card:nth-child(2) { border-left-color: var(--indigo); }
.metric-card:nth-child(3) { border-left-color: var(--accent); }
.metric-card span { display: block; color: var(--muted); font-weight: 700; }
.metric-card strong { display: block; margin-top: .25rem; font-size: 2rem; line-height: 1.1; }
.metric-link {
    color: var(--ink);
    text-decoration: none;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.metric-link:hover,
.metric-link:focus-visible {
    color: var(--ink);
    text-decoration: none;
    transform: translateY(-2px);
    border-color: #bfe8ee;
    box-shadow: 0 14px 30px rgba(21, 78, 92, .12);
}
.patient-filters {
    flex: 0 0 auto;
}
.work-surface { padding: 1.15rem; margin-bottom: 1rem; }
.split-layout, .measurement-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr); gap: 1rem; align-items: start; }
.measurement-layout { grid-template-columns: minmax(280px, 420px) minmax(0, 1fr); }
.patient-table { display: grid; gap: .35rem; }
.table-row { display: grid; grid-template-columns: 2fr 1fr .7fr .45fr; gap: .75rem; align-items: center; min-height: 58px; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.table-row:not(.table-head):hover { border-color: #ccecf1; background: #fbfeff; box-shadow: 0 8px 18px rgba(21, 78, 92, .06); }
.table-row small { display: block; color: var(--muted); }
.table-head { min-height: auto; color: var(--muted); background: #f4fbfc; font-size: .82rem; font-weight: 800; text-transform: uppercase; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1rem; }
.form-grid label { display: grid; gap: .35rem; color: #465868; font-size: .9rem; font-weight: 700; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem .85rem;
    align-items: start;
}
.form-grid-pair label {
    display: grid;
    gap: .35rem;
    color: #465868;
    font-size: .9rem;
    font-weight: 700;
}
.size-option-feedback {
    grid-column: 1 / -1;
    display: grid;
    gap: .15rem;
    margin-top: -.15rem;
}
.payment-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: .65rem;
    color: #465868;
    font-size: .88rem;
    font-weight: 800;
}
.payment-row label {
    margin: 0;
    color: #465868;
    font-size: .9rem;
    font-weight: 800;
}
.photo-panel,
.measurement-card-photos {
    display: grid;
    gap: .6rem;
}
.photo-panel-heading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
}
.photo-panel-heading strong {
    color: #163251;
    font-weight: 900;
}
.photo-upload-button {
    cursor: pointer;
}
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: .6rem;
}
.photo-thumb {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}
.photo-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.photo-thumb figcaption {
    display: grid;
    gap: .35rem;
    padding: .45rem;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
}
.amount-input {
    width: 7ch;
    max-width: 7ch;
    text-align: right;
}
.pwa-install-button {
    display: none;
    align-items: center;
    white-space: nowrap;
}
.form-control, .form-select { border-color: var(--line); border-radius: 6px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(23, 151, 166, .15); }
textarea.form-control { min-height: 92px; }
.readonly-value {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: .375rem .75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fbfc;
    color: #163251;
    font-weight: 800;
}
.size-option-hint {
    color: #6b7b8a;
    font-size: .78rem;
    font-weight: 700;
}
.size-option-warning {
    color: #dc3545;
    font-size: .78rem;
    font-weight: 800;
}
.leg-board { position: sticky; top: 4.75rem; height: var(--measure-board-height); padding: 1rem; border: 1px solid var(--line); border-radius: 8px; background: #ffffff; box-shadow: 0 12px 26px rgba(21, 78, 92, .07); }
.leg-side-heading {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    margin-bottom: .35rem;
    color: #163251;
    font-weight: 900;
}
.measurement-leg-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
}
.measurement-image-frame {
    position: relative;
    height: var(--measure-canvas-height);
}
.measurement-line-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.guide-line {
    position: absolute;
    left: 4%;
    right: 4%;
    border-top: 1px solid rgba(32, 39, 45, .55);
}
.heel-guide {
    position: absolute;
    top: 73.5%;
    z-index: 1;
    width: 54px;
    border-top: 1.5px solid rgba(32, 39, 45, .75);
    border-radius: 999px;
}
.heel-guide-left {
    left: 23.5%;
    transform: rotate(18deg);
    transform-origin: left center;
}
.heel-guide-right {
    right: 23.5%;
    transform: rotate(-18deg);
    transform-origin: right center;
}
.length-line {
    position: absolute;
    bottom: 18.5%;
    width: 1px;
    border-left: 1px solid rgba(32, 39, 45, .55);
}
.length-line::before,
.length-line::after {
    content: "";
    position: absolute;
    left: -4px;
    width: 9px;
    height: 9px;
    border-left: 1px solid rgba(32, 39, 45, .55);
    border-top: 1px solid rgba(32, 39, 45, .55);
}
.length-line::before {
    top: 0;
    transform: rotate(45deg);
}
.length-line::after {
    bottom: 0;
    transform: rotate(225deg);
}
.line-ct { top: 7%; }
.line-ch { top: 17%; }
.line-cg { top: 29.5%; }
.line-cf { top: 36%; }
.line-cd { top: 50%; }
.line-cc { top: 58%; }
.line-cb { top: 69%; }
.line-cy { display: none; }
.line-ca { top: 78.5%; }
.length-lg {
    left: 9%;
    top: 29.5%;
}
.length-ld {
    left: 15%;
    top: 50%;
}
.drawing-code {
    position: absolute;
    z-index: 1;
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    min-height: 22px;
    padding: 0 .2rem;
    transform: translateY(-50%);
    border-radius: 999px;
    background: rgba(255, 255, 255, .74);
    color: #20272d;
    font-size: .86rem;
    font-weight: 800;
    line-height: 1;
}
.drawing-code.circled {
    width: 28px;
    height: 28px;
    border: 1.5px solid #20272d;
    background: rgba(255, 255, 255, .82);
}
.code-left { left: 18%; }
.code-right { right: 18%; }
.length-code { left: 5%; }
.code-ct { top: 7%; }
.code-ch { top: 17%; }
.code-cg { top: 29.5%; }
.code-cf { top: 36%; }
.code-cd { top: 50%; }
.code-cc { top: 58%; }
.code-cb { top: 69%; }
.code-cy { top: 73%; }
.code-ca { top: 78.5%; }
.code-lg { top: 44%; left: 4.2%; }
.code-ld { top: 66%; left: 10.8%; }
.new-measurement-panel {
    overflow: visible;
}
.measurement-step-tabs {
    gap: .4rem;
}
.measurement-step-tabs .nav-link {
    border-radius: 999px;
    color: var(--muted);
    font-weight: 800;
}
.measurement-step-tabs .nav-link.active {
    background: var(--brand);
    color: #ffffff;
}
.measurement-meta-strip {
    display: grid;
    grid-template-columns: minmax(150px, .75fr) minmax(170px, 1fr) minmax(170px, 1fr);
    gap: .75rem;
    align-items: end;
    margin-bottom: 1rem;
}
.measurement-meta-strip label {
    display: grid;
    gap: .3rem;
    color: #465868;
    font-size: .88rem;
    font-weight: 800;
}
.measurement-unit {
    min-width: 52px;
    padding: .48rem .7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f4fbfc;
    color: #163251;
    font-weight: 900;
    text-align: center;
}
.side-unit {
    position: absolute;
    top: .7rem;
    z-index: 1;
    min-width: 7ch;
    padding: .32rem .5rem;
}
.right-side .side-unit {
    left: calc(1rem + 34px + .5rem);
}
.left-side .side-unit {
    right: 1rem;
}
.measurement-sizes-layout {
    --measure-canvas-height: 680px;
    --measure-heading-offset: 2.4rem;
    --measure-board-height: calc(var(--measure-canvas-height) + var(--measure-heading-offset) + 2rem);
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(260px, 390px) minmax(220px, 300px);
    grid-template-areas: "right drawing left";
    gap: 1rem;
    align-items: stretch;
}
.measurement-sizes-layout > .leg-board {
    grid-area: drawing;
}
.measurement-sizes-layout > .left-side {
    grid-area: right;
}
.measurement-sizes-layout > .right-side {
    grid-area: left;
}
.measurement-side-choice {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(260px, 390px) minmax(220px, 300px);
    gap: 1rem;
    margin-bottom: 1rem;
}
.measurement-side-choice label {
    display: flex;
    align-items: center;
    gap: .75rem;
    grid-column: 2;
    justify-self: center;
    width: min(100%, 320px);
    color: #465868;
    font-size: .9rem;
    font-weight: 800;
}
.measurement-side-choice .form-select {
    flex: 1 1 auto;
}
.size-side-panel {
    position: relative;
    height: var(--measure-board-height);
    min-height: var(--measure-board-height);
    padding: 0 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfeff;
}
.size-side-panel.side-disabled {
    opacity: .48;
    background: #f4f7f9;
}
.size-side-panel.side-disabled .circled-code {
    border-color: var(--muted);
    color: var(--muted);
}
.measure-field {
    position: absolute;
    top: calc(var(--measure-heading-offset) + (var(--field-y) * var(--measure-canvas-height)));
    left: 1rem;
    right: 1rem;
    display: grid;
    grid-template-columns: 34px max-content;
    gap: .5rem;
    align-items: center;
    transform: translateY(-50%);
    color: #465868;
    font-size: .9rem;
    font-weight: 800;
}
.left-side .measure-field {
    left: auto;
    justify-content: end;
}
.left-side .measure-field span {
    order: 1;
}
.left-side .measure-field .measure-input {
    order: 2;
}
.measure-field span {
    color: #163251;
    font-weight: 900;
    text-align: right;
}
.measure-field .circled-code {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 2px solid #163251;
    border-radius: 50%;
    text-align: center;
    line-height: 1;
}
.measure-field .form-control {
    min-height: 34px;
    padding-top: .3rem;
    padding-bottom: .3rem;
}
.length-measure-field {
    width: max-content;
    padding: .35rem;
    border: 1px dashed #b8dce5;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 16px rgba(21, 78, 92, .08);
}
.right-side .length-measure-field {
    left: auto;
    right: 1rem;
}
.left-side .length-measure-field {
    left: 1rem;
    right: auto;
    justify-content: start;
}
.measure-input {
    width: 7ch;
    max-width: 7ch;
    text-align: right;
}
.field-ct { --field-y: .07; }
.field-ch { --field-y: .17; }
.field-cg { --field-y: .295; }
.field-cf { --field-y: .36; }
.field-cd { --field-y: .50; }
.field-cc { --field-y: .58; }
.field-cb { --field-y: .705; }
.field-cy { --field-y: .775; }
.field-ca { --field-y: .835; }
.field-lg { --field-y: .44; }
.field-ld { --field-y: .66; }
.side-panel-heading {
    display: none;
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid var(--line);
}
.side-panel-heading span {
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 900;
}
.size-fields-board {
    position: relative;
    min-height: 680px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfeff;
}
.size-field {
    position: absolute;
    right: 1rem;
    display: grid;
    gap: .35rem;
    width: min(100% - 2rem, 340px);
    color: #465868;
    font-size: .9rem;
    font-weight: 800;
}
.size-cg { top: 10%; }
.size-cf { top: 20%; }
.size-cd { top: 35%; }
.size-cc { top: 50%; }
.size-cb { top: 68%; }
.size-ca { top: 78%; }
.size-ld { top: 43%; left: 1rem; right: auto; width: min(48%, 260px); }
.size-lg { top: 27%; left: 1rem; right: auto; width: min(48%, 260px); }
.wizard-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1rem;
}
.size-advice-panel h3 {
    margin: 0 0 .25rem;
    color: #1f3a4a;
    font-size: 1.1rem;
    font-weight: 900;
}
.size-advice-panel {
    min-width: 0;
}
.brand-advice-grid {
    display: grid;
    gap: 1rem;
    min-width: 0;
}
.brand-advice-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}
.brand-advice-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
}
.brand-advice-heading strong,
.brand-advice-heading span {
    display: block;
}
.brand-advice-heading strong {
    color: #163251;
    font-size: 1.05rem;
    font-weight: 900;
}
.brand-advice-heading span,
.brand-advice-heading small {
    color: var(--muted);
    font-weight: 700;
}
.advice-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
.advice-size-table {
    min-width: 920px;
}
.advice-size-table th {
    color: var(--muted);
    font-size: .76rem;
    text-transform: uppercase;
}
.advice-size-table .entered-size {
    display: block;
    margin-top: .15rem;
    color: #0d6efd;
    font-size: .85rem;
    font-weight: 900;
    text-transform: none;
}
.advice-size-table .size-match {
    --bs-table-bg: #d9fbe7;
    --bs-table-color: #14532d;
    border-left: 8px solid #22a35a;
    box-shadow: inset 0 0 0 2px rgba(34, 163, 90, .2);
}
.advice-size-table .size-match .small {
    color: #166534;
}
.advice-size-table td.size-value-match {
    color: #166534;
    background: #c8f7d8;
    font-weight: 900;
}
.advice-size-table td.size-mismatch {
    color: #b4232f !important;
    background: #fff1f2 !important;
    font-weight: 900;
}
.status-pill, .chip { display: inline-flex; align-items: center; min-height: 32px; padding: .25rem .65rem; border-radius: 999px; background: var(--soft); color: var(--brand-dark); font-weight: 800; }
.measurement-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.measurement-card { padding: .9rem; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; background: #fff; }
.measurement-card span, .measurement-card small { display: block; color: var(--muted); }
.history-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}
.auth-panel {
    max-width: 520px;
    margin: 2rem auto;
    border-top: 4px solid var(--brand);
}
.dossier-tabs {
    gap: .35rem;
    border-bottom-color: var(--line);
}
.dossier-tabs .nav-link {
    border-radius: 8px 8px 0 0;
    color: var(--muted);
    font-weight: 800;
}
.dossier-tabs .nav-link.active {
    color: var(--brand-dark);
    border-color: var(--line) var(--line) #ffffff;
    background: #ffffff;
}
.patient-summary dl {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: .6rem 1rem;
    margin: 0;
}
.patient-summary dt {
    color: var(--muted);
    font-weight: 800;
}
.patient-summary dd {
    margin: 0;
}
.print-measurement {
    display: none;
}
.print-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid #163251;
}
.print-header p {
    margin: 0 0 .25rem;
    color: #176fd1;
    font-weight: 800;
    text-transform: uppercase;
}
.print-header h1 {
    font-size: 1.55rem;
}
.print-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-top: .85rem;
}
.print-section {
    break-inside: avoid;
    padding: .7rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}
.print-section.wide {
    grid-column: 1 / -1;
}
.print-section h2 {
    margin-bottom: .45rem;
    font-size: 1rem;
}
.print-section dl {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: .25rem .6rem;
    margin: 0;
}
.print-section dt {
    color: #475569;
    font-weight: 800;
}
.print-section dd {
    margin: 0;
}
.print-section table {
    width: 100%;
    border-collapse: collapse;
}
.print-section th,
.print-section td {
    padding: .35rem .45rem;
    border: 1px solid #cbd5e1;
    text-align: left;
}
.print-section th {
    width: 22%;
    background: #f1f5f9;
}
#blazor-error-ui { display: none; position: fixed; right: 1rem; bottom: 1rem; z-index: 1000; max-width: 560px; padding: .85rem 1rem; border-radius: 8px; background: #7f1d1d; color: white; box-shadow: 0 14px 30px rgba(0, 0, 0, .22); }
#blazor-error-ui .dismiss { cursor: pointer; margin-left: 1rem; }

@media (max-width: 980px) {
    .dashboard-header, .page-heading, .section-title { align-items: flex-start; flex-direction: column; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .patient-filters { width: 100%; }
    .patient-filters .btn { flex: 1 1 0; }
    .metric-grid, .split-layout, .measurement-layout, .measurement-list { grid-template-columns: 1fr; }
    .measurement-meta-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1240px) {
    .measurement-side-choice {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .measurement-side-choice label {
        grid-column: 1 / -1;
    }
    .measurement-sizes-layout {
        --measure-canvas-height: clamp(520px, 70vh, 680px);
        --measure-board-height: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "drawing drawing"
            "right left";
        align-items: start;
    }
    .measurement-sizes-layout > .leg-board {
        grid-area: drawing;
        justify-self: center;
        width: min(100%, 560px);
    }
    .measurement-sizes-layout > .left-side {
        grid-area: right;
    }
    .measurement-sizes-layout > .right-side {
        grid-area: left;
    }
    .size-side-panel {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .75rem;
        height: auto;
        min-height: auto;
    }
    .side-unit {
        position: static;
        grid-column: 1 / -1;
        justify-self: start;
    }
    .side-panel-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: static;
        grid-column: 1 / -1;
        margin-bottom: .25rem;
    }
    .measure-field,
    .field-cg,
    .field-ct,
    .field-ch,
    .field-cf,
    .field-cd,
    .field-cc,
    .field-cb,
    .field-cy,
    .field-ca,
    .field-lg,
    .field-ld {
        position: static;
        transform: none;
    }
    .left-side .measure-field,
    .right-side .measure-field {
        justify-content: stretch;
    }
    .left-side .measure-field span,
    .left-side .measure-field .measure-input {
        order: initial;
    }
    .measure-field {
        grid-template-columns: 34px minmax(0, 7ch);
        left: auto;
        right: auto;
    }
    .length-measure-field,
    .left-side .length-measure-field,
    .right-side .length-measure-field {
        width: auto;
        justify-content: stretch;
    }
    .leg-board { position: static; height: auto; }
    .size-fields-board {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .85rem;
        min-height: auto;
        padding: 1rem;
    }
    .size-field,
    .size-ld,
    .size-lg {
        position: static;
        width: auto;
    }
}

@media (max-width: 640px) {
    h1 { font-size: 1.55rem; }
    .table-row { grid-template-columns: 1fr; }
    .table-head { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid-pair { grid-template-columns: 1fr; }
    .measurement-meta-strip { grid-template-columns: 1fr; }
    .measurement-side-choice {
        grid-template-columns: 1fr;
    }
    .measurement-sizes-layout {
        --measure-canvas-height: clamp(430px, 70vh, 560px);
        grid-template-columns: 1fr;
        grid-template-areas:
            "drawing"
            "right"
            "left";
    }
    .size-side-panel {
        grid-template-columns: 1fr;
    }
    .photo-panel-heading {
        align-items: stretch;
        flex-direction: column;
        gap: .5rem;
    }
    .photo-upload-button {
        width: 100%;
        justify-content: center;
    }
    .size-fields-board { grid-template-columns: 1fr; }
    .patient-summary dl { grid-template-columns: 1fr; }
}

@media print {
    @page {
        margin: 12mm;
    }

    html,
    body {
        background: #ffffff !important;
    }

    #blazor-error-ui {
        display: none !important;
    }

    .page {
        display: block !important;
    }

    main,
    .content {
        display: block !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .sidebar,
    .top-row,
    .content > :not(.print-measurement) {
        display: none !important;
    }

    .print-measurement {
        display: block !important;
        color: #111827;
        font-family: "Segoe UI", Arial, sans-serif;
        font-size: 11pt;
    }
}
