.ppg-app,
.ppg-app * {
    box-sizing: border-box;
}

.ppg-app {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    color: #111827;
    font-family: "ABC Diatype Regular", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: normal;
}

.ppg-header {
    margin-bottom: 32px;
}

.ppg-header h1,
.ppg-result-toolbar h1 {
    margin: 0 0 8px;
    color: #111827;
    font-family: inherit;
    font-size: 32px;
    font-weight: 700;
    line-height: normal;
}

.ppg-header > p {
    margin: 0 0 24px;
    color: #6b7280;
    font-size: 16px;
    line-height: normal;
}

.ppg-progress {
    display: flex;
    gap: 8px;
    height: 4px;
    margin-bottom: 8px;
}

.ppg-progress span {
    flex: 1;
    border-radius: 2px;
    background: #e5e7eb;
}

.ppg-progress span.is-complete {
    background: #3b82f6;
}

.ppg-step-label {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.ppg-card {
    margin-bottom: 24px;
    padding: 32px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}

.ppg-card > h2 {
    margin: 0 0 24px;
    color: #111827;
    font-family: inherit;
    font-size: 24px;
    font-weight: 600;
    line-height: normal;
}

.ppg-field {
    margin-bottom: 24px;
}

.ppg-field:last-child {
    margin-bottom: 0;
}

.ppg-field > label,
.ppg-section-label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    line-height: normal;
}

.ppg-section-label {
    margin-bottom: 12px;
}

.ppg-app input[type="text"],
.ppg-app input[type="number"],
.ppg-app input[type="date"],
.ppg-app select,
.ppg-app textarea {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px;
    color: #000;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    background: #fff;
    box-shadow: none;
    font-family: sans-serif;
    font-size: 16px;
    line-height: normal;
}

.ppg-app textarea {
    min-height: 112px;
    resize: vertical;
}

.ppg-app input:focus,
.ppg-app select:focus,
.ppg-app textarea:focus {
    border-color: #3b82f6;
}

.ppg-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ppg-grid-2 .ppg-field {
    margin-bottom: 0;
}

.ppg-child-card,
.ppg-subpanel {
    margin-bottom: 16px;
    padding: 20px;
    border-radius: 8px;
    background: #f9fafb;
}

.ppg-subpanel {
    margin-bottom: 24px;
}

.ppg-subpanel:last-child {
    margin-bottom: 0;
}

.ppg-child-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ppg-child-heading h3,
.ppg-subpanel h3,
.ppg-communication h3 {
    margin: 0 0 16px;
    color: #111827;
    font-family: inherit;
    font-size: 18px;
    font-weight: 600;
    line-height: normal;
}

.ppg-child-heading h3 {
    margin: 0;
}

.ppg-remove-child {
    padding: 0;
    border: 0;
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
}

.ppg-add-child {
    width: 100%;
    padding: 12px;
    border: 2px dashed #3b82f6;
    border-radius: 8px;
    background: #fff;
    color: #3b82f6;
    cursor: pointer;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
}

.ppg-choice {
    display: block;
    margin-bottom: 12px;
    padding: 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    cursor: pointer;
}

.ppg-choice:last-child {
    margin-bottom: 0;
}

.ppg-choice.is-selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.ppg-choice input,
.ppg-checkbox-choice input,
.ppg-inline-check input {
    width: auto;
    min-height: 0;
    margin: 0 12px 0 0;
    accent-color: #3b82f6;
}

.ppg-choice strong {
    font-weight: 600;
}

.ppg-choice p {
    margin: 4px 0 0 28px;
    color: #6b7280;
    font-size: 14px;
    line-height: normal;
}

.ppg-communication {
    margin-bottom: 24px;
}

.ppg-checkbox-choice {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 12px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    cursor: pointer;
}

.ppg-checkbox-choice.is-selected {
    background: #eff6ff;
}

.ppg-inline-check {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    color: #111827;
    cursor: pointer;
}

.ppg-help {
    margin: 8px 0 0;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
}

.ppg-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.ppg-nav button {
    flex: 1;
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: normal;
}

.ppg-prev {
    border: 2px solid #d1d5db;
    background: #fff;
    color: #374151;
}

.ppg-prev:disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

.ppg-next {
    border: 0;
    background: #3b82f6;
    color: #fff;
}

.ppg-result-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.ppg-result-toolbar h1 {
    margin: 0;
}

.ppg-edit-button {
    padding: 12px 24px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
}

.ppg-result-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.ppg-result-actions button {
    flex: 1;
    padding: 14px;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
}

.ppg-download-button {
    border: 0;
    background: #3b82f6;
    color: #fff;
}

.ppg-print-button {
    border: 2px solid #3b82f6;
    background: #fff;
    color: #3b82f6;
}

.ppg-plan-preview {
    padding: 48px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    font-family: Georgia, serif;
    font-size: 12px;
    line-height: 1.8;
}

.ppg-plan-preview > h1 {
    margin: 0 0 32px;
    color: #111827;
    font-family: "ABC Diatype Regular", sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.8;
    text-align: center;
}

.ppg-plan-section {
    margin-bottom: 32px;
}

.ppg-plan-section h2 {
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #111827;
    color: #111827;
    font-family: "ABC Diatype Regular", sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.8;
}

.ppg-plan-preview p {
    margin: 0;
    color: #111827;
    font-family: "ABC Diatype Regular", sans-serif;
    font-size: 12px;
    line-height: 1.8;
}

.ppg-plan-preview .ppg-spaced-line {
    margin-top: 16px;
}

.ppg-signatures {
    margin-top: 64px;
}

.ppg-signature {
    margin-top: 48px;
}

.ppg-signature-date {
    margin-top: 32px !important;
}

@media (max-width: 640px) {
    .ppg-app {
        padding: 28px 14px;
    }

    .ppg-card,
    .ppg-plan-preview {
        padding: 24px;
    }

    .ppg-grid-2 {
        grid-template-columns: 1fr;
    }

    .ppg-result-toolbar {
        align-items: flex-start;
        gap: 16px;
    }

    .ppg-result-actions,
    .ppg-nav {
        flex-direction: column;
    }
}

@media print {
    body * {
        visibility: hidden !important;
    }

    .ppg-plan-preview,
    .ppg-plan-preview * {
        visibility: visible !important;
    }

    .ppg-plan-preview {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 0;
        border: 0;
    }
}
