#speedtest-app {
  width: 100%;
  position: relative;
}

#speedtest-app * {
  box-sizing: border-box;
}

.ost-results-wrap {
    /* ---- Design tokens (edit these to re-skin) ---- */
    --ost-bg: #ffffff;
    --ost-surface: #f7f8fa;
    --ost-surface-alt: #eef1f5;
    --ost-border: #e1e5ea;
    --ost-text: #1f2a37;
    --ost-text-muted: #6b7280;
    --ost-primary: #1e63f5;
    --ost-primary-soft: rgba(30, 99, 245, 0.10);
    --ost-success: #16a34a;
    --ost-success-soft: rgba(22, 163, 74, 0.10);
    --ost-warning: #d97706;
    --ost-warning-soft: rgba(217, 119, 6, 0.12);
    --ost-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.05);
    --ost-radius: 12px;
    --ost-radius-sm: 8px;

    /* ---- Layout (don't edit unless needed) ---- */
    --ost-gap: 12px;
    --ost-pad: 20px;
    --ost-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, "Vazirmatn", "IRANSans", "Shabnam", sans-serif;
    --ost-mono: "SFMono-Regular", "Vazirmatn", Menlo, Consolas, monospace;

    font-family: var(--ost-font);
    background: var(--ost-bg);
    color: var(--ost-text);
    border: 1px solid var(--ost-border);
    border-radius: var(--ost-radius);
    padding: var(--ost-pad);
    box-shadow: var(--ost-shadow);
    direction: rtl;
    max-width: 100%;
    overflow: hidden;
}

/* ---------- Header ---------- */
.ost-results-wrap .ost-results-header {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ost-border);
}

.ost-results-wrap .ost-results-title {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ost-text);
    text-align: center;
}

.ost-results-wrap .ost-results-username {
    color: var(--ost-primary);
    font-family: var(--ost-mono);
    font-weight: 600;
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
    padding: 0 6px;
    background: var(--ost-primary-soft);
    border-radius: 4px;
}

.ost-results-wrap .ost-results-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--ost-text-muted);
    line-height: 1.5;
}

/* ---------- Table container ---------- */
.ost-results-wrap .ost-results-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--ost-radius-sm);
    border: 1px solid var(--ost-border);
}

/* ---------- Table ---------- */
.ost-results-wrap .ost-results-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--ost-bg);
    font-size: 14px;
    min-width: 560px;
    margin-block-end: 0;
}

.ost-results-wrap .ost-results-table thead th {
    background: var(--ost-surface);
    color: var(--ost-text);
    font-weight: 600;
    text-align: center;
    padding: 12px 10px;
    border-bottom: 2px solid var(--ost-border);
    white-space: nowrap;
    font-size: 13px;
}

/* ----------
.ost-results-wrap .ost-results-table thead th:first-child {
    text-align: right;
}
 ---------- */

.ost-results-wrap .ost-results-table tbody td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid var(--ost-border);
    color: var(--ost-text);
    vertical-align: middle;
}

/* ----------
.ost-results-wrap .ost-results-table tbody td:first-child {
    text-align: right;
}
 ---------- */
 
.ost-results-wrap .ost-results-table tbody tr:last-child td {
    border-bottom: none;
}

.ost-results-wrap .ost-results-table tbody tr:hover {
    background: var(--ost-surface);
}

/* zebra striping for readability */
.ost-results-wrap .ost-results-table tbody tr:nth-child(even) {
    background: var(--ost-surface-alt);
}

.ost-results-wrap .ost-results-table tbody tr:nth-child(even):hover {
    background: var(--ost-surface);
}

/* ---------- Partial vs complete rows ---------- */
.ost-results-wrap .ost-r-row-partial {
    /* subtle warning tint */
    background: rgba(217, 119, 6, 0.04) !important;
}

.ost-results-wrap .ost-r-row-partial:hover {
    background: rgba(217, 119, 6, 0.08) !important;
}

.ost-results-wrap .ost-r-row-complete {
    /* keep default */
}

/* ---------- Value cells ---------- */
.ost-results-wrap .ost-r-val {
    font-family: var(--ost-mono);
    font-weight: 600;
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
    min-width: 3em;
}

.ost-results-wrap .ost-r-na {
    color: var(--ost-text-muted);
    font-weight: 400;
}

/* ---------- Status badge ---------- */
.ost-results-wrap .ost-r-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.ost-results-wrap .ost-r-status-complete {
    background: var(--ost-success-soft);
    color: var(--ost-success);
}

.ost-results-wrap .ost-r-status-partial {
    background: var(--ost-warning-soft);
    color: var(--ost-warning);
}

.ost-results-wrap .ost-r-status-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    font-weight: bold;
    font-size: 13px;
}

/* ---------- Date cell ---------- */
.ost-results-wrap .ost-r-date {
    font-family: var(--ost-mono);
    font-size: 13px;
    color: var(--ost-text-muted);
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
    white-space: nowrap;
}

/* ---------- Footer ---------- */
.ost-results-wrap .ost-results-footer {
    margin: 16px 0 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--ost-border);
    font-size: 12px;
    color: var(--ost-text-muted);
    text-align: center;
}

/* ---------- Responsive: under 600px ---------- */
@media (max-width: 600px) {
    .ost-results-wrap {
        padding: 14px;
        --ost-radius: 10px;
    }

    .ost-results-wrap .ost-results-title {
        font-size: 16px;
    }

    .ost-results-wrap .ost-results-subtitle {
        font-size: 12px;
    }

    .ost-results-wrap .ost-results-table {
        font-size: 13px;
        min-width: 480px;
    }

    .ost-results-wrap .ost-results-table thead th,
    .ost-results-wrap .ost-results-table tbody td {
        padding: 10px 6px;
    }

    .ost-results-wrap .ost-r-status {
        padding: 3px 8px;
        font-size: 11px;
    }

    /* Hide the status text on very small screens — keep only the icon */
    .ost-results-wrap .ost-r-status-text {
        display: none;
    }
}
