.izr-measurement-sheet {
    --izr-navy: #0b1f3a;
    --izr-text: #12233d;
    --izr-blue: #155eef;
    --izr-blue-dark: #0d47bd;
    --izr-blue-light: #f2f6ff;
    --izr-amber: #f5a524;
    --izr-border: #d9e2f1;
    --izr-muted: #5b6b82;
    --izr-danger: #b42318;
    --izr-danger-bg: #fff4f2;
    --izr-success: #067647;
    --izr-success-bg: #ecfdf3;
    box-sizing: border-box;
    width: 100%;
    margin: 2rem 0;
    overflow: hidden;
    border: 1px solid var(--izr-border);
    border-radius: 18px;
    background: #fff;
    color: var(--izr-text);
    box-shadow: 0 18px 50px rgba(11, 31, 58, 0.09);
    font: inherit;
}

.izr-measurement-sheet *,
.izr-measurement-sheet *::before,
.izr-measurement-sheet *::after {
    box-sizing: inherit;
}

.izr-measurement-sheet [hidden] {
    display: none !important;
}

.izr-measurement-sheet__header {
    padding: clamp(1.4rem, 4vw, 2.35rem);
    color: #fff;
    background:
        radial-gradient(circle at 92% 8%, rgba(245, 165, 36, 0.3), transparent 27%),
        linear-gradient(135deg, var(--izr-navy), #123f78);
}

.izr-measurement-sheet__header h2,
.izr-measurement-sheet__header p {
    max-width: 760px;
    margin: 0;
    color: inherit;
}

.izr-measurement-sheet__header h2 {
    margin-top: 0.35rem;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    line-height: 1.15;
}

.izr-measurement-sheet__header h2 + p {
    margin-top: 0.75rem;
    color: #dfe9f8;
}

.izr-measurement-sheet__eyebrow {
    margin: 0;
    color: var(--izr-blue-dark);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.izr-measurement-sheet__header .izr-measurement-sheet__eyebrow {
    color: #ffcf73;
}

.izr-measurement-sheet__app,
.izr-measurement-sheet__notice {
    padding: clamp(1rem, 3vw, 1.8rem);
}

.izr-measurement-sheet__loading,
.izr-measurement-sheet__notice {
    margin: 0;
}

.izr-measurement-form {
    display: grid;
    gap: 1rem;
}

.izr-sheet-step {
    padding: clamp(1rem, 3vw, 1.4rem);
    border: 1px solid var(--izr-border);
    border-radius: 14px;
    background: #fff;
}

.izr-sheet-step__heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
    align-items: start;
    margin-bottom: 1.1rem;
}

.izr-sheet-step__heading--actions {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.izr-sheet-step__heading h3,
.izr-sheet-step__heading p,
.izr-openings-section__heading h4,
.izr-openings-section__heading p {
    margin: 0;
}

.izr-sheet-step__heading h3 {
    font-size: 1.18rem;
}

.izr-sheet-step__heading p,
.izr-openings-section__heading p,
.izr-sheet-correction p {
    margin-top: 0.2rem;
    color: var(--izr-muted);
    font-size: 0.88rem;
}

.izr-sheet-step__number {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--izr-blue);
    font-weight: 850;
}

.izr-sheet-grid {
    display: grid;
    gap: 0.9rem;
}

.izr-sheet-grid--project {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.izr-sheet-grid--dimensions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.izr-sheet-field--wide {
    grid-column: span 2;
}

.izr-sheet-field {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    margin: 0;
    color: var(--izr-text);
    font-size: 0.9rem;
    font-weight: 720;
}

.izr-sheet-field small {
    color: var(--izr-muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.izr-sheet-field input,
.izr-sheet-field select {
    width: 100%;
    min-height: 44px;
    margin: 0;
    border: 1px solid #b8c7dc;
    border-radius: 10px;
    background: #fff;
    color: var(--izr-text);
    font: inherit;
    font-weight: 520;
    line-height: 1.2;
}

.izr-sheet-field input {
    padding: 0.65rem 0.75rem;
}

.izr-sheet-field select {
    padding: 0.65rem 2rem 0.65rem 0.75rem;
}

.izr-sheet-input-wrap {
    position: relative;
    display: block;
}

.izr-sheet-input-wrap input {
    padding-right: 3.2rem;
}

.izr-sheet-input-wrap small {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    color: var(--izr-muted);
    pointer-events: none;
}

.izr-sheet-field input:focus,
.izr-sheet-field select:focus,
.izr-sheet-button:focus-visible,
.izr-sheet-icon-button:focus-visible,
.izr-sheet-check input:focus-visible + span {
    outline: 3px solid rgba(21, 94, 239, 0.25);
    outline-offset: 2px;
    border-color: var(--izr-blue);
}

.izr-sheet-field input:disabled,
.izr-sheet-field select:disabled {
    cursor: not-allowed;
    background: #f2f4f7;
    color: #7a8699;
}

.izr-sheet-button,
.izr-sheet-icon-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    margin: 0;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.izr-sheet-button:disabled,
.izr-sheet-icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.izr-sheet-button--primary {
    padding: 0.78rem 1.1rem;
    color: #fff;
    background: var(--izr-blue);
}

.izr-sheet-button--primary:hover {
    background: var(--izr-blue-dark);
}

.izr-sheet-button--secondary,
.izr-sheet-button--small {
    padding: 0.68rem 0.9rem;
    border: 1px solid #b8c7dc;
    color: var(--izr-blue-dark);
    background: #fff;
}

.izr-sheet-button--secondary:hover,
.izr-sheet-button--small:hover {
    border-color: var(--izr-blue);
    background: var(--izr-blue-light);
}

.izr-sheet-button--small {
    min-height: 36px;
    padding: 0.5rem 0.7rem;
    font-size: 0.82rem;
}

.izr-sheet-button--quiet,
.izr-sheet-icon-button {
    padding: 0.6rem 0.75rem;
    color: #5d2938;
    background: transparent;
}

.izr-sheet-button--quiet:hover,
.izr-sheet-icon-button:hover {
    background: #fff1f3;
}

.izr-sheet-rooms {
    display: grid;
    gap: 1rem;
}

.izr-room-card {
    min-width: 0;
    margin: 0;
    padding: 1rem;
    border: 1px solid #cbd8ea;
    border-radius: 13px;
    background: #fbfcff;
}

.izr-room-card > legend {
    padding: 0 0.45rem;
    color: var(--izr-navy);
    font-size: 1rem;
    font-weight: 850;
}

.izr-room-card__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 0.9rem;
}

.izr-sheet-scope {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.85rem;
}

.izr-sheet-check {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}

.izr-sheet-check input {
    position: absolute;
    opacity: 0;
}

.izr-sheet-check span {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 0.55rem 0.8rem;
    border: 1px solid #b8c7dc;
    border-radius: 999px;
    background: #fff;
    color: var(--izr-text);
    font-size: 0.86rem;
    font-weight: 750;
}

.izr-sheet-check input:checked + span {
    border-color: var(--izr-blue);
    color: var(--izr-blue-dark);
    background: var(--izr-blue-light);
    box-shadow: inset 0 0 0 1px var(--izr-blue);
}

.izr-openings-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--izr-border);
}

.izr-openings-section__heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: start;
}

