html, body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #000000;
    color: #ececec;
    height: 100%;
}

#header-content {
    background-color: #00dd00;
    width: 100%;
    height: 60px;
    display: flex; /* Enable Flexbox */
    align-items: center; /* Center items vertically */
}

.header {
    display: flex; /* Flexbox layout for header */
    justify-content: space-between; /* Space between left and right items */
    align-items: center; /* Center items vertically */
    width: 100%;
}

.header p {
    color: #202020;
}

.header-left {
    display: flex; /* Flexbox layout for left side */
    align-items: center; /* Center items vertically */
}

.header-right {
    display: flex; /* Flexbox layout for right side */
    align-items: center; /* Center items vertically */
}

.header-left ul,
.header-right ul {
    list-style-type: none;
    margin: 0;
    margin-left: 20px;
    margin-right: 20px;
    padding: 0;
    display: flex; /* Layout list items in a row */
    align-items: center; /* Center list items vertically */
}

.header-left li {
    display: inline;
    margin: 0;
    margin-right: 20px; /* Add spacing between list items */
}

.header-right li {
    display: inline;
    margin: 0;
    margin-left: 20px; /* Add spacing between list items */
}

.header-left a,
.header-right a {
    color: #202020;
    text-decoration: none;
}

.logout-form {
    margin: 0;
}

.logout-button {
    margin: 0;
    padding: 0;
    background: none;
    color: #202020;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font: inherit;
}

.logout-button:hover {
    background: none;
    text-decoration: underline;
}

.header-left a:hover,
.header-right a:hover {
    text-decoration: underline;
}

#page-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 20px;
    height: calc(100% - 60px);
    box-sizing: border-box;
}

.error-text {
    color: #ff6b6b;
    margin: 0;
    min-height: 1.5em;
}

.error-text:empty {
    display: none;
}

.terminal-page {
    gap: 16px;
}

.terminal-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.terminal-panel {
    border: 1px solid #202a35;
    border-radius: 16px;
    background: linear-gradient(180deg, #10161d, #0b1016);
    padding: 18px;
}

.terminal-eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    color: #7fb6ff;
}

.terminal-topline {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    flex-wrap: wrap;
}

.terminal-header-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    flex: 1 1 420px;
}

.terminal-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #d7e2ee;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #27384d;
    border-radius: 999px;
    background: rgba(10, 17, 24, 0.88);
    white-space: nowrap;
}

.status-pill {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
    background: #888;
}

.status-pill[data-state="connecting"] {
    background: #f9c74f;
}

.status-pill[data-state="connected"],
.status-pill[data-state="online"] {
    background: #2ecc71;
}

.status-pill[data-state="offline"] {
    background: #ff6b6b;
}

.terminal-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.terminal-title-row h1,
.terminal-title-row h2 {
    margin: 0;
    line-height: 1.05;
}

.terminal-header-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.terminal-header-context {
    margin: 0;
    color: #b9c4d0;
    font-size: 14px;
}

.terminal-header-uuid {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(6, 11, 17, 0.52);
    border: 1px solid rgba(42, 55, 70, 0.82);
    color: #8ea3b8;
    font-size: 12px;
    line-height: 1.35;
    word-break: break-all;
    box-sizing: border-box;
}

.terminal-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.terminal-controls button {
    margin-top: 0;
}

.terminal-feedback {
    color: #b9c4d0;
    min-height: 1.5em;
    margin: 0;
}

.terminal-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 12px;
}

.terminal-summary-item {
    border: 1px solid #202a35;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(14, 22, 30, 0.92), rgba(8, 13, 18, 0.96));
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.terminal-summary-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8ca0b5;
}

.terminal-summary-value {
    font-size: 14px;
    color: #f4f7fb;
    word-break: break-word;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.metric-card {
    border: 1px solid #202a35;
    border-radius: 12px;
    background: linear-gradient(180deg, #111820, #0b1016);
    padding: 16px;
}

.metric-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.metric-card-header h2 {
    font-size: 16px;
    margin: 0;
}

.metric-card-summary {
    margin: 12px 0 0;
    color: #9da8b4;
    font-size: 13px;
}

.metric-chart {
    width: 100%;
    height: 160px;
    display: block;
    border-radius: 8px;
    background:
        linear-gradient(to bottom, rgba(255,255,255,0.06) 1px, transparent 1px) 0 0 / 100% 25%,
        linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px) 0 0 / 20% 100%,
        linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
}

.log-line {
    padding-bottom: 6px;
}

#controls {
    margin: 0 0 10px;
}

#chart-container {
    width: 100%;
}

.terminal-console-panel {
    display: flex;
    flex-direction: column;
    min-height: 240px;
}

