.p2d-wrap {
    border: 1px solid #d8d8d8;
    border-radius: 12px;
    padding: 18px;
    margin: 22px 0;
    background: #fff;
    max-width: 100%;
}

.p2d-wrap h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.p2d-help {
    margin-top: 0;
    color: #666;
    font-size: 14px;
}

.p2d-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
}

.p2d-panel {
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    padding: 12px;
    background: #fafafa;
    max-width: 100%;
}

.p2d-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.p2d-buttons .button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.p2d-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding-top: 12px;
    border-top: 1px solid #e6e6e6;
    font-size: 14px;
}

.p2d-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    font-size: 12px;
    color: #555;
}

.p2d-list span {
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    background: #fff;
    padding: 4px 8px;
}

.p2d-canvas-box {
    position: relative;
    overflow: auto;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    background: #fff;
    max-width: 100%;
}

.p2d-canvas-box canvas {
    width: 100%;
    min-width: 760px;
    height: auto;
    display: block;
    background: #fff;
    cursor: crosshair;
}

.p2d-bubble {
    position: absolute;
    z-index: 20;
    width: 244px;
    padding: 12px;
    border: 1px solid #d2d2d2;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(0,0,0,.16);
    font-size: 13px;
}

.p2d-bubble[hidden] {
    display: none;
}

.p2d-bubble-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.p2d-bubble-close {
    border: 0;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.p2d-bubble label {
    display: block;
    margin: 8px 0;
    color: #333;
}

.p2d-bubble label > span {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.p2d-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.p2d-input-wrap input {
    width: 100%;
    min-height: 34px;
}

.p2d-input-wrap span {
    color: #555;
    font-size: 13px;
    white-space: nowrap;
}

.p2d-bubble-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.p2d-bubble-actions-bottom {
    margin-top: 8px;
}

.p2d-bubble-actions .button {
    flex: 1;
    font-size: 12px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
}

.p2d-bubble-actions .button.is-active {
    background: #f9a825;
    border-color: #f9a825;
    color: #111;
}

.p2d-bubble-note {
    margin: 10px 0 0;
    font-size: 11px;
    color: #666;
    line-height: 1.35;
}

.p2d-json-output {
    width: 100%;
    min-height: 90px;
    margin-top: 12px;
    font-family: monospace;
}

@media (max-width: 760px) {
    .p2d-wrap {
        padding: 12px;
    }

    .p2d-canvas-box canvas {
        min-width: 680px;
    }

    .p2d-bubble {
        width: 228px;
    }
}

.p2d-color-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
}

.p2d-color-controls .button.is-active,
.p2d-bubble-actions .button.is-active {
    background: #f9a825;
    border-color: #f9a825;
    color: #111;
}

.p2d-bubble-actions .button:disabled {
    opacity: .45;
    cursor: not-allowed;
}
