body{
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: hsl(0 , 0% , 10%);
}
#calculator{
    font-family: Arial, sans-serif;
    background-color: var(--bg-calc, #000000);
    border-radius: 20px;
    width: 650px;
    display : grid;
    grid-template-columns: 440px 210px ;
    align-items: stretch;
    overflow: hidden;
    box-shadow: var(--glow, none);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.calc-sidebar{
    width: 210px;
    background-color: rgba(0,0,0,0.2);
    display:flex;
    flex-direction: column;
    height: 100%    ;
}
#theme-selector {
    display:flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px 4px  20px;
}
.theme-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 13px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    cursor: pointer;
    display : flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    background-color: hsl(0,0%,25%);
    color: white;
}
.theme-btn:hover{
    background-color: hsl(0,0%,45%);
}
.theme-default{
    --bg-calc: #000000 ;
    --bg-display: hsl(0,0%, 18%);
    --bg-panel: hsl(0,0%,14%);
    --text-display: bisque;
    --text-panel: #00ffcc;
    --btn-bg: hsl(0,0%,30%);
    --bg-hover: hsl(0,0%,50%);
    --bg-active: hsl(0,0%,70%);
    --accent-bg: hsl(199,87%,30%);
    --accent-hover: hsl(199,87%,50%);
    --hex-bg: hsl(280,50%,30%);
    --hex-hover: hsl(280,50%,50%);
    --bit-bg: hsl(40 , 80%, 30%);
    --bit-hover: hsl(40 , 80%,50%);
    --equal-bg:hsl(120,60%,30%);
    --equal-hover:hsl(120,60%,45%);
    --glow: 0 10px 30px rgba(0,0,0,0.5);
}
.theme-matrix{
    --bg-calc:#030803;
    --bg-display:#071207;
    --bg-panel:#020502;
    --text-display:#00ff66;
    --text-panel:#00ff66;
    --btn-bg: #0b1a0b;
    --btn-hover: #163316;
    --btn-active:#234d23;
    --accent-bg: #004d00;
    --accent-hover: #008000;
    --hex-bg: #1a3300;
    --hex-hover: #264d00;
    --bit-bg: #003333;
    --bit-hover: #006666;
    --equal-bg: #006622;
    --equal-hover: #009933;
    --glow: 0 0 20px rgba(0,255,102,0.25);
}
.theme-amber{
    --bg-calc: #0f0a00;
    --bg-display: #1f1400;
    --bg-panel: #080500;
    --text-display: #ffb000;
    --text-panel:#ffb000;
    --btn-bg:#2b1d00;
    --btn-hover: #4a3200;
    --btn-active: #694800;
    --accent-bg: #663d00;
    --accent-hover: #995c00;
    --hex-bg: #592d00;
    --hex-hover: #804000;
    --bit-bg: #4d3d00;
    --bit-hover : #805f00;
    --equal-bg: #805300;
    --equal-hover: #b37400;
    --glow : 0 0 20px rgba(255,176,0,0.3);
}
.theme-synthwave {
    --bg-calc: #120d26;
    --bg-display: #1e143f;
    --bg-panel : #0a0717;
    --text-display: #ff71ce;
    --text-panel : #01cdfe;
    --btn-bg : #2b1d00;
    --btn-hover: #4a3200;
    --btn-active: #694800;
    --accent-bg : #b5179e;
    --accent-hover : #f72585;
    --hex-bg : #7209b7;
    --hex-hover : #9d4edd;
    --bit-bg : #3a0ca3;
    --bit-hover: #4cc9f0;
    --equal-bg: #0582ca;
    --equal-hover: #00a6fb;
    --glow: 0 0 25px rgba(255, 113, 206, 0.35);
}
#display{
    width: 100%;
    padding: 20px;
    font-size:4rem;
    text-align: left;
    border: none;
    background-color:var(--bg-display, hsl(0 , 0% , 18%));

    color:var(--text-display, bisque);
    box-sizing: border-box;
    
}
#base-panel{
    background-color:var(--bg-panel, hsl(0 , 0%, 14%));
    padding: 10px 20px;
    font-family: monospace;
    font-size: 14px;
    color: #00ffcc;
    border-bottom: 1px solid #333;
}
.base-row{
    display:flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0;
    gap: 10px;
    overflow: scroll;
}
.base-row span:first-child {
    color: #888;
    font-weight: bold;
    flex-shrink: 0;
}
.base-row span:first-child{
    overflow:scroll;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}
