#terminal {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 5px;
}

.controls, .keys {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
}

.controls button, .keys button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 46px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

#tl50-enter {
    background: #64e7c4 !important;
    color: #092e27 !important;
    font-weight: 700 !important;
}

#tl50-entry[hidden],
#tl50-history[hidden],
#tl50-history pre[hidden] {
    display: none !important;
}

#tl50-entry {
    margin: 10px 0;
    padding: 12px;
    border: 1px solid #42617e;
    border-radius: 12px;
    background: #13243a;
}

#tl50-entry label {
    display: block;
    margin-bottom: 8px;
}

#tl50-text {
    width: 100%;
    min-height: 88px;
    padding: 10px;
    border-radius: 9px;
    border: 1px solid #607c9a;
    background: #071421;
    color: white;
    font: 16px Menlo,Consolas,monospace;
}

.tl50-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 9px;
}

.tl50-actions button {
    min-height: 46px;
}

#tl50-info {
    padding: 8px 2px;
    color: #9de9d5;
    overflow-wrap: anywhere;
    font-size: 13px;
}

#tl50-history {
    margin: 10px 0;
}

#tl50-history pre {
    max-height: 250px;
    padding: 10px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: #081522;
    color: #dce8f5;
}

#tl50-refresh {
    font-size: 11px;
    padding: 9px;
}

#workspace .monitor {
    flex-wrap: wrap;
    gap: 9px;
}

@media (display-mode: standalone) {
    main {
        padding-top: max(70px,env(safe-area-inset-top)) !important;
    }
}

/* TL_DIAG_V53_UI */
#tl53-report { margin:12px 0;padding:12px;border:1px solid #56708c;border-radius:10px;background:#102038;color:#e3effa; }
#tl53-report[hidden],#tl53-cancel[hidden] {display:none !important}
#tl53-report-text {width:100%;box-sizing:border-box;min-height:200px;max-height:340px;font:12px monospace;color:white;background:#071421;white-space:pre;overflow:auto}
.tl53-report-buttons {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px}
.tl53-report-buttons button,#tl53-cancel,#tl53-diag {min-height:44px}
/* TL_INLINE_V57_CSS: command entry integrated with the black terminal */
#tl50-entry {display:none !important}
#tl57-console {box-sizing:border-box;margin:-2px 0 10px;background:#060d15;color:#e6eef6;border:1px solid #28425b;border-top:0;border-radius:0 0 9px 9px;padding:8px 9px;}
#tl57-console .tl57-input-line {display:flex;align-items:flex-start;gap:7px;min-height:38px}
#tl57-prompt {flex:none;white-space:nowrap;color:#64e7c4;font:14px/34px Menlo,Consolas,monospace}
#tl57-input {flex:1;min-width:0;box-sizing:border-box;border:0;outline:0;resize:none;background:#060d15;color:#e6eef6;min-height:36px;height:36px;max-height:170px;padding:7px 2px;font:16px/21px Menlo,Consolas,monospace;caret-color:#64e7c4;border-radius:0;-webkit-appearance:none}
#tl57-input::placeholder {color:#8294a8;font-size:12px}
#tl57-console .tl57-actions {display:flex;gap:8px;margin-top:6px;flex-wrap:wrap}
#tl57-go,#tl57-keyboard {flex:1;min-height:42px;background:#1c3448;color:white;border:1px solid #456174;border-radius:8px}
#tl57-go {background:#64e7c4;color:#07261e;font-weight:700}
#tl57-go:disabled {opacity:.5}
#tl57-copyview {box-sizing:border-box;background:#060d15;border:1px solid #28425b;padding:8px;margin:-2px 0 10px;border-radius:0 0 9px 9px}
#tl57-copyview[hidden] {display:none!important}
#tl57-copyview .tl57-copyhead {display:flex;align-items:center;justify-content:space-between;color:#b8d3ef;font-size:12px;margin-bottom:6px}
#tl57-copytext {width:100%;height:200px;max-height:48vh;box-sizing:border-box;color:#e6eef6;background:#060d15;border:1px solid #375572;border-radius:6px;padding:7px;font:13px/18px Menlo,Consolas,monospace;-webkit-user-select:text;user-select:text}
#tl57-copyclose {min-height:36px}
/* TL_TERMINAL_FONT_CONTROLS */
#tl-font-tools {display:inline-flex;align-items:center;gap:4px;min-width:0;}
#tl-font-tools button {min-width:30px;min-height:30px;padding:3px 6px;font-size:12px;line-height:1;}
#tl-font-tools #termStatus {max-width:126px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right;}