.izr-openings-section__heading h4 {
    color: var(--izr-navy);
    font-size: 0.98rem;
}

.izr-sheet-empty {
    margin: 0.75rem 0 0;
    padding: 0.7rem 0.8rem;
    border-radius: 8px;
    color: var(--izr-muted);
    background: #f4f7fb;
    font-size: 0.84rem;
}

.izr-openings-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.izr-opening-row {
    display: grid;
    grid-template-columns: 1.05fr 0.65fr 1fr 1fr auto;
    gap: 0.6rem;
    align-items: end;
    padding: 0.75rem;
    border: 1px solid var(--izr-border);
    border-radius: 10px;
    background: #fff;
}

.izr-sheet-correction {
    margin-top: 0.9rem;
    padding: 0.75rem;
    border: 1px dashed #b8c7dc;
    border-radius: 10px;
    background: #fff;
}

.izr-sheet-correction summary {
    cursor: pointer;
    color: var(--izr-blue-dark);
    font-size: 0.88rem;
    font-weight: 800;
}

.izr-sheet-correction .izr-sheet-field {
    max-width: 320px;
    margin-top: 0.75rem;
}

.izr-room-preview {
    display: block;
    margin-top: 0.9rem;
    padding: 0.7rem 0.8rem;
    border-left: 4px solid var(--izr-blue);
    border-radius: 7px;
    color: var(--izr-navy);
    background: var(--izr-blue-light);
    font-size: 0.87rem;
    font-weight: 750;
}

