* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    padding: 28px 14px;
    background: #eef3f6;
    color: #1f2d3d;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

.app {
    width: 100%;
    max-width: 590px;
    margin: 0 auto;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #dce5ec;
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(36, 49, 66, 0.07);
}

.app-login {
    max-width: 500px;
}

.header {
    margin-bottom: 20px;
}

.title {
    margin: 0 0 5px;
    color: #0f1f33;
    font-size: 23px;
    line-height: 1.18;
    font-weight: 760;
}

.subtitle {
    color: #637489;
    font-size: 14px;
}

.back-link,
.small-link {
    color: #60758a;
    font-size: 14px;
    text-decoration: none;
}

.back-link {
    display: inline-block;
    margin-bottom: 16px;
}

.back-link:hover,
.small-link:hover {
    text-decoration: underline;
}

.section {
    margin-top: 18px;
}

.card {
    display: block;
    padding: 14px;
    margin-bottom: 11px;
    border: 1px solid #dce5ec;
    border-radius: 7px;
    background: #fbfdfe;
    color: inherit;
    text-decoration: none;
}

.card:hover {
    background: #f5f9fb;
    border-color: #cbd9e3;
}

.card-title {
    margin-bottom: 5px;
    color: #1d2d42;
    font-size: 16px;
    font-weight: 730;
}

.card-text {
    color: #637489;
    font-size: 14px;
}

.form {
    width: 100%;
    margin-top: 18px;
}

.label {
    display: block;
    margin: 12px 0 6px;
    color: #243348;
    font-size: 14px;
    font-weight: 650;
}

.input {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid #cbd8e2;
    border-radius: 5px;
    background: #ffffff;
    color: #1f2d3d;
    font-size: 15px;
    outline: none;
}

.input:focus {
    border-color: #86a6c0;
    box-shadow: 0 0 0 3px rgba(99, 132, 158, 0.16);
}

textarea.input {
    min-height: 105px;
    resize: vertical;
}

.btn {
    display: block;
    width: 100%;
    min-height: 43px;
    margin-top: 16px;
    padding: 9px 12px;
    border: 0;
    border-radius: 5px;
    background: #607d96;
    color: #ffffff;
    font-size: 15px;
    font-weight: 720;
    cursor: pointer;
}

.btn:hover {
    background: #557087;
}

.btn-secondary {
    background: #eef4f7;
    color: #243348;
}

.btn-secondary:hover {
    background: #e3ebf0;
}

.error,
.notice {
    padding: 11px 12px;
    margin-bottom: 13px;
    border-radius: 6px;
    font-size: 14px;
}

.error {
    border: 1px solid #efc6c6;
    background: #fff2f2;
    color: #983030;
}

.notice {
    border: 1px solid #cfe7d8;
    background: #edf8f1;
    color: #247047;
}

.top-actions {
    margin-top: 14px;
}

/* строки данных */
.info-row {
    padding: 11px 0;
    border-bottom: 1px solid #e8eef2;
}

.info-row:last-child {
    border-bottom: 0;
}

.info-label {
    margin-bottom: 4px;
    color: #637489;
    font-size: 13px;
}

.info-value {
    color: #142238;
    font-size: 16px;
    font-weight: 690;
    word-break: break-word;
}

/* статус */
.status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 12px;
    margin-bottom: 14px;
    border-radius: 6px;
    font-weight: 730;
}

.status-ok {
    background: #edf8f1;
    color: #247047;
    border: 1px solid #cfe7d8;
}

.status-bad {
    background: #fff2f2;
    color: #983030;
    border: 1px solid #efc6c6;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

/* таблица сведений */
.info-table {
    margin-top: 14px;
    border: 1px solid #dce5ec;
    border-radius: 7px;
    overflow: hidden;
    background: #ffffff;
}

.info-table-row {
    display: grid;
    grid-template-columns: 42% 58%;
    border-bottom: 1px solid #e8eef2;
}

.info-table-row:last-child {
    border-bottom: 0;
}

.info-table-label,
.info-table-value {
    padding: 12px;
}

.info-table-label {
    color: #637489;
    background: #f7fafc;
    font-size: 14px;
}

.info-table-value {
    color: #142238;
    font-size: 15px;
    font-weight: 700;
    word-break: break-word;
}

/* Wi-Fi */
.wifi-card {
    margin-top: 14px;
    border: 1px solid #dce5ec;
    border-radius: 7px;
    overflow: hidden;
    background: #ffffff;
}

.wifi-card-head {
    padding: 12px 13px;
    border-bottom: 1px solid #e8eef2;
    background: #f7fafc;
    color: #1d2d42;
    font-size: 16px;
    font-weight: 740;
}

.wifi-card-body {
    padding: 13px;
}

.wifi-field {
    margin-bottom: 11px;
}

.wifi-field:last-child {
    margin-bottom: 0;
}

.wifi-label {
    margin-bottom: 5px;
    color: #637489;
    font-size: 13px;
}

.wifi-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px dashed #cbd8e2;
    border-radius: 5px;
    background: #fbfdfe;
    color: #142238;
    font-size: 16px;
    font-weight: 720;
    word-break: break-word;
}

