.whp {
    --whp-primary: #245f80;
    --whp-primary-dark: #19445d;
    --whp-text: #22313b;
    --whp-muted: #637480;
    --whp-border: #d5dfe5;
    --whp-surface: #f5f8fa;

    width: 100%;
    max-width: 1500px;
    margin: 24px auto;
    padding: clamp(14px, 3vw, 28px);

    border: 1px solid var(--whp-border);
    border-radius: 18px;

    background: #fff;
    color: var(--whp-text);

    font: inherit;
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
}

.whp,
.whp * {
    box-sizing: border-box;
}

.whp [hidden] {
    display: none !important;
}

.whp .whp__header {
    margin-bottom: 22px;
}

.whp .whp__header h2 {
    margin: 0 0 8px;
    color: var(--whp-text);
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.2;
}

.whp .whp__header p {
    margin: 0 0 8px;
}

.whp .whp__eyebrow {
    color: var(--whp-primary);
    font-size: 13px;
    font-weight: 700;
}

.whp .whp__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.whp button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    margin: 0;
    padding: 8px 12px;

    border: 1px solid var(--whp-border);
    border-radius: 8px;

    background: #fff;
    color: var(--whp-text);
    box-shadow: none;

    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;

    text-align: center;
    text-transform: none;
    white-space: normal;
    cursor: pointer;
}

.whp button:hover:not(:disabled) {
    border-color: #a9bfcc;
    background: #edf4f8;
}

.whp button.whp__primary,
.whp button[aria-pressed="true"] {
    border-color: var(--whp-primary);
    background: var(--whp-primary);
    color: #fff;
}

.whp button.whp__primary:hover:not(:disabled),
.whp button[aria-pressed="true"]:hover:not(:disabled) {
    background: var(--whp-primary-dark);
    color: #fff;
}

.whp button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.whp button.whp__danger {
    color: #a32626;
}

.whp :is(input, select, button, summary):focus-visible {
    outline: 3px solid #3284d0;
    outline-offset: 2px;
}

.whp .whp__panel {
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--whp-border);
    border-radius: 12px;
    background: var(--whp-surface);
}

.whp .whp__panel h3 {
    margin: 0 0 12px;
    color: var(--whp-text);
    font-size: 17px;
}

.whp .whp__palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 7px;
    margin: 12px 0 18px;
}

.whp button.whp__item {
    display: flex;
    flex-direction: column;
    gap: 5px;

    min-width: 0;
    min-height: 80px;
    padding: 7px 4px;

    font-size: 11px;
    overflow-wrap: anywhere;
}

.whp .whp__item svg {
    display: block;
    width: 48px;
    height: 40px;
    pointer-events: none;
}

.whp .whp__item span {
    pointer-events: none;
}

.whp .whp__board {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    min-height: 380px;
    max-height: 800px;

    overflow: hidden;

    border: 1px solid var(--whp-border);
    border-radius: 12px;
    background: #f7f8fa;
}

.whp .whp__canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;

    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.whp .whp__canvas:focus-visible {
    outline: 3px solid #3284d0;
    outline-offset: -4px;
}

.whp .whp__canvas[data-tool="wall"],
.whp .whp__canvas[data-tool="door"],
.whp .whp__canvas[data-tool="window"] {
    cursor: crosshair;
}

.whp .whp__canvas[data-tool="pan"] {
    cursor: grab;
}

.whp .whp__canvas[data-tool="select"] [data-kind="furniture"],
.whp .whp__canvas[data-tool="select"] [data-kind="opening"],
.whp .whp__canvas[data-tool="select"] [data-kind="wall"] {
    cursor: move;
}

.whp .whp__canvas [data-handle] {
    cursor: crosshair;
}

.whp .whp__bottom {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    align-items: start;
    gap: 16px;
    margin-top: 18px;
}

.whp .whp__form {
    margin: 0;
}

.whp .whp__form label {
    display: block;
    min-width: 0;
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 600;
}

.whp .whp__form input,
.whp .whp__form select,
.whp .whp__select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 42px;

    margin: 4px 0 0;
    padding: 8px;

    border: 1px solid var(--whp-border);
    border-radius: 7px;

    background: #fff;
    color: var(--whp-text);
    box-shadow: none;

    font: inherit;
    font-size: 16px;
}

.whp .whp__form input[type="color"] {
    height: 42px;
    padding: 3px;
}

.whp .whp__fields,
.whp .whp__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
}

.whp .whp__fields .whp__wide {
    grid-column: 1 / -1;
}

.whp .whp__inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
}

.whp .whp__inline input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--whp-primary);
}

.whp .whp__inline select {
    min-height: 36px;
    max-width: 190px;
    padding: 5px;
    border: 1px solid var(--whp-border);
    border-radius: 7px;
    background: #fff;
    color: var(--whp-text);
    font: inherit;
    font-size: 13px;
}

.whp .whp__small {
    color: var(--whp-muted);
    font-size: 12px;
}

.whp .whp__status {
    min-height: 24px;
    margin: 12px 0 0;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.whp .whp__status[data-error="true"] {
    color: #b42318;
}

.whp .whp__dirty {
    color: var(--whp-muted);
    font-size: 12px;
}

.whp .whp__footer {
    margin-top: 22px;
    padding-top: 15px;
    border-top: 1px solid var(--whp-border);
    color: var(--whp-muted);
    font-size: 12px;
}

.whp .whp__footer p {
    margin: 0 0 8px;
}

@media (max-width: 650px) {
    .whp {
        margin: 16px auto;
        padding: 12px;
        border-radius: 12px;
    }

    .whp .whp__toolbar > button {
        flex: 1 1 auto;
    }

    .whp .whp__palette {
        grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
    }

    .whp button.whp__item {
        min-height: 74px;
        font-size: 10px;
    }

    .whp .whp__item svg {
        width: 42px;
        height: 35px;
    }

    .whp .whp__board {
        min-height: 380px;
    }

    .whp .whp__bottom {
        grid-template-columns: minmax(0, 1fr);
    }

    .whp .whp__inline {
        min-height: 32px;
    }
}