.izr-room--ceiling-only .izr-openings-section,
.izr-room--ceiling-only .izr-sheet-correction {
    opacity: 0.55;
}

.izr-sheet-form-actions,
.izr-sheet-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.izr-sheet-form-actions {
    padding-top: 0.2rem;
}

.izr-sheet-errors,
.izr-sheet-stale {
    margin: 0;
    padding: 0.85rem 1rem;
    border-radius: 10px;
}

.izr-sheet-errors {
    border: 1px solid #f3b7b1;
    color: #7a271a;
    background: var(--izr-danger-bg);
}

.izr-sheet-errors p,
.izr-sheet-errors ul {
    margin: 0;
}

.izr-sheet-errors ul {
    margin-top: 0.35rem;
    padding-left: 1.2rem;
}

.izr-sheet-stale {
    border: 1px solid #f4ce87;
    color: #7a4c00;
    background: #fff8e8;
    font-size: 0.88rem;
    font-weight: 700;
}

.izr-sheet-results {
    margin-top: 1.2rem;
    padding: clamp(1rem, 3vw, 1.4rem);
    border: 2px solid #b9cdf8;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8faff, #fff 180px);
}

.izr-sheet-results__heading {
    display: flex;
    gap: 1rem;
    align-items: start;
    justify-content: space-between;
}

.izr-sheet-results__heading h3,
.izr-sheet-results__heading p {
    margin: 0;
}

.izr-sheet-results__heading h3 {
    margin-top: 0.25rem;
    font-size: 1.35rem;
}

.izr-sheet-results__heading [data-result-project] {
    margin-top: 0.35rem;
    color: var(--izr-muted);
    font-size: 0.88rem;
}

.izr-sheet-badge {
    flex: 0 0 auto;
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    color: var(--izr-blue-dark);
    background: #e8efff;
    font-size: 0.78rem;
    font-weight: 850;
}

.izr-sheet-totals {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 1rem;
}

.izr-sheet-totals > div {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    padding: 0.9rem;
    border: 1px solid var(--izr-border);
    border-radius: 11px;
    background: #fff;
}

.izr-sheet-totals span {
    color: var(--izr-muted);
    font-size: 0.78rem;
}

.izr-sheet-totals strong {
    color: var(--izr-navy);
    font-size: clamp(1rem, 2vw, 1.28rem);
    line-height: 1.2;
}

.izr-sheet-totals strong span {
    color: inherit;
    font-size: inherit;
}

.izr-sheet-layer-note {
    margin: 0.8rem 0 0;
    padding: 0.75rem 0.85rem;
    border-radius: 9px;
    color: #3d4b61;
    background: #f3f6fa;
    font-size: 0.86rem;
}

.izr-sheet-table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
    border: 1px solid var(--izr-border);
    border-radius: 10px;
    background: #fff;
}

.izr-sheet-table {
    width: 100%;
    min-width: 840px;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    color: var(--izr-text);
    font-size: 0.78rem;
}

