@font-face {
    font-family: "ps-icons";
    font-style: normal;
    font-format: woff;
    font-weight: 400;
    src: url("public/fonts/ps-icons.woff");
}

@font-face {
    font-family: "ps-icons-small";
    font-style: normal;
    font-format: woff;
    font-weight: 400;
    src: url("public/fonts/ps-icons-small.woff");
}

:root {
    --dl-color-text-blue2: #0094ffff;
    --dl-color-text-blue3: #50b5feff;
    --dl-color-text-blue4: #85ccfdff;
    --dl-color-text-teal4: #86d3deff;
    --dl-color-text-white: #ffffffff;
    --dl-layout-space-one: 1rem;
    --dl-layout-space-six: 6rem;
    --dl-layout-space-two: 2rem;
    --dl-color-grays-white: #ffffffff;
    --dl-layout-size-large: 144px;
    --dl-layout-size-small: 48px;
    --dl-layout-space-five: 5rem;
    --dl-layout-space-four: 4rem;
    --dl-layout-space-half: 0.5rem;
    --dl-layout-space-unit: 1rem;
    --dl-layout-space-eight: 8rem;
    --dl-layout-space-three: 3rem;
    --dl-layout-size-medium: 96px;
    --dl-layout-space-seven: 7rem;
    --dl-color-grays-black: #000000ff;
    --dl-color-default-blue: #0094ff;
    --dl-layout-size-xxsmall: 8px;
    --dl-color-accent-orange: #ff6800;
    --dl-layout-space-twounits: 2rem;
    --dl-layout-size-maxwidth: 1400px;
    --dl-layout-space-fourunits: 4rem;
    --dl-layout-space-oneandhalfunits: 1.5rem;
}
.rich {
    font-size: 1.25rem;
    font-family: Arial;
    font-weight: 400;
    line-height: 1.45;
    text-transform: none;
    text-decoration: none;
}
.thq-heading-1 {
    font-size: 3rem;
    font-family: inherit;
    font-weight: 700;
    line-height: 1.2;
}
.thq-heading-2 {
    font-size: 2.25rem;
    font-family: inherit;
    font-weight: 700;
    line-height: 1.3;
}
.thq-body-large {
    font-size: 1.125rem;
    font-family: inherit;
    font-weight: 400;
    line-height: 1.5;
}
.thq-body-small {
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 400;
    line-height: 1.5;
}
.thq-input {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 400;
    line-height: 1.5;
    border-radius: 40px;
    background-color: var(--dl-color-grays-white);
    border: 1px solid #ccc;
    outline: none;
    height: 50px;
}
.thq-button-filled,
.button-orange-small {
    display: flex;
    cursor: pointer;
    padding: 0 20px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.5;
    border-color: var(--dl-color-accent-orange);
    border-width: 1px;
    border-radius: 40px;
    background-color: var(--dl-color-accent-orange);
    color: var(--dl-color-grays-white);
    text-align: center;
    align-items: center;
    height: 50px;
    text-transform: uppercase;
}
.thq-table {
    width: 100%;
    border-collapse: collapse;
}
.thq-table th,
.thq-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
.thq-table th {
    background-color: #f2f2f2;
}
.thq-section-padding {
    padding: var(--dl-layout-space-fourunits) 0;
}
.thq-section-max-width {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--dl-layout-space-four);
}
.thq-flex-column {
    display: flex;
    flex-direction: column;
    gap: var(--dl-layout-space-twounits);
    width: 100%;
    align-items: center;
    text-align: center;
}
.thq-flex-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dl-layout-space-unit);
}
@media (max-width: 991px) {
    .lg-flex-col {
        display: flex;
        flex-direction: column;
    }
}
@media (max-width: 767px) {
    .heading-1 {
        font-size: 2rem;
    }
    .section-full {
        padding-left: var(--dl-layout-space-two);
        padding-right: var(--dl-layout-space-two);
    }
    .md-text-center {
        text-align: center;
    }
}
@media (max-width: 479px) {
    .formsubmission {
        padding: var(--dl-layout-space-unit);
    }
}
@media (max-width: 390px) {
    .thq-section-padding {
        padding: var(--dl-layout-space-oneandhalfunits);
    }
    .thq-flex-column {
        gap: var(--dl-layout-space-unit);
    }
    .thq-flex-row {
        gap: var(--dl-layout-space-half);
    }
}

.developers-container11 {
    width: 100%;
    display: flex;
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
    background-color: #00305f;
    color: #fff;
}

.results-title {
    font-size: 1.2em; /* Вы можете изменить это значение */
    margin-bottom: 5px;
}

