body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #333;
}
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}
header {
    background: #2c3e50;
    color: #fff;
    padding: 1rem 0;
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
header h1 { margin: 0; font-size: 1.5rem; }
nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 15px;
}
.tool-section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.translator-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
select, .upload-btn {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}
.upload-btn {
    background: #e9ecef;
    cursor: pointer;
    display: inline-block;
}
.translator-boxes {
    display: flex;
    gap: 20px;
    margin-bottom: 1rem;
}
.box {
    flex: 1;
    display: flex;
    flex-direction: column;
}
textarea {
    width: 100%;
    height: 150px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    font-size: 1rem;
    box-sizing: border-box;
}
.primary-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1rem;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}
.primary-btn:hover { background: #2980b9; }
.content-section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}
footer {
    background: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}
footer a { color: #3498db; text-decoration: none; }
@media(max-width: 600px) {
    .translator-boxes { flex-direction: column; }
    header .container { flex-direction: column; gap: 10px; }
}
.brand { color: #fff; font-weight: 700; font-size: 1.35rem; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1rem; }
nav a { margin: 0; }
footer a { color: #b7e2ff; }
h1, h2, h3 { line-height: 1.28; }
h1 { margin-top: 0; }
.page { margin-top: 2rem; }
.jawa { font-family: "Noto Sans Javanese", "Javanese Text", sans-serif; font-size: 1.25rem; line-height: 2; }
.box { min-width: 0; }
textarea { color: #263747; }
.primary-btn { background: #196399; }
#direction { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
#direction legend { font-weight: 600; margin-bottom: .4rem; }
#direction label { position: relative; cursor: pointer; }
#direction input { position: absolute; opacity: 0; }
#direction span, .actions button, .key {
    display: inline-block; padding: .5rem .75rem; border: 1px solid #aabac7;
    border-radius: .5rem; background: #f0f5f9; color: #203548;
}
#direction input:checked + span { background: #254660; color: #fff; }
#direction input:focus-visible + span, button:focus-visible, summary:focus-visible { outline: 3px solid #237bb7; outline-offset: 2px; }
#direction:disabled label, button:disabled { opacity: .6; cursor: default; }
.upload-wrapper label, #uploadStatus, #actionStatus { display: block; }
#imageUpload { max-width: 100%; }
.actions, .keys { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.actions button, .key, summary { cursor: pointer; }
.key { min-width: 2.8rem; min-height: 2.8rem; padding: .15rem .35rem; }
#keyboard { margin-top: .5rem; }
.reference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; font-weight: 700; margin-bottom: .35rem; }
td, th { padding: .35rem .55rem; border: 1px solid #d8e1ea; text-align: left; }
th { background: #eaf0f6; }
tbody tr:nth-child(even) { background: #f7f9fc; }
.articles p { margin-top: .15rem; }
.source { font-size: .9rem; }
@media (max-width: 680px) {
    .reference-grid { grid-template-columns: 1fr; }
    .tool-section, .content-section { padding: 1.15rem; }
}
