/* --- BlackCat Global Style v2.0 (Fix Layout) --- */
:root {
    --bg: #020617;
    --card: #0f172a;
    --primary: #3b82f6;
    --accent: #2dd4bf;
    --text: #f8fafc;
    --dim: #94a3b8;
    --border: #1e293b;
}

body {
    font-family: 'Sarabun', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.wrapper { width: 100%; max-width: 850px; }

/* Main Container: รองรับทั้ง 1 และ 2 คอลัมน์ */
.tool-section {
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    display: grid;
    grid-template-columns: 1fr; /* Default เป็น 1 คอลัมน์ */
    overflow: hidden;
}

/* ถ้าอยากให้มี 2 คอลัมน์ ให้เติม class 'split-view' ใน HTML */
.tool-section.split-view {
    grid-template-columns: 1fr 320px;
}

.left-panel { padding: 30px; }
.right-panel { 
    padding: 30px; 
    background: rgba(0, 0, 0, 0.3); 
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

h1 {
    color: var(--primary); font-size: 1.5em; text-transform: uppercase;
    letter-spacing: 2px; border-bottom: 2px solid var(--border);
    padding-bottom: 10px; margin-bottom: 25px; text-align: center;
}

/* --- Form Elements (จุดที่แก้ไข) --- */
.input-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: bold; color: var(--primary); font-size: 0.9em; }

/* ยุบรวม input และ textarea ไว้ด้วยกันเพื่อให้ขนาดเท่ากันเป๊ะ */
input[type="text"], 
input[type="number"], 
select, 
textarea {
    width: 100%;
    padding: 12px;
    background: #000;
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 8px;
    font-size: 1.1em;
    box-sizing: border-box; /* ป้องกัน padding ดันขอบพัง */
    transition: 0.3s;
    font-family: inherit;   /* ใช้ฟอนต์เดียวกับ body ไม่เบี้ยว */
    resize: vertical;      /* ยืดได้แค่แนวตั้ง */
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

/* Result Panel */
.result-panel {
    margin-top: 25px; padding: 20px; background: #111; border-radius: 12px;
    text-align: center; border: 2px solid var(--primary);
}
.main-res { font-size: 3em; font-weight: 800; color: var(--primary); }

.btn-back { display: block; text-align: center; margin-top: 25px; color: #475569; text-decoration: none; font-size: 0.9em; }

/* Responsive */
@media (max-width: 768px) {
    .tool-section.split-view { grid-template-columns: 1fr; }
    .right-panel { border-left: none; border-top: 1px solid var(--border); }
}