.terminal-console-toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: nowrap;
    min-width: 0;
}

.terminal-console-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
}

.terminal-search-input {
    width: auto;
    min-width: 0;
    flex: 1 1 220px;
    max-width: 280px;
    margin-top: 0;
}

.terminal-console-title {
    flex: 0 0 auto;
}

.terminal-console-actions-inline {
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
}

.terminal-fontsize-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #b9c4d0;
    font-size: 13px;
    white-space: nowrap;
}

.terminal-fontsize-control span {
    font-weight: 600;
}

.terminal-fontsize-select {
    width: auto;
    min-width: 92px;
    margin-top: 0;
    padding: 8px 10px;
}

.terminal-console-actions .secondary-button {
    white-space: nowrap;
    padding: 8px 12px;
}

#log-container {
    flex-grow: 1;
    min-height: 220px;
    margin-bottom: 0;
    overflow-y: auto;
    padding: 10px 0;
    color: #f4f7fb;
    box-sizing: border-box;
    background: linear-gradient(180deg, #07111b, #040b12);
    border-radius: 12px;
    border: 1px solid #223245;
}

/* Modal container */
#deleteModal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
}

/* Modal content */
.modal-content {
    background-color: #000000;
    padding: 20px;
    width: 40%;
    border-radius: 20px;
    border: 1px solid #888888;
    color: #fefefe;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Button styles */
.button {
    padding: 10px 20px;
    margin: 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.confirm-button {
    background-color: #4CAF50;
    color: white;
}

.cancel-button {
    background-color: #f44336;
    color: white;
}

h1 {
    font-size: 24px;
    margin-bottom: 20px;
}

ul {
    list-style-type: none;
    padding: 0;
}

li {
    margin-bottom: 10px;
}

a {
    color: #1a73e8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    display: inline-block;
    padding: 10px 20px;
    margin-top: 20px;
    background-color: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #155bb5;
}

input,
select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    margin-top: 6px;
    border-radius: 6px;
    border: 1px solid #3d4a5a;
    background-color: #10161d;
    color: #ececec;
}

label {
    font-weight: 600;
}

.auth-card,
.panel {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    background: linear-gradient(180deg, #10161d, #0d1218);
    border: 1px solid #1f2b38;
    border-radius: 16px;
    padding: 24px;
    box-sizing: border-box;
}

.auth-card-wide,
.panel {
    max-width: 960px;
}

.auth-copy,
.helper-text,
.info-text {
    color: #b9c4d0;
}

.info-text {
    background: rgba(33, 150, 243, 0.12);
    border: 1px solid rgba(33, 150, 243, 0.4);
    border-radius: 8px;
    padding: 12px;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stack-form button,
.form-grid button {
    margin-top: 6px;
}

.secret-panel {
    background: #0a0f14;
    border: 1px solid #223245;
    border-radius: 12px;
    padding: 16px;
    margin: 18px 0;
}

.otp-setup-grid {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    margin: 18px 0;
}

.otp-qr-panel {
    background: #0a0f14;
    border: 1px solid #223245;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.otp-qr-image {
    width: 100%;
    max-width: 256px;
    height: auto;
    display: block;
    margin: 14px auto 0;
    border-radius: 12px;
    background: #ffffff;
    padding: 12px;
    box-sizing: border-box;
}

.wrap-code {
    display: inline-block;
    white-space: pre-wrap;
    word-break: break-all;
}

@media (max-width: 760px) {
    .otp-setup-grid {
        grid-template-columns: 1fr;
    }
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    align-items: end;
}

.form-grid-actions {
    display: flex;
    align-items: end;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #223245;
    vertical-align: top;
}

.users-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.users-actions button {
    margin-top: 0;
    margin-right: 0;
}

.role-chip,
.status-chip {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
}

.role-chip {
    background: rgba(26, 115, 232, 0.18);
    color: #8cc0ff;
}

.status-chip-ok {
    background: rgba(46, 204, 113, 0.18);
    color: #72f0aa;
}

.status-chip-alert {
    background: rgba(255, 107, 107, 0.18);
    color: #ff9494;
}

.danger-button {
    background-color: #b73a3a;
}

.danger-button:hover {
    background-color: #922c2c;
}

.secret-box {
    padding: 14px;
    background: #0a0f14;
    border: 1px solid #223245;
    border-radius: 10px;
    color: #f4f7fb;
    word-break: break-all;
    margin: 16px 0;
    font-family: monospace;
}

.secret-input {
    width: 100%;
    padding: 14px;
    margin: 16px 0 8px;
    background: #0a0f14;
    border: 1px solid #223245;
    border-radius: 10px;
    color: #f4f7fb;
    font-family: monospace;
    font-size: 15px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    z-index: 20;
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal-card {
    width: min(540px, calc(100% - 32px));
    background: #10161d;
    border: 1px solid #223245;
    border-radius: 16px;
    padding: 20px;
    box-sizing: border-box;
    max-height: calc(100vh - 24px);
    overflow: hidden;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 12px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.terminals-page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

#terminals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.terminal {
    position: relative;
    border: 1px solid #202a35;
    color: #ececec;
    border-radius: 18px;
    padding: 18px;
    background:
        radial-gradient(circle at top right, rgba(89, 179, 255, 0.14), transparent 35%),
        linear-gradient(180deg, #111922, #0b1016);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.terminal:hover {
    transform: translateY(-2px);
    border-color: #3a5069;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.34);
}

.terminal h2,
.terminal h3 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 1.15em;
}

.status-indicator {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(8, 12, 17, 0.85);
}

.terminal-card {
    cursor: pointer;
    outline: none;
}

.terminal-card:focus-visible {
    border-color: #7fb6ff;
    box-shadow: 0 0 0 3px rgba(127, 182, 255, 0.18), 0 24px 56px rgba(0, 0, 0, 0.34);
}

.terminal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 18px;
    margin-bottom: 16px;
    padding-right: 18px;
}

.terminal-card-title-block {
    min-width: 0;
}

.terminal-card-subtitle {
    margin: 0;
    color: #8ca0b5;
    font-size: 13px;
    word-break: break-word;
}

.terminal-card-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.terminal-card-status[data-state="online"] {
    background: rgba(46, 204, 113, 0.16);
    color: #77f0ae;
}

.terminal-card-status[data-state="offline"] {
    background: rgba(255, 107, 107, 0.16);
    color: #ff9c9c;
}

.terminal-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.terminal-card-stat {
    border: 1px solid rgba(42, 55, 70, 0.8);
    border-radius: 12px;
    background: rgba(6, 11, 17, 0.42);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.terminal-card-stat-label {
    font-size: 11px;
    color: #8ca0b5;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.terminal-card-stat-value {
    color: #f4f7fb;
    font-size: 14px;
    word-break: break-word;
}

.terminal-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.terminal-card-hint {
    color: #8ca0b5;
    font-size: 13px;
}

.terminal-card-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.terminal-card-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid #2d4360;
    background: rgba(18, 30, 44, 0.82);
    color: #dce8f7;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.terminal-card-link-button:hover {
    background: rgba(26, 40, 58, 0.94);
    border-color: #416289;
}

.terminal-card-action {
    color: #7fb6ff;
    font-weight: 700;
}

.terminal-modal-open {
    overflow: hidden;
}

.terminal-modal-card {
    width: min(980px, calc(100% - 20px));
    max-height: calc(100vh - 20px);
    overflow: hidden;
    padding: 14px;
}

.terminal-modal-card .terminal-shell {
    gap: 10px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    -webkit-overflow-scrolling: touch;
}

.terminal-modal-card .terminal-panel {
    padding: 12px;
}

.terminal-modal-card .terminal-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.terminal-modal-card .terminal-summary-item {
    padding: 9px 10px;
}

.terminal-modal-card .terminal-summary-label {
    font-size: 11px;
}

.terminal-modal-card .terminal-summary-value {
    font-size: 13px;
}

.terminal-modal-card .terminal-controls {
    gap: 8px;
}

.terminal-modal-card .terminal-controls button,
.terminal-modal-card .secondary-button {
    padding: 8px 14px;
    margin-top: 0;
}

.terminal-modal-card .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.terminal-modal-card .metric-card {
    padding: 10px 12px;
}

.terminal-modal-card .metric-chart {
    height: 108px;
}

.terminal-modal-card .metric-card-summary {
    margin-top: 8px;
    font-size: 12px;
}

.terminal-modal-card .terminal-console-panel {
    min-height: 0;
}

.terminal-modal-card #log-container {
    min-height: 150px;
    max-height: 240px;
    -webkit-overflow-scrolling: touch;
}

.terminal-modal-card .terminal-topline {
    align-items: start;
}

.terminal-modal-card .terminal-status {
    font-size: 12px;
    min-height: 32px;
    padding: 0 10px;
}

.terminal-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.terminal-danger-button {
    margin-top: 0;
}

.terminal-modal-actions .terminal-open-page-link,
.terminal-modal-actions .secondary-button,
.terminal-modal-actions .danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
}

.terminal-modal-actions .terminal-open-page-link {
    border: 1px solid #2d4360;
    background: rgba(18, 30, 44, 0.82);
    color: #dce8f7;
}

.terminal-modal-actions .terminal-open-page-link:hover {
    background: rgba(26, 40, 58, 0.94);
    border-color: #416289;
}

.terminal-modal-actions .secondary-button {
    background: #273240;
}

.terminal-modal-actions .danger-button {
    background: #8f3030;
}

.secondary-button {
    margin-top: 0;
    background: #273240;
}

.secondary-button:hover {
    background: #334255;
}

.terminal-open-page-link {
    color: #7fb6ff;
    font-weight: 600;
}

.logs-toolbar {
    margin-bottom: 18px;
}

.logs-toolbar-grid {
    display: grid;
    grid-template-columns: minmax(240px, 420px);
    gap: 16px;
    align-items: end;
    margin-bottom: 10px;
}

.logs-groups {
    display: grid;
    gap: 18px;
}

.log-group-card {
    max-width: none;
}

.log-group-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.log-group-heading h2 {
    margin: 0;
}

.log-files-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.log-file-button {
    margin-top: 0;
    width: 100%;
    text-align: left;
    background: linear-gradient(180deg, rgba(15, 24, 34, 0.96), rgba(9, 15, 21, 0.98));
    border: 1px solid #223245;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-file-button:hover {
    background: linear-gradient(180deg, rgba(23, 35, 48, 0.98), rgba(13, 20, 29, 0.98));
}

.log-file-button strong {
    font-size: 15px;
    word-break: break-word;
}

.log-file-button-meta {
    color: #8ca0b5;
    font-size: 13px;
}

.log-modal-card {
    width: min(1040px, calc(100% - 20px));
    max-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-modal-header {
    display: flex;
    align-items: start;
    gap: 6px;
}

.log-modal-header-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.log-modal-header-copy h2 {
    margin: 0;
    line-height: 1.08;
    word-break: break-word;
}

.log-modal-subtitle {
    margin: 6px 0 0;
    color: #b9c4d0;
    font-size: 14px;
    word-break: break-word;
}

.log-modal-meta-pill {
    margin: 0;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #27384d;
    background: rgba(10, 17, 24, 0.88);
    color: #d7e2ee;
    font-size: 13px;
    white-space: nowrap;
}

.log-modal-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    color: #ececec;
    text-decoration: none;
    box-sizing: border-box;
}

.log-modal-action-link[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
}

.log-modal-toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin: 0;
    min-width: 0;
}