#register-panel {
    background-color: rgba(0,0,0,0.4);
    border-bottom: 1px solid #333;
    padding: 8px 20px;
    font-family: monospace;
}
#register-header{
    font-size: 10px;
    color:#888;
    margin-bottom: 5px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}
#bit-grid {
    display:grid;
    grid-template-columns: repeat(16,1fr);
    gap:3px;
}
.bit-box{
    background: rgba(255,255,255,0.08);
    border : 1px solid rgba(255, 255 ,255, 0.3);
    border-radius: 2px;
    text-align: center;
    font-size:8px;
    color: #aaa;
    cursor: pointer;
    padding: 2px 0;
    transition: all 0.1s;
    user-select: none;
}
.bit-box:hover{
    border-color: var(--text-panel,#00ffcc);
    color: #fff;
}
.bit-box:active {
    background: var(--text-panel, #00ffcc);
    color: #000;
    border-color: var(--text-panel,#00ffcc);
    font-weight: bold;
    box-shadow: 0 0 8px var(--text-panel, #00ffcc);
}
#history-panel{
    background-color: rgba(0,0,0,0.3);
    border-bottom: 1px solid #333;
    padding: 8px 20px;
    font-family: monospace;
}
#history-header{
    display:flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
    font-weight: bold;
}
#clear-history-btn{
    background:none;
    border:none;
    cursor: pointer;
    font-size:14px;
    padding:2px 4px;
    width:auto;
    height:auto;
}
#history-list{
    flex-grow: 1;
    max-height:none;
    overflow-y: auto;
    display : flex;
    flex-direction: column;
    gap:4px;
}
.history-item{
    background: rgba(255,255,255,0.04);
    padding : 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #ccc;
    cursor: pointer;
    display:flex;
    justify-content: space-between;
    transition: background 0.1s;
}
.history-item:hover{
    background: rgba(255,255,255,0.1);
    color:#fff;
}
#buttons {
    display: grid;
    grid-template-columns:  repeat(4, 1fr);
    gap: 10px;
    padding: 20px;
}
#buttons button {
    width :100% ;
    height : 85px ;
    border-radius: 20%;
    border : 2px solid black;
    background-color: hsl(0, 0% , 30%);
    color : aliceblue;
    font-size:24px ;
    font-weight :bold ; 
    cursor:pointer;
}
#buttons button:hover{
    background-color: hsl(0, 0% , 50%)
}
#buttons button:active{
    background-color: hsl(0, 0% , 70%)
}
#buttons button.builtdiffrent{
    background-color: hsl(199, 87%, 30%);
}
#buttons button.builtdiffrent:hover{
    background-color: hsl(199, 87%, 50%);
}
#buttons button.builtdiffrent:active{
    background-color: hsl(199, 87%, 70%);
}
#buttons button.hx-btn{
    background-color: hsl(280 , 50% , 30%);
}
#buttons button.hx-btn:hover{
    background-color: hsl(280 , 50% , 50%);
}
#buttons button.hx-btn:active{
    background-color: hsl(280 , 50% , 70%);
}
#buttons button.bit-btn {
    background-color: hsl(40 , 80% , 30%);
}
#buttons button.bit-btn:hover {
    background-color: hsl(40 , 80% , 50%);
}
#buttons button.bit-btn:active{
    background: hsl(40 , 80% , 70%);
}
#buttons button.buil{
    background-color: hsl(120, 60%, 30%);
}
#buttons button.buil:hover{
    background-color: hsl(120 , 60% , 45%);
}
#buttons button.buil:active {
    background-color: hsl(120 , 60% , 65%);
}
#inspector-panel {
    background-color: rgba(0,0,0,0.25);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 12px 15px;
    font-family: monospace;
}
#inspector-header{
    font-size: 11px;
    color: #888;
    margin-bottom: 8px;
    font-weight: bold;
}
#inspector-content{
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.byte-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #ccc;
    background: rgba(255, 255 ,255, 0.03);
    padding: 3px 6px;
    border-radius: 3px;
}
.byte-row span:first-child{
    color: #888;
    font-weight: bold;
}
.byte-row span:last-child{
    color: var(--text-panel,#00ffcc)
}