.sap-poll-box {
    max-width: 640px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 26px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    font-family: inherit;
    margin: 20px 0;
}

.sap-survey-main-title {
    margin: 0 0 22px 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.sap-question-block {
    margin-bottom: 26px;
}

.sap-poll-title {
    margin: 0 0 14px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

/* รูปแบบตัวเลือกข้อความปกติ */
.sap-option-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #334155;
}

.sap-option-label:hover {
    background-color: #f8fafc;
    border-color: #3b82f6;
}

.sap-option-label input[type="radio"] {
    margin-right: 12px;
    accent-color: #2563eb;
    transform: scale(1.15);
}

/* รูปแบบการ์ดรูปภาพ (Grid 2 คอลัมน์) */
.sap-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.sap-image-card {
    cursor: pointer;
    display: block;
    margin: 0;
}

.sap-image-card input[type="radio"] {
    display: none; /* ซ่อนปุ่ม radio เดิม ใช้กรอบการ์ดแทน */
}

.sap-card-inner {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sap-image-card:hover .sap-card-inner {
    border-color: #93c5fd;
    transform: translateY(-2px);
}

/* เมื่อลูกค้ากดเลือกรูปภาพนั้น */
.sap-image-card input[type="radio"]:checked + .sap-card-inner {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.sap-card-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.sap-card-no-img {
    width: 100%;
    height: 150px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.85rem;
}

.sap-card-caption {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
}

.sap-radio-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: inline-block;
    flex-shrink: 0;
    position: relative;
}

.sap-image-card input[type="radio"]:checked + .sap-card-inner .sap-radio-dot {
    border-color: #2563eb;
    background-color: #2563eb;
    box-shadow: inset 0 0 0 3px #ffffff;
}

/* กล่องคำถามปลายเปิด */
.sap-open-question-box {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed #cbd5e1;
}

.sap-open-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.sap-open-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #1e293b;
    resize: vertical;
}

.sap-open-textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.sap-submit-btn {
    width: 100%;
    padding: 14px;
    margin-top: 18px;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.sap-submit-btn:hover {
    background-color: #1d4ed8;
}

.sap-submit-btn:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}

/* ส่วนแสดงผลกราฟเปอร์เซ็นต์หลังโหวต */
.sap-result-q-group {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.sap-result-q-title {
    margin: 0 0 12px 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
}

.sap-result-item {
    margin-bottom: 12px;
}

.sap-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.95rem;
    color: #334155;
}

.sap-opt-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sap-result-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.sap-opt-percent {
    font-weight: 700;
    color: #2563eb;
}

.sap-progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.sap-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border-radius: 999px;
    transition: width 0.6s ease;
}

.sap-q-total-note {
    font-size: 0.8rem;
    color: #64748b;
    text-align: right;
    margin-top: 6px;
}

.sap-total-votes {
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #16a34a;
    text-align: center;
}