/* Results header: title (left) + download button (right) */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.results-header h2,
.results-header .results-title {
    margin: 0; /* removes default h2 top/bottom margin */
    line-height: 1.1;
}

/* ===== Progress bar (oval, like input) ===== */
.progress-wrap {
    width: min(520px, 100%);
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.progress-wrap.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 14px;
    border-radius: 40px;
    border: 1px solid #ccc;
    background: var(--dl-color-grays-white);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 40px;
    background: var(--dl-color-accent-orange);
    transition: width 0.35s ease;
}

.progress-text {
    font-size: 0.85rem;
    opacity: 0.9;
}

#downloadBtn.thq-button-filled {
    height: 50px; /* match other buttons */
    border-radius: 40px; /* pill */
    padding: 0 20px; /* consistent */
    text-transform: uppercase;
}

.download-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Simple tooltip (works even when the button is disabled) */
.tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tooltip .tooltiptext {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.15s ease;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.85em;
    white-space: nowrap;
    z-index: 20;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

@media (max-width: 768px) {
    /* Mobile: keep header layout as-is (you can change later) */
    .results-header {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    /* Give the blue section decent padding on small screens */
    .developers-container11.thq-section-padding {
        padding-left: 16px !important;
        padding-right: 16px !important;
        padding-top: 24px !important;
        padding-bottom: 24px !important;
    }

    /* Prevent title from being huge */
    .developers-container11 .thq-heading-1 {
        font-size: 32px;
        line-height: 1.15;
        text-align: center;
        margin-top: 0;
    }

    .developers-container11 .thq-body-large {
        text-align: center;
    }

    /* Stack the input + buttons instead of row */
    .developers-container11 .thq-flex-row {
        flex-wrap: wrap; /* allows wrapping instead of overflow */
        justify-content: center;
    }

    /* Make the input full width (override inline width:300px) */
    #ip_input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Buttons full width */
    #get_my_ip_button,
    #check_button {
        flex: 1 1 120px; /* buttons can wrap to next line */
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    /* Make results area not overflow the screen */
    #results {
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        padding-left: 12px;
        padding-right: 12px;
    }

    #result_table {
        width: 100%;
        max-width: 100%;
    }

    /* Mobile: center text inside buttons */
    .thq-button-filled {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    /* Allow horizontal scroll if table is wider than phone */
    .thq-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Reduce padding a bit in cells so it fits */
    .thq-table th,
    .thq-table td {
        padding: 8px 10px;
        vertical-align: top;
    }

    /* Make <pre> wrap instead of forcing huge width */
    .thq-table pre {
        white-space: pre-wrap;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

#results {
    max-width: 100%;
}

#result_table.thq-table {
    width: 100%;
    max-width: 100%;
    table-layout: auto;
    display: table;
    overflow-x: visible;
}

#result_table pre {
    white-space: pre-wrap; /* wrap lines */
    word-break: break-word; /* break long tokens */
    overflow-wrap: anywhere; /* break very long strings safely */
    max-width: 100%;
}

/* Desktop/default column sizing */
#result_table th:nth-child(1),
#result_table td:nth-child(1) {
    width: 48px;
}

#result_table th:nth-child(2),
#result_table td:nth-child(2) {
    width: 140px;
}

/* Mobile override */
@media (max-width: 768px) {
    /* Give more room to output on phones */
    #result_table th:nth-child(1),
    #result_table td:nth-child(1) {
        width: 40px;
    }

    #result_table th:nth-child(2),
    #result_table td:nth-child(2) {
        width: 80px;
    }
    #result_table.thq-table {
        table-layout: fixed; /* OK on mobile */
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Table header color (all screen sizes) */
#result_table thead th {
    color: #00305f;
    font-weight: 600; /* optional but nice */
}

#ip_input {
    text-align: center;
}

#ip_input::placeholder {
    text-align: center;
}

.account-menu {
    position: relative;
    display: inline-block;
}

.account-dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    min-width: 138px;
    width: max-content;
    max-width: 220px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    padding: 6px;
    z-index: 9999;
}

.account-dropdown.hidden {
    display: none;
}

.account-item {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #111;
    font-size: 14px;
    text-align: left;
}

.account-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

.account-sep {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 6px 0;
}

.account-logout {
    color: #b00020;
}

/* ===== ASN confirmation modal ===== */
.modal.hidden {
    display: none;
}
.modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}
.modal-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100vw - 32px));
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}
.modal-title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 8px;
}
.modal-text {
    font-size: 14px;
    margin-bottom: 12px;
}
.modal-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 12px;
}