.log-modal-search-input {
    flex: 1 1 340px;
    max-width: none;
}

.log-modal-fontsize-control {
    flex: 0 0 auto;
}

.log-modal-toolbar .secondary-button,
.log-modal-toolbar .log-modal-action-link {
    white-space: nowrap;
    padding: 8px 12px;
}

.log-file-viewer {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    border: 1px solid #223245;
    border-radius: 12px;
    background: linear-gradient(180deg, #07111b, #040b12);
    padding: 6px 0 10px;
}

.terminal-log-viewer {
    white-space: normal;
}

.log-file-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 8px;
    padding: 4px 12px;
    align-items: start;
}

.log-file-row:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.log-file-line-number {
    color: #6f8296;
    font-size: max(11px, calc(var(--log-viewer-font-size, 12px) - 1px));
    text-align: right;
    padding-top: 2px;
    user-select: none;
}

.log-file-line-text {
    color: #f4f7fb;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: var(--log-viewer-font-size, 12px);
    line-height: 1.45;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

@media (max-width: 900px) {
    .terminal-card-grid,
    .terminal-summary-grid {
        grid-template-columns: 1fr;
    }

    .terminal-modal-card {
        width: min(100%, calc(100% - 16px));
        max-height: calc(100vh - 16px);
        padding: 14px;
    }

    .terminal-modal-card .terminal-shell {
        max-height: calc(100vh - 44px);
    }

    .terminal-modal-card .metric-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 680px) {
    .terminal-topline,
    .terminal-card-header,
    .terminal-card-footer,
    .terminal-console-toolbar,
    .log-group-heading,
    .log-modal-header,
    .log-modal-toolbar {
        flex-direction: column;
        align-items: start;
    }

    .terminal-console-actions {
        width: 100%;
        justify-content: stretch;
        flex-wrap: wrap;
    }

    .log-modal-toolbar {
        width: 100%;
        flex-wrap: wrap;
    }

    .log-modal-meta-pill {
        width: 100%;
        white-space: normal;
        border-radius: 14px;
        padding: 8px 12px;
        min-height: 0;
    }

    .terminal-search-input {
        width: 100%;
    }

    .terminal-fontsize-control {
        width: 100%;
        justify-content: space-between;
    }

    .terminal-fontsize-select {
        width: 100%;
    }

    .log-file-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .log-file-line-number {
        text-align: left;
    }
}
