/* Phone-app shell — standalone PWA look, bottom dock, install sheet */
:root {
    --ame-app-dock-h: calc(58px + env(safe-area-inset-bottom, 0px));
}
html.ame-is-app,
html.ame-is-app body {
    background: #ffffff !important;
    overscroll-behavior: none;
}
html.ame-is-app body {
    padding-bottom: 0 !important;
}
.ame-app-dock,
.ame-app-install,
.ame-app-install.show {
    display: none !important;
}

.ame-app-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 12000;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    padding: 4px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: #ffffff;
    border-top: 1px solid #e5e5e5;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.04);
}
.ame-app-dock a,
.ame-app-dock button {
    appearance: none;
    border: 0;
    background: transparent;
    color: #525252;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    font-size: 10px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    border-radius: 12px;
}
.ame-app-dock svg {
    width: 22px;
    height: 22px;
    display: block;
}
.ame-app-dock .on {
    color: #111111;
    background: #f5f5f5;
}
.ame-app-install {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(var(--ame-app-dock-h) + 8px);
    z-index: 12001;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 12px 14px;
    background: #111111;
    color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.ame-app-install.show { display: flex; }
html.ame-is-app .ame-app-install { display: none !important; }
.ame-app-install p {
    margin: 0;
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff !important;
}
.ame-app-install button {
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}
.ame-app-install .go {
    background: #fff;
    color: #111;
}
.ame-app-install .x {
    background: transparent;
    color: #fff;
    padding: 8px;
}

/* Login lock screen */
.ame-lock {
    min-height: 100dvh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #111;
    padding: env(safe-area-inset-top, 0px) 22px calc(24px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    max-width: 430px;
    margin: 0 auto;
}
.ame-lock-status {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 800;
    padding: 8px 0 18px;
    color: #111;
}
.ame-lock-brand {
    text-align: center;
    margin: 12px 0 28px;
}
.ame-lock-icon {
    width: min(88vw, 340px);
    height: auto;
    margin: 0 auto 16px;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}
.ame-lock-icon img {
    width: 100%;
    height: auto;
    max-height: 168px;
    object-fit: contain;
    display: block;
}
.ame-lock-brand h1 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.ame-lock-brand p {
    margin: 0;
    color: #525252;
    font-size: 13px;
    font-weight: 650;
}
.ame-lock form { width: 100%; }
.ame-lock label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 6px;
    color: #111;
}
.ame-lock .field { margin-bottom: 12px; position: relative; }
.ame-lock input[type="text"],
.ame-lock input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 44px 14px 14px;
    border: 1.5px solid #d4d4d4;
    border-radius: 14px;
    font-size: 16px;
    background: #fff;
    color: #111;
}
.ame-lock .lgn-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 0;
    background: none;
    color: #525252;
    cursor: pointer;
}
.ame-lock .enter {
    width: 100%;
    margin-top: 8px;
    min-height: 52px;
    border: 0;
    border-radius: 14px;
    background: #111;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}
.ame-lock .forgot {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: #111;
    font-weight: 800;
    font-size: 13px;
    text-decoration: none;
}
.ame-lock .hint {
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
    color: #737373;
    line-height: 1.45;
}
.ame-lock .flash {
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid #e5e5e5;
}
.ame-lock-install {
    margin-top: auto;
    padding-top: 24px;
}
.ame-lock-install button,
.ame-lock-install .ios {
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid #111;
    background: #fff;
    color: #111;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}
.ame-lock-install .ios {
    display: none;
    text-align: center;
    padding: 12px;
    line-height: 1.45;
    box-sizing: border-box;
}
html.ame-ios .ame-lock-install .ios { display: block; }
html.ame-ios .ame-lock-install .and { display: none; }
html.ame-is-app .ame-lock-install { display: none; }

@media (min-width: 760px) {
    .ame-app-dock {
        left: 50%;
        right: auto;
        width: min(430px, 100%);
        transform: translateX(-50%);
        border-radius: 16px 16px 0 0;
        border: 1px solid #e5e5e5;
        border-bottom: 0;
    }
    .ame-app-install {
        left: 50%;
        right: auto;
        width: min(410px, calc(100% - 20px));
        transform: translateX(-50%);
    }
}
