/* SF Astra — shared mobile layout (settings, skills, WhatsApp config, etc.) */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.page {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.content {
    max-width: 100%;
    min-width: 0;
}

.top-bar {
    flex-wrap: wrap;
    row-gap: 8px;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
}

.card {
    min-width: 0;
    overflow: hidden;
}

.info-grid div {
    align-items: flex-start;
}

.info-grid code,
.info-grid span {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin-top: 8px;
}

@media (max-width: 640px) {
    .content {
        padding: 16px max(12px, env(safe-area-inset-left, 0px)) 32px max(12px, env(safe-area-inset-right, 0px));
    }

    .page-header h1 {
        font-size: 22px;
        line-height: 1.2;
    }

    .page-header p {
        font-size: 13px;
    }

    .card {
        padding: 14px;
        border-radius: 12px;
    }

    .top-bar {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .top-bar-title {
        display: none;
    }

    .info-grid div {
        flex-direction: column;
        gap: 4px;
    }

    .info-grid strong {
        min-width: 0 !important;
        width: 100%;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .actions > * {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .form-row {
        flex-direction: column;
    }

    .form-field {
        min-width: 0;
        width: 100%;
    }

    .setting-row {
        flex-direction: column;
        align-items: stretch;
    }

    .setting-row label {
        min-width: 0;
    }

    .skills-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .field-table {
        display: block;
        width: 100%;
    }

    .field-table thead {
        display: none;
    }

    .field-table tbody {
        display: block;
    }

    .field-table tr {
        display: block;
        margin-bottom: 10px;
        padding: 10px 12px;
        background: var(--bg-primary, #191A1A);
        border: 1px solid var(--border-color, #343536);
        border-radius: 8px;
    }

    .field-table td {
        display: block;
        padding: 4px 0;
        border: none;
    }

    .field-table td:first-child {
        font-weight: 600;
        color: var(--text-primary, #ECECEC);
        margin-bottom: 4px;
    }
}

@media (max-width: 400px) {
    .back-btn span,
    .btn-link {
        font-size: 12px;
        padding: 7px 10px;
    }
}
