.app-launcher {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: clamp(28px, 7vw, 72px) clamp(18px, 5vw, 48px);
    box-sizing: border-box;
    font-family: "UniChat", "Nunito Sans", sans-serif;
}

#main-feed-box {
    box-sizing: border-box;
    max-height: calc(100dvh - 30px);
    padding-bottom: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.app-launcher-heading p {
    margin: 0 0 5px;
    color: rgba(var(--main-blue), 1);
    font-size: 0.82rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-launcher-heading h1 {
    margin: 0;
    font-size: clamp(2rem, 6vw, 3.4rem);
    font-weight: 600;
    letter-spacing: -0.045em;
    line-height: 1;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(18px, 4vw, 30px);
    margin-top: clamp(38px, 8vw, 72px);
}

.uni-app-button {
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #111;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.uni-app-button img {
    display: block;
    width: min(100%, 230px);
    aspect-ratio: 1;
    border-radius: 25%;
    object-fit: cover;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.uni-app-button span {
    max-width: 230px;
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
}

.uni-app-button:hover img,
.uni-app-button:focus-visible img {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.uni-app-button:focus-visible {
    outline: 3px solid rgba(var(--main-blue), 0.35);
    outline-offset: 8px;
    border-radius: 18px;
}

.planner-events-list {
    width: 100%;
    max-height: calc(100vh - 165px);
    padding: 0 10px 10px;
    box-sizing: border-box;
    overflow-y: auto;
    font-family: "UniChat", "Nunito Sans", sans-serif;
}

.planner-events-empty {
    padding: 18px 8px 24px;
    color: rgba(0, 0, 0, 0.5);
    text-align: center;
}

.planner-event-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 13px 4px;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
    cursor: pointer;
}

.planner-event-card:focus-visible {
    outline: 3px solid rgba(var(--main-blue), 0.35);
    outline-offset: -2px;
}

.planner-event-card time {
    color: rgba(var(--main-blue), 1);
    font-size: 0.76rem;
    font-weight: 650;
    text-transform: uppercase;
}

.planner-event-card strong {
    font-size: 0.98rem;
    line-height: 1.2;
}

.planner-event-card span {
    color: rgba(0, 0, 0, 0.58);
    font-size: 0.82rem;
}

.app-frame-shell {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    grid-template-rows: 52px minmax(0, 1fr);
    background: #fff;
}

.app-frame-shell[hidden] {
    display: none;
}

.app-frame-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: env(safe-area-inset-top) 14px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.94);
    font-family: "UniChat", "Nunito Sans", sans-serif;
}

.app-frame-bar strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#app-frame-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f0f1f4;
    color: #111;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

#app-frame {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: #fff;
}

body.app-frame-open {
    overflow: hidden !important;
}

.app-details-overlay {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: grid;
    place-items: center;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
}

.app-details-overlay[hidden] {
    display: none;
}

.app-details-overlay[data-open="true"] {
    opacity: 1;
    visibility: visible;
}

.app-details-modal {
    width: min(100%, 430px);
    max-height: min(720px, calc(100dvh - 40px));
    overflow-y: auto;
    padding: 22px;
    box-sizing: border-box;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    color: #111827;
    font-family: "UniChat", "Nunito Sans", sans-serif;
    text-align: center;
    opacity: 0;
    transform: translateY(14px) scale(0.97);
    transition: opacity 200ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.app-details-overlay[data-open="true"] .app-details-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.app-details-icon-wrap {
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    border-radius: 17px;
    background: #f2f5ff;
}

.app-details-icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-details-modal[data-app-name="Polly AI"] .app-details-icon {
    padding: 22px;
    box-sizing: border-box;
    object-fit: contain;
}

.app-details-modal h2 {
    margin: 22px 0 0;
    font-size: clamp(1.55rem, 5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.app-details-copy {
    margin-top: 12px;
}

.app-details-copy p {
    margin: 0;
    color: #596170;
    font-size: 1rem;
    line-height: 1.5;
}

.app-details-copy .app-details-unavailable {
    margin-top: 12px;
    color: #e04b67;
    font-weight: 700;
}

.mini-app-notify-form {
    margin: 0;
}

.mini-app-notify-fields {
    display: grid;
    gap: 0;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: max-height 360ms cubic-bezier(0.22, 1, 0.36, 1), gap 300ms ease, margin-top 300ms ease, opacity 220ms ease, transform 300ms ease;
}

.mini-app-notify-form.is-expanded .mini-app-notify-fields {
    gap: 7px;
    max-height: 520px;
    margin-top: 20px;
    opacity: 1;
    transform: translateY(0);
}

.mini-app-notify-fields label {
    margin-top: 5px;
    color: #303846;
    font-size: 0.84rem;
    font-weight: 700;
    text-align: left;
}

.mini-app-notify-fields input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    box-sizing: border-box;
    border: 1px solid #d7dce5;
    border-radius: 11px;
    background: #fff;
    color: #111827;
    font: inherit;
}

.mini-app-notify-fields input:focus {
    border-color: rgb(var(--main-blue));
    outline: 3px solid rgba(var(--main-blue), 0.14);
}

.mini-app-notify-errors {
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff0f3;
    color: #b4233d;
    font-size: 0.88rem;
    line-height: 1.35;
    text-align: left;
}

.mini-app-notify-success {
    margin: 20px 0 0;
    color: #147a43;
    font-weight: 700;
    line-height: 1.4;
}

.public-form-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.app-details-action {
    width: 100%;
    min-height: 50px;
    margin-top: 24px;
    padding: 12px 20px;
    border: 0;
    border-radius: 14px;
    background: rgb(var(--main-blue));
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(var(--main-blue), 0.22);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.app-details-action:hover,
.app-details-action:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(var(--main-blue), 0.3);
    filter: brightness(1.04);
}

.app-details-action:active {
    transform: translateY(0) scale(0.985);
}

.app-details-action:focus-visible,
.app-details-modal:focus-visible {
    outline: 3px solid rgba(var(--main-blue), 0.35);
    outline-offset: 3px;
}

body.app-details-open {
    overflow: hidden !important;
}

@media (max-width: 900px) {
    .phone-view-nav-choice {
        width: calc(100% / 3);
        font-size: clamp(0.95rem, 4.5vw, 1.2rem);
    }

    .app-launcher {
        min-height: calc(100vh - 120px);
        padding-top: 34px;
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }

    #main-feed-box {
        max-height: calc(100dvh - 120px);
    }

    .app-grid {
        gap: 20px;
        margin-top: 38px;
        padding-bottom: 50px;
    }

    .uni-app-button img {
        width: 100%;
    }

    .planner-events-list {
        max-height: calc(100vh - 180px);
    }
}

@media (max-width: 430px) {
    .app-launcher {
        padding-inline: 16px;
    }

    .app-grid {
        gap: 16px;
    }

    .uni-app-button {
        gap: 10px;
    }

    .uni-app-button span {
        font-size: 1rem;
    }

    .app-details-overlay {
        padding: 14px;
    }

    .app-details-modal {
        padding: 18px;
        border-radius: 21px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-details-overlay,
    .app-details-modal,
    .app-details-action {
        transition-duration: 1ms;
    }

    .mini-app-notify-fields {
        transition-duration: 1ms;
    }
}
