.fat-wrapper {
    /* Đóng gói toàn bộ biến vào wrapper để không ảnh hưởng bên ngoài */
    --color-1: #E27D60; --color-2: #85DCBA; --color-3: #E8A87C; --color-4: #C38D9E; --color-5: #41B3A3;
    --color-6: #E9C46A; --color-7: #F4A261; --color-8: #E76F51; --color-9: #D4A373; --color-10: #FAEDCB;
    --color-11: #A8DADC; --color-12: #457B9D; --color-13: #1D3557; --color-14: #2A9D8F; --color-15: #264653;
    --color-16: #C9E4DE; --color-17: #A3B18A; --color-18: #588157; --color-19: #A5A58D; --color-20: #F4F1DE;

    --brutal-border: 3px solid #000;
    --brutal-shadow: 5px 5px 0px #000;
    
    max-width: 1000px; 
    margin: 0 auto;
    font-family: system-ui, -apple-system, sans-serif;
    color: #000;
    background: #fff;
    padding: 25px;
    border: var(--brutal-border);
    border-radius: 16px;
    box-shadow: 7px 7px 0px #000;
}

.fat-wrapper * { box-sizing: border-box; }

.fat-header {
    background: #000; padding: 20px; color: #fff;
    border: var(--brutal-border); border-radius: 12px;
    text-align: center; margin-bottom: 25px; box-shadow: var(--brutal-shadow);
}
.fat-header h2 { margin: 0 0 10px 0; font-size: 2rem; font-weight: 900; color: var(--color-11); text-transform: uppercase; font-family: 'Bungee', 'Courier New', cursive;}
.fat-header p { margin: 0; font-weight: 600; font-size: 1rem; color: var(--color-16);}

.fat-layout { display: flex; flex-direction: column; gap: 25px; }
.fat-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px;}
@media (min-width: 850px) { .fat-layout { flex-direction: row; align-items: stretch; } }

