.legacy-sign-field,
.legacy-app-trigger {
    display: none !important;
}

.sign-app-picker {
    margin: 0 0 24px;
    padding: 18px;
    border: 1px solid rgba(74, 137, 220, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 30px rgba(31, 45, 61, 0.08);
}

.sign-picker-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.sign-picker-heading h2 {
    margin: 0 0 4px;
    color: #1f2d3d;
    font-size: 18px;
    line-height: 1.35;
}

.sign-picker-heading p {
    margin: 0;
    color: #8492a6;
    font-size: 12px;
    line-height: 1.5;
}

.sign-picker-badge {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    color: #2d6bc4;
    background: #edf5ff;
    font-size: 11px;
    font-weight: 700;
}

.sign-category-tabs {
    display: flex;
    gap: 8px;
    margin: 0 -2px 14px;
    padding: 2px 2px 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.sign-category-tabs::-webkit-scrollbar {
    display: none;
}

.sign-category-tab {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 14px;
    border: 1px solid #e7edf5;
    border-radius: 999px;
    color: #5e6d82;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.sign-category-tab.is-active {
    border-color: #4a89dc;
    color: #fff;
    background: #4a89dc;
}

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

.sign-app-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 112px;
    padding: 13px;
    border: 1px solid #edf0f5;
    border-radius: 16px;
    color: inherit;
    background: #fff;
    text-align: left;
    box-shadow: 0 7px 18px rgba(31, 45, 61, 0.06);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.sign-app-card:active {
    transform: scale(.98);
}

.sign-app-card:focus-visible,
.sign-category-tab:focus-visible,
.sign-config-close:focus-visible,
.sign-icon-action:focus-visible,
.sign-submit-button:focus-visible {
    outline: 3px solid rgba(74, 137, 220, .3);
    outline-offset: 2px;
}

.sign-app-card.is-selected {
    border-color: #4a89dc;
    box-shadow: 0 9px 24px rgba(74, 137, 220, .18);
}

.sign-app-card.is-selected::after {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #fff;
    background: #4a89dc;
    content: "✓";
    font-size: 12px;
    font-weight: 900;
    line-height: 20px;
    text-align: center;
}

.sign-app-card-icon,
.sign-selected-icon,
.sign-icon-preview {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border-radius: 15px;
    color: #4a89dc;
    background: linear-gradient(145deg, #edf5ff, #f8fbff);
    font-size: 11px;
    font-weight: 900;
}

.sign-app-card-icon {
    width: 54px;
    height: 54px;
    margin-right: 11px;
}

.sign-app-card-icon img,
.sign-selected-icon img,
.sign-icon-preview img {
    position: absolute;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sign-app-card-content {
    min-width: 0;
    padding-top: 3px;
}

.sign-app-card-name {
    display: block;
    margin-right: 14px;
    overflow: hidden;
    color: #1f2d3d;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sign-app-card-meta,
.sign-app-card-category {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: #8492a6;
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sign-app-card-category {
    color: #4a89dc;
}

.sign-app-empty {
    padding: 28px 12px;
    color: #8492a6;
    text-align: center;
}

.sign-app-empty i {
    display: block;
    margin-bottom: 8px;
    font-size: 28px;
}

body.sign-modal-open {
    overflow: hidden;
    touch-action: none;
}

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

.sign-config-modal {
    position: fixed;
    z-index: 12000;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 18px;
}

.sign-config-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(13, 24, 38, .62);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.sign-config-sheet {
    position: relative;
    z-index: 1;
    width: min(100%, 560px);
    max-height: calc(100vh - 36px);
    max-height: calc(100dvh - 36px);
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(8, 20, 35, .28);
}

.sign-config-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #edf0f5;
    background: linear-gradient(135deg, #f8fbff, #fff);
}

.sign-selected-icon {
    width: 56px;
    height: 56px;
}

.sign-selected-copy {
    min-width: 0;
    flex: 1;
}

.sign-selected-copy small {
    display: block;
    margin-bottom: 3px;
    color: #8492a6;
    font-size: 11px;
}

.sign-selected-copy h2 {
    margin: 0;
    overflow: hidden;
    color: #1f2d3d;
    font-size: 18px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sign-selected-copy p {
    margin: 3px 0 0;
    color: #8492a6;
    font-size: 11px;
}

.sign-config-close {
    display: grid;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #5e6d82;
    background: #edf2f7;
    font-size: 18px;
    cursor: pointer;
}

.sign-config-body {
    max-height: calc(100vh - 136px);
    max-height: calc(100dvh - 136px);
    padding: 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.sign-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.sign-form-row-two {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(110px, .45fr);
    gap: 12px;
}

.sign-form-field {
    min-width: 0;
}

.sign-form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
    color: #34495e;
    font-size: 12px;
    font-weight: 800;
}

.sign-form-label small {
    color: #a0aec0;
    font-weight: 400;
}

.sign-form-control {
    width: 100%;
    height: 46px;
    padding: 10px 13px;
    border: 1px solid #dfe6ef;
    border-radius: 12px;
    color: #1f2d3d;
    background: #fff;
    font-size: 14px;
    line-height: 24px;
    outline: 0;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.sign-form-control:focus {
    border-color: #4a89dc;
    box-shadow: 0 0 0 3px rgba(74, 137, 220, .12);
}

.sign-input-with-action {
    display: flex;
    gap: 8px;
}

.sign-input-with-action .sign-form-control {
    min-width: 0;
    flex: 1;
}

.sign-inline-action {
    flex: 0 0 auto;
    min-width: 80px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    color: #2d6bc4;
    background: #edf5ff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.sign-icon-editor {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px;
    border: 1px dashed #cbd7e6;
    border-radius: 14px;
    background: #fafcff;
}

.sign-icon-preview {
    width: 68px;
    height: 68px;
}

.sign-icon-controls {
    min-width: 0;
    flex: 1;
}

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

.sign-icon-action {
    min-height: 34px;
    padding: 7px 11px;
    border: 0;
    border-radius: 9px;
    color: #2d6bc4;
    background: #edf5ff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.sign-icon-action.is-muted {
    color: #5e6d82;
    background: #edf0f5;
}

.sign-icon-status {
    display: block;
    margin-top: 7px;
    overflow: hidden;
    color: #8492a6;
    font-size: 11px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sign-app-description {
    padding: 11px 13px;
    border-radius: 12px;
    color: #5e6d82;
    background: #f7f9fc;
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.sign-config-actions {
    margin-top: 18px;
}

.sign-submit-button {
    width: 100%;
    min-height: 50px;
    padding: 12px 18px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #34b27b, #27a56f);
    box-shadow: 0 10px 22px rgba(39, 165, 111, .24);
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
}

.sign-submit-button[disabled] {
    cursor: wait;
    opacity: .65;
}

.sign-config-hint {
    margin: 9px 0 0;
    color: #9aa7b6;
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

@media (min-width: 540px) {
    .sign-app-wall {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sign-config-modal {
        align-items: center;
    }
}

@media (max-width: 380px) {
    .sign-app-picker {
        padding: 14px;
    }

    .sign-app-wall {
        gap: 9px;
    }

    .sign-app-card {
        display: block;
        min-height: 138px;
        padding: 11px;
    }

    .sign-app-card-icon {
        margin: 0 0 8px;
    }

    .sign-form-row-two {
        grid-template-columns: 1fr;
    }

    .sign-config-modal {
        padding: 8px;
    }

    .sign-config-sheet {
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 20px;
    }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .sign-config-body {
        padding-bottom: calc(18px + env(safe-area-inset-bottom));
    }
}

.direct-install-panel {
    color: #fff;
    text-align: center;
}

.direct-install-summary {
    margin: 0 0 16px;
    color: #fff;
    font-size: 13px;
    line-height: 1.7;
}

.direct-install-item + .direct-install-item {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .18);
}

.direct-install-title {
    display: block;
    margin-bottom: 10px;
    color: #fff;
    font-size: 14px;
}

.direct-install-qr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    min-height: 200px;
    margin: 0 auto 14px;
    padding: 10px;
    border-radius: 14px;
    background: #fff;
}

.direct-install-qr canvas,
.direct-install-qr img {
    display: block;
    width: 180px !important;
    height: 180px !important;
}

.direct-install-link {
    display: block;
    margin: 0 auto;
    color: #fff !important;
    text-decoration: none;
}
