.wctcc-builder {
    max-width: 980px;
    margin: 22px 0;
    color: #111;
}

.wctcc-toolbar {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid #d8d8d8;
    border-bottom: 0;
    background: #f8f8f8;
}

.wctcc-tool-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.wctcc-tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 10px;
}

.wctcc-tool-grid label {
    display: grid;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
}

.wctcc-tool-grid select,
.wctcc-tool-grid input {
    width: 100%;
    min-height: 34px;
}

.wctcc-choice-group {
    border: 0;
    padding: 0;
    margin: 0;
}

.wctcc-choice-group legend,
.wctcc-help {
    display: none;
}

.wctcc-widths {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wctcc-width-tile {
    position: relative;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
}

.wctcc-width-tile input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wctcc-width-tile > span:first-of-type {
    display: flex;
    min-width: 72px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border: 1px solid #777;
    background: #fff;
}

.wctcc-width-tile small {
    display: block;
    color: #9c008d;
    line-height: 1.2;
}

.wctcc-width-tile input:checked + span {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.wctcc-canvas-shell {
    padding: 18px;
    border: 1px solid #d8d8d8;
    background: #ececec;
}

.wctcc-canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 900 / 560;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
    touch-action: none;
}

.wctcc-text-item {
    position: absolute;
    min-height: 1.15em;
    padding: 2px 4px;
    border: 1px solid transparent;
    line-height: 1.05;
    white-space: nowrap;
    cursor: move;
    outline: 0;
    user-select: text;
    overflow: hidden;
}

.wctcc-text-item:focus,
.wctcc-text-item.is-active {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.16);
}

.wctcc-canvas-hint {
    margin: 8px 0 14px;
    font-size: 13px;
    color: #555;
}

.wctcc-field {
    margin: 0 0 14px;
}

.wctcc-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.wctcc-field textarea {
    width: 100%;
}

.wctcc-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 10px 0 0;
}

@media (max-width: 820px) {
    .wctcc-tool-grid {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }
}

@media (max-width: 520px) {
    .wctcc-toolbar {
        padding: 10px;
    }

    .wctcc-tool-grid {
        grid-template-columns: 1fr;
    }

    .wctcc-canvas-shell {
        padding: 10px;
    }
}