/* CARDS & BG */
.fat-card { padding: 20px; border: var(--brutal-border); border-radius: 12px; box-shadow: var(--brutal-shadow); display: flex; flex-direction: column; transition: 0.3s;}
.fat-bg-white { background: #fff; }
.fat-bg-10 { background: var(--color-10); }
.fat-bg-11 { background: var(--color-11); }
.fat-bg-16 { background: var(--color-16); }

.fat-flex-between { display: flex; justify-content: space-between; align-items: center;}
.fat-divider { border: 0; border-top: 2px dashed #000; margin: 15px 0; }

/* TYPOGRAPHY */
.fat-label { display: block; font-weight: 900; text-transform: uppercase; color: #000; margin-bottom: 12px; font-size: 1.1rem; border-bottom: 2px dashed #000; padding-bottom: 8px;}
.fat-sub-label { display: block; font-weight: 900; text-transform: uppercase; color: #000; font-size: 0.85rem; margin-bottom: 5px;}
.fat-card-title { font-size: 1.3rem; font-weight: 900; text-transform: uppercase;}

/* INPUTS */
.fat-input-row { display: flex; gap: 15px; align-items: flex-start;}
.fat-group { flex: 1; display: flex; flex-direction: column; }
.fat-input {
    width: 100%; padding: 12px; border: var(--brutal-border); border-radius: 8px;
    font-size: 1.2rem; font-family: 'Courier New', monospace; font-weight: bold;
    outline: none; background: #fff; color: #000; box-shadow: inset 3px 3px 0px rgba(0,0,0,0.06);
}
.fat-input:focus { border-color: #000; box-shadow: inset 3px 3px 0px rgba(0,0,0,0.06), 0 0 0 3px #000; }

/* READER DIV */
.fat-reader {
    margin-top: 8px; font-size: 0.9rem; font-weight: 800; color: #fff;
    background: #000; padding: 6px 10px; border: 2px solid #000; border-radius: 6px;
    display: inline-block; box-shadow: 3px 3px 0px rgba(0,0,0,0.3); align-self: flex-start;
}

/* CUSTOM CHECKBOX */
.fat-checkbox-label {
    display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 0.9rem; 
    cursor: pointer; background: #fff; padding: 6px 10px; border: 2px solid #000; 
    border-radius: 6px; box-shadow: 2px 2px 0px #000; user-select: none; transition: 0.1s;
}
.fat-checkbox-label:active { transform: translate(2px,2px); box-shadow: 0px 0px 0px #000;}
.fat-checkbox-label input { display: none; }
.fat-checkbox-custom { width: 18px; height: 18px; border: 2px solid #000; border-radius: 4px; background: #fff; position: relative; display: inline-block;}
.fat-checkbox-label input:checked + .fat-checkbox-custom { background: var(--color-11); }
.fat-checkbox-label input:checked + .fat-checkbox-custom::after {
    content: '✔'; position: absolute; top: -3px; left: 2px; font-size: 14px; font-weight: 900; color: #000;
}

/* BUTTONS */
.fat-btn-main {
    width: 100%; padding: 18px; background: #000; color: var(--color-11); 
    border: var(--brutal-border); border-radius: 12px; font-size: 1.3rem; font-weight: 900;
    cursor: pointer; box-shadow: var(--brutal-shadow); transition: 0.1s; text-transform: uppercase;
    margin-top: auto;
}
.fat-btn-main:active { transform: translate(5px, 5px); box-shadow: 0px 0px 0px #000; }

/* BADGES */
.fat-badge { background: #eee; padding: 6px 12px; border: 2px solid #000; border-radius: 6px; font-weight: 900; font-size: 0.85rem; box-shadow: 2px 2px 0px #000; text-transform: uppercase;}
.fat-badge.good { background: var(--color-5); color: #fff; } /* Xanh */
.fat-badge.warning { background: var(--color-6); color: #000; } /* Vàng */
.fat-badge.danger { background: var(--color-8); color: #fff; } /* Đỏ */

/* OUTPUTS */
.fat-result-group { border: var(--brutal-border); border-radius: 12px; padding: 20px; text-align: center; box-shadow: 4px 4px 0px #000; margin-bottom: 15px;}
.fat-result-label { font-weight: 900; text-transform: uppercase; margin-bottom: 5px; font-size: 1rem;}
.fat-result-value { font-size: 3rem; font-weight: 900; font-family: 'Bungee', 'Courier New', cursive; color: #000; word-break: break-all; line-height: 1;}

.fat-result-sub-box { background: var(--color-20); padding: 12px; border: 2px dashed #000; border-radius: 8px; text-align: center;}
.fat-result-sub-val { font-size: 1.2rem; font-weight: 900; font-family: 'Courier New', monospace; color: #000;}

.fat-breakdown { background: #f9f9f9; padding: 15px; border: 2px solid #000; border-radius: 8px; font-weight: bold; font-size: 1.05rem; line-height: 1.6; box-shadow: inset 2px 2px 0px rgba(0,0,0,0.1); color: #333;}
.fat-hl { background: var(--color-11); padding: 2px 6px; border-radius: 4px; border: 2px solid #000; color: #000;}

/* ERROR BOX */
.fat-error-box { background: var(--color-8); color: #fff; padding: 15px; border: var(--brutal-border); border-radius: 8px; font-weight: 900; text-align: center; margin-bottom: 20px; box-shadow: var(--brutal-shadow); display: none; text-transform: uppercase;}
.fat-shake { animation: fatShake 0.4s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes fatShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* INFO BOX */
.fat-info-box { background: var(--color-20); padding: 20px; border: var(--brutal-border); border-radius: 12px; margin-top: 20px; box-shadow: var(--brutal-shadow);}
.fat-info-box h4 { margin: 0 0 10px 0; font-weight: 900; color: #000; font-size: 1.1rem; text-transform: uppercase;}