/* ⭐️ ลบ style body ทิ้ง เพื่อไม่ให้กระทบเมนูเว็บหลัก */

/* ใช้ Class เฉพาะเจาะจง เพื่อไม่ให้ตีกับ Theme */
.teak-box {
    max-width: 650px;
    margin: 0 auto; /* จัดกึ่งกลาง */
    background: #ffffff;
    padding: 26px;
    border-radius: 22px;
    box-shadow: 0 6px 22px rgba(0,0,0,0.07);
    font-family: 'Sarabun', sans-serif;
    box-sizing: border-box; /* สำคัญ: ให้ padding รวมอยู่ในความกว้าง */
}

/* บังคับให้ทุกอย่างในกล่องนี้ใช้ box-sizing แบบเดียวกัน */
.teak-box * {
    box-sizing: border-box;
}

.teak-title {
    text-align:center;
    font-size: 22px;
    font-weight: 600;
    color: #1a4b82;
    margin-bottom: 10px;
    line-height: 1.4;
}

.teak-sub {
    text-align:center;
    color:#555;
    margin-bottom: 25px;
    font-size: 16px;
}

.teak-label { 
    margin-top: 18px; 
    display:block; 
    font-weight: 600; 
    color: #333;
    margin-bottom: 6px;
}

/* ⭐️ แก้ไขปัญหา Dropdown แคบ */
.teak-input {
    width: 100% !important; /* บังคับเต็มความกว้าง */
    max-width: 100% !important;
    display: block !important;
    padding: 12px 15px !important; /* เพิ่มพื้นที่ด้านใน */
    border-radius: 12px !important;
    border: 1px solid #ddd !important; 
    margin-top: 0;
    font-size: 16px !important; /* ตัวหนังสือใหญ่ขึ้น */
    font-family: 'Sarabun', sans-serif !important;
    height: auto !important; /* ให้ความสูงยืดตามเนื้อหา */
    min-height: 48px; /* ความสูงขั้นต่ำเพื่อให้กดง่าย */
    background-color: #fff;
    color: #333;
}

/* เพิ่ม Focus effect ให้ดูดี */
.teak-input:focus {
    border-color: #1a73e8 !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.teak-small {
    font-size: 13px;
    color: #777;
    margin-top: 6px;
    display: block;
    line-height: 1.4;
}

/* ปุ่มหลัก */
.teak-btn {
    width:100%; 
    padding:14px; 
    margin-top:30px; 
    border:none;
    background:#1a73e8; 
    border-radius:12px; 
    color:#fff;
    font-size:18px; 
    font-weight:600; 
    cursor: pointer;
    font-family: 'Sarabun', sans-serif;
    transition: background 0.3s;
}
.teak-btn:hover { background: #155db5; }

/* --- ส่วนผลลัพธ์ --- */
#teak-result-box {
    margin-top: 30px; 
    padding: 25px; 
    background:#f9f9f9;
    border-radius: 18px; 
    display:none;
}

/* จัดการ Layout ผลลัพธ์ */
.result-line {
    padding:12px 0;
    border-bottom:1px solid #ddd;
    display:flex; 
    justify-content:space-between;
    align-items: center;
    font-size:16px;
    flex-wrap: wrap; /* ยืดหยุ่นถ้ารูปหน้าจอเล็ก */
    gap: 10px;
}
.result-line:last-child { border-bottom:none; }

/* สีตัวเลข */
.text-positive { color: #2e7d32; font-weight: 700; }
.text-negative { color: #c62828; font-weight: 700; }
.text-total-positive { color: #1a4b82; font-weight: 700; font-size: 18px; }
.text-total-negative { color: #c62828; font-weight: 700; font-size: 18px; }

.result-total-line {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    background: #e9ecef;
    display:flex; 
    justify-content:space-between;
    align-items: center;
    font-size:18px;
    font-weight: 600;
    flex-wrap: wrap;
}

.teak-tree-number {
    font-size: 28px;
    color:#2e7d32;
    font-weight: 700;
    display: block;
}

.result-disclaimer {
    font-size:12px;
    color:#888;
    margin-top:20px;
    text-align:center;
    line-height:1.6;
}

/* ปุ่มดาวน์โหลด PDF */
.pdf-btn {
    width:100%; 
    padding: 14px;
    margin-top: 15px;
    border-radius:12px;
    border:none;
    font-size:16px;
    font-weight:600;
    background:#0f9d58; 
    color:#fff; 
    cursor: pointer;
    font-family: 'Sarabun', sans-serif;
    transition: background 0.3s;
}
.pdf-btn:hover { background: #0a7d42; }
.pdf-btn:disabled { background: #ccc; cursor: not-allowed; }

/* Responsive สำหรับมือถือ */
@media (max-width: 600px) {
    .teak-box {
        padding: 20px;
    }
    .result-line, .result-total-line {
        flex-direction: column;
        align-items: flex-start;
    }
    .result-line > div:last-child,
    .result-total-line > div:last-child {
        align-self: flex-end;
        margin-top: 5px;
    }
}