.wifi-value-text {
    min-width: 0;
}

/* копирование */
.copy-btn {
    flex: 0 0 auto;
    border: 1px solid #d2dde6;
    border-radius: 5px;
    background: #eef4f7;
    color: #4f667d;
    padding: 5px 8px;
    font-size: 12px;
    cursor: pointer;
}

.copy-btn:hover {
    background: #e3ebf0;
}

/* QR */
.qr-box {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 12px;
    margin-top: 12px;
    border: 1px solid #dce5ec;
    border-radius: 7px;
    background: #fbfdfe;
}

.qr-img,
.qr-placeholder {
    width: 132px;
    height: 132px;
    flex: 0 0 auto;
    border: 1px solid #dce5ec;
}

.qr-img {
    display: block;
    background: #ffffff;
}

.qr-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef4f7;
    color: #637489;
    font-size: 13px;
    text-align: center;
}

/* лицевые счета */
.pay-intro {
    padding: 13px 14px;
    border: 1px solid #dce5ec;
    border-radius: 7px;
    background: #fbfdfe;
    color: #2d3d52;
}

.accounts-list {
    margin-top: 12px;
    border: 1px solid #dce5ec;
    border-radius: 7px;
    overflow: hidden;
    background: #ffffff;
}

.account-row {
    display: block;
    padding: 14px;
    border-bottom: 1px solid #e8eef2;
}

.account-row:last-child {
    border-bottom: 0;
}

.account-title {
    margin-bottom: 8px;
    color: #1d2d42;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.account-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid #e0e8ee;
    border-radius: 6px;
    background: #f7fafc;
}

.account-number {
    color: #142238;
    font-size: 19px;
    font-weight: 750;
    letter-spacing: 0.3px;
    word-break: break-all;
}

.account-actions .copy-btn {
    padding: 5px 8px;
    font-size: 12px;
}

.store-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
}

.account-caption {
    margin-top: 4px;
    margin-bottom: 10px;
    color: #637489;
    font-size: 13px;
}

.store-card {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid #dce5ec;
    border-radius: 7px;
    background: #fbfdfe;
}

.store-title {
    color: #1d2d42;
    font-size: 16px;
    font-weight: 740;
    margin-bottom: 4px;
}

.store-note {
    color: #637489;
    font-size: 14px;
    margin-bottom: 8px;
}

/* фото */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin-top: 12px;
}

.photo-grid a {
    display: block;
    border: 1px solid #dce5ec;
    border-radius: 5px;
    overflow: hidden;
    background: #f3f6f8;
}

.photo-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* текстовые блоки */
.agreement,
.inventory-text {
    padding: 13px 14px;
    border: 1px solid #dce5ec;
    border-radius: 7px;
    background: #fbfdfe;
    color: #2d3d52;
    font-size: 14px;
    line-height: 1.52;
}

.agreement {
    max-height: 420px;
    overflow: auto;
}

.agreement p {
    margin: 0 0 10px;
}

.agreement ul {
    margin: 0 0 10px 18px;
    padding: 0;
}

.agreement li {
    margin-bottom: 6px;
}

.inventory-edit {
    min-height: 520px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    line-height: 1.45;
}

.check-row {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin-top: 14px;
    color: #243348;
    font-size: 14px;
    line-height: 1.35;
}

.check-row input {
    margin-top: 2px;
}

.account-edit-card {
    padding: 12px;
    margin-top: 12px;
    border: 1px solid #dce5ec;
    border-radius: 7px;
    background: #fbfdfe;
}

.delete-row {
    color: #983030;
}

@media (min-width: 721px) {
    .app-login {
        margin-top: 4vh;
    }
}

@media (max-width: 720px) {
    body {
        padding: 0;
        background: #ffffff;
    }

    .app {
        max-width: none;
        min-height: 100vh;
        padding: 18px 15px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .title {
        font-size: 21px;
    }

    .info-table-row {
        grid-template-columns: 1fr;
    }

    .info-table-label {
        padding-bottom: 4px;
    }

    .info-table-value {
        padding-top: 4px;
    }

    .qr-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .qr-img,
    .qr-placeholder {
        width: 180px;
        height: 180px;
    }
}

@media (max-width: 520px) {

    .account-actions {
        justify-content: space-between;
    }

    .account-number {
        font-size: 20px;
    }

    .store-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .store-card .qr-img,
    .store-card .qr-placeholder {
        margin: 0 auto;
    }
}

@media (max-width: 420px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}