.perip-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.perip-item {
    padding: 8px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.perip-ip {
    font-weight: 600;
    margin-bottom: 4px;
}

.perip-pre {
    white-space: pre-wrap;
    margin: 0;
}

.perip-text {
    white-space: normal;
}

.perip-toggle {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.perip-toggle:disabled {
    opacity: 0.4;
    cursor: default;
}

.ai-summary {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    color: #00305f;
    border: 1px solid rgba(0, 48, 95, 0.25);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.ai-summary.hidden {
    display: none;
}
.ai-summary-title {
    font-size: 1.05em;
    font-weight: 600;
    margin-bottom: 8px;
}
.ai-summary-content {
    font-size: 0.95em;
    line-height: 1.35;
    text-align: left;
}
.ai-summary-content p {
    margin: 6px 0;
}
.ai-summary-content .ai-section {
    padding-top: 10px;
    border-top: 1px solid rgba(0, 48, 95, 0.12);
}
.ai-summary-content .ai-section-title {
    font-weight: 600;
    margin-bottom: 4px;
}
.ai-summary-content .ai-section:first-child {
    border-top: 0;
    padding-top: 0;
}

.ai-summary-content ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.ai-summary-content li {
    margin: 6px 0;
}

.ai-summary-content code {
    background: rgba(0, 48, 95, 0.06);
    padding: 1px 6px;
    border-radius: 6px;
}

.ai-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0, 48, 95, 0.25);
    margin-right: 8px;
}

.ai-summary,
.ai-summary * {
    box-sizing: border-box;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Ensure text is left-aligned consistently (your .ai-summary-content already has it,
   this enforces it for nested elements too) */
.ai-summary,
.ai-summary * {
    text-align: left;
}

/* If any <pre> ever ends up inside AI summary, wrap it too */
.ai-summary pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin: 0;
}

/* Make the summary follow the same width rules as the results area */
#results .ai-summary {
    width: 100%;
}
/* ===== History page back link (same style weight as title) ===== */
.results-back {
    font-size: 1.2em; /* same as .results-title */
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.results-back:hover {
    opacity: 1;
    text-decoration: underline;
}

.admin-card {
    background: #1f232b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.admin-card .thq-table,
.admin-card .thq-table th,
.admin-card .thq-table td {
    background-color: #eaf4ff;
    color: #10243e;
}

.admin-card .thq-table tr:nth-child(even) td {
    background-color: #deeeff;
}

.admin-card .thq-table tr:nth-child(odd) td {
    background-color: #eaf4ff;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-tab-btn {
    display: inline-block;
    width: auto;
    padding: 6px 12px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.2;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-tab-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.admin-tab-btn.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.admin-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.admin-mini-item {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 12px 14px;
}

.admin-mini-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 6px;
}

.admin-mini-value {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.admin-mini-hint {
    font-size: 12px;
    opacity: 0.72;
    line-height: 1.35;
}

.admin-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: lowercase;
}

.admin-badge-green {
    background: rgba(44, 182, 125, 0.18);
    color: #6ee7a8;
}

.admin-badge-red {
    background: rgba(220, 38, 38, 0.18);
    color: #fca5a5;
}

.admin-compact-table {
    max-width: 520px;
}

header.page-header .logo {
    width: 210px;
    height: 65px;
    background: url("/static/site-logo.svg") no-repeat 10px center !important;
    background-size: contain !important;
}

@media only screen and (max-width: 600px) {
    header.page-header .logo {
        width: 68px;
        height: 55px;
        background-position: 6px center !important;
    }
}

.page-footer {
    width: 100%;
    background: #ffffff;
    border-top: none;
    margin-top: 0;
}

.page-footer-wrap {
    width: 1140px;
    margin-left: auto;
    margin-right: auto;
    min-height: 113px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-logo {
    display: block;
    width: 210px;
    height: 65px;
    background: url("/static/site-logo.svg") no-repeat 10px center;
    background-size: contain;
    flex-shrink: 0;
}

.footer-copy {
    color: #06284d;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    margin: 0;
    padding: 0;
}

@media screen and (max-width: 1190px) {
    .page-footer-wrap {
        width: 100%;
        max-width: 1140px;
        padding: 0 14px;
        box-sizing: border-box;
    }
}

@media only screen and (max-width: 600px) {
    .page-footer-wrap {
        min-height: 59px;
    }

    .footer-logo {
        width: 68px;
        height: 55px;
        background-position: 6px center;
    }

    .footer-copy {
        font-size: 13px;
    }
}