.izr-sheet-table caption {
    padding: 0.7rem 0.8rem;
    color: var(--izr-muted);
    font-weight: 700;
    text-align: left;
}

.izr-sheet-table th,
.izr-sheet-table td {
    padding: 0.65rem 0.6rem;
    border-top: 1px solid var(--izr-border);
    text-align: right;
    vertical-align: top;
    white-space: nowrap;
}

.izr-sheet-table th:first-child,
.izr-sheet-table td:first-child,
.izr-sheet-table th:nth-child(2),
.izr-sheet-table td:nth-child(2) {
    text-align: left;
}

.izr-sheet-table thead th,
.izr-sheet-table tfoot th,
.izr-sheet-table tfoot td {
    color: var(--izr-navy);
    background: #f2f6ff;
    font-weight: 800;
}

.izr-sheet-result-actions {
    margin-top: 1rem;
}

.izr-sheet-transfer-status {
    min-height: 1.4em;
    margin: 0.65rem 0 0;
    color: var(--izr-muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.izr-sheet-transfer-status[data-kind="success"] {
    color: var(--izr-success);
}

.izr-sheet-transfer-status[data-kind="error"] {
    color: var(--izr-danger);
}

@media (max-width: 820px) {
    .izr-sheet-grid--project {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .izr-sheet-totals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .izr-opening-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .izr-opening-row .izr-sheet-icon-button {
        grid-column: span 2;
        justify-self: start;
    }
}

@media (max-width: 600px) {
    .izr-measurement-sheet {
        margin: 1.25rem 0;
        border-radius: 13px;
    }

    .izr-room-card__top,
    .izr-openings-section__heading {
        grid-template-columns: minmax(0, 1fr);
    }

    .izr-sheet-step__heading--actions {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .izr-sheet-step__heading--actions .izr-sheet-button,
    .izr-openings-section__heading .izr-sheet-button {
        width: 100%;
    }

    .izr-sheet-step__heading--actions .izr-sheet-button {
        grid-column: 1 / -1;
    }

    .izr-sheet-grid--project,
    .izr-sheet-grid--dimensions,
    .izr-opening-row,
    .izr-sheet-totals {
        grid-template-columns: minmax(0, 1fr);
    }

    .izr-sheet-field--wide,
    .izr-opening-row .izr-sheet-icon-button {
        grid-column: auto;
    }

    .izr-room-card__top .izr-sheet-icon-button,
    .izr-opening-row .izr-sheet-icon-button {
        justify-self: start;
    }

    .izr-sheet-results__heading {
        display: grid;
    }

    .izr-sheet-badge {
        justify-self: start;
    }

    .izr-sheet-form-actions .izr-sheet-button,
    .izr-sheet-result-actions .izr-sheet-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .izr-measurement-sheet * {
        scroll-behavior: auto !important;
    }
}

@media print {
    body.izr-sheet-printing > * {
        visibility: hidden !important;
    }

    body.izr-sheet-printing .izr-measurement-sheet,
    body.izr-sheet-printing .izr-measurement-sheet * {
        visibility: visible !important;
    }

    body.izr-sheet-printing .izr-measurement-sheet {
        position: absolute;
        inset: 0 auto auto 0;
        width: 100%;
        margin: 0;
        border: 0;
        box-shadow: none;
    }

    body.izr-sheet-printing .izr-measurement-sheet__header,
    body.izr-sheet-printing .izr-measurement-form,
    body.izr-sheet-printing .izr-sheet-result-actions,
    body.izr-sheet-printing .izr-sheet-transfer-status {
        display: none !important;
    }

    body.izr-sheet-printing .izr-measurement-sheet__app,
    body.izr-sheet-printing .izr-sheet-results {
        padding: 0;
        border: 0;
        background: #fff;
    }

    body.izr-sheet-printing .izr-sheet-table-wrap {
        overflow: visible;
    }

    body.izr-sheet-printing .izr-sheet-table {
        min-width: 0;
        font-size: 8pt;
    }
}
