/* Base */
body, p, td, div, span {
    font-family: Tahoma, Arial, Helvetica, sans-serif;
    font-size: 12pt;
    color: #000;
}
body {
    background: #fff;
    margin: 0;
    padding: 0;
    border: 0;
    text-align: center;
    direction: rtl;   /* important */
}

/* Layout containers */
#headerout {
    background: #006633;
    text-align: center;
}
#header {
    width: 990px;
    height: 60px;
    background: #006633;
    padding: 0;
    margin-left: auto;
    margin-right: auto;
    text-align: right;      /* RTL */
    overflow: auto;
}
#logo {
    padding: 16px 0 0 0;
    width: 300px;
    float: right;           /* mirror of English float:left */
}

/* Main content layout */
#contentout {
    width: 990px;
    padding-top: 5px;
    margin-left: auto;
    margin-right: auto;
    text-align: right;      /* RTL text */
    overflow: auto;
}
#content {
    padding: 0 0 15px 0;
    width: 620px;
    float: right;           /* main content on the right */
}
#right {
    width: 336px;
    float: left;            /* sidebar on the left */
    text-align: right;
}

/* Footer stays centered */
#footer {
    background: #e1e1e1;
    padding: 25px 0;
    font-size: 13px;
    color: #555;
    text-align: center;
}
#footerin {
    width: 990px;
    padding: 0;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    overflow: auto;
    color: #555;
}

/* Top nav */
.topnav {
    font-size: 11px;
    padding-top: 0;
    padding-bottom: 10px;
}

/* Tables & inputs (same as English) */
#uctable {
    width: 620px;
    background-color: #eee;
    border-radius: 4px;
}
#undctable {
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #eee;
    padding: 8px;
    margin-top: 15px;
}
.uccell {
    padding: 1.2ex 1.5ex;
    width: 230px;
}
.ucinput {
    width: 258px;
    padding: 8px;
    border: 1px solid #000;
    border-radius: 4px;
    box-shadow: 2px 2px 3px #666;
    font-size: 20px;
}
.ucdcinput {
    width: 200px;
    padding: 8px;
    border: 1px solid #000;
    border-radius: 4px;
    box-shadow: 2px 2px 3px #666;
    font-size: 20px;
}
.ucdcsubmit {
    font-size: 18px;
    padding: 6px 15px;
    border: 1px solid #000;
    border-radius: 4px;
    box-shadow: 2px 2px 3px #666;
    background-color: #006633;
    font-weight: bold;
    color: #ffffff;
}
.ucselect {
    width: 100%;
    padding: 3px;
    border: 1px solid #000;
    border-radius: 4px;
    box-shadow: 2px 2px 3px #666;
    font-size: 16px;
}
#ucresult {
    margin: 2px 0;
    border-radius: 5px;
    text-align: center;
    padding: 10px 5px;
}
.ucresulttext {
    padding: 5px 10px;
    font-size: 18px;
}

/* "All converters" box */
#othercalc {
    border: solid 1px #006633;
    margin: auto;
    text-align: right;
}
#octitle {
    background-color: #006633;
    padding: 6px 12px;
    color: #fff;
    font-size: 17px;
    font-weight: bold;
}
#occontent {
    padding: 0;
    background-color: #006633;
    font-weight: bold;
}
#occontent a {
    display: block;
    padding: 6px 12px;
    background-color: #eee;
    color: #006633;
    text-decoration: none;
    font-size: 15px;
}
#occontent a:hover {
    background-color: #ddd;
    background-image: url('/images/down-arrow.svg');
    background-repeat: no-repeat;
    background-position: left 6px center;   /* flipped for RTL */
    text-decoration: underline;
}
#ocsubnav {
    background-color: #fff;
    font-size: 13px;
    font-weight: normal;
}
#ocsubnav a {
    display: inline-block;
    font-size: 13px;
    width: 150px;
    padding: 5px 14px 5px 2px;  /* padding flipped */
    background-color: #fff;
    text-decoration: none;
    color: #006633;
}
#toother div {
    display: inline-block;
    width: 295px;
}

/* Media queries: same as English, no change needed except floats if you like */
@media (max-width:800px){
    #logo{padding: 6px 6px 0 0;width:200px;float:right;}
    #logo img{width:216px;height: 21px;}
    #header{width:auto;height:36px;}
    #contentout{width:auto;padding:6px;}
    #content{width:auto;float:none;}
    #right{width:100%;float:none;}
    #footerin{width:auto;}
}
@media (max-width:610px){
    .ucdcinput{width:160px;}
    .ucdcsubmit{font-size: 17px;padding:6px 10px;}
    #uctable{width: 400px;}
    .uccell{padding:0.5ex;width:200px;}
    .ucinput{width:180px;}
}
@media (max-width:430px){
    .uclabel{display:none;}
    #uctable{width: 320px;}
    .uccell{padding:0.5ex;width:160px;}
    .ucinput{width:145px;}
}