/*
 * GOMGOM compact foundation
 * Owns brand tokens, viewport shell, shared header, screen insets and bottom nav.
 * Page files must not redefine these component contracts.
 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
    background: var(--gomgom-color-canvas);
    color: var(--gomgom-color-ink);
    -webkit-tap-highlight-color: transparent;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

body.gomgom-mobile-webapp {
    min-width: 320px;
    font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.stage {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: stretch;
    overflow: hidden;
    background: var(--gomgom-color-canvas);
}

.app {
    position: relative;
    width: min(100%, var(--gomgom-app-max-width));
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    margin: 0 auto;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: var(--gomgom-color-paper);
    box-shadow: none;
}

.screen {
    position: absolute;
    inset: 0;
    min-width: 0;
    padding:
        calc(var(--gomgom-header-height) + var(--gomgom-safe-top) + 12px)
        var(--gomgom-page-gutter)
        calc(var(--gomgom-bottom-nav-height) + var(--gomgom-safe-bottom) + 24px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.screen::-webkit-scrollbar {
    display: none;
}

.top {
    position: absolute;
    inset: 0 0 auto;
    z-index: 60;
    min-height: calc(var(--gomgom-header-height) + var(--gomgom-safe-top));
    padding:
        calc(var(--gomgom-safe-top) + 17px)
        var(--gomgom-page-gutter)
        10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--gomgom-color-line);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 40px;
    text-decoration: none;
}

.brand-mark {
    display: block;
    width: 40px;
    height: 40px;
}

.brand-mark-outline {
    fill: var(--gomgom-color-violet);
}

.brand-mark-coral .brand-mark-outline {
    fill: var(--gomgom-color-coral);
}

.brand-mark-face {
    fill: var(--gomgom-color-ink);
}

.top-actions,
.compact-account-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticket-status {
    max-width: 138px;
    min-height: 30px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--gomgom-color-line);
    border-radius: var(--gomgom-control-radius);
    background: var(--gomgom-color-paper);
    color: var(--gomgom-color-muted);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ticket-status.active {
    border-color: rgba(119, 80, 248, .24);
    background: rgba(119, 80, 248, .08);
    color: var(--gomgom-color-violet);
}

.app-bottom-nav {
    position: absolute;
    inset: auto 0 0;
    z-index: 70;
    width: 100%;
    min-height: calc(var(--gomgom-bottom-nav-height) + var(--gomgom-safe-bottom));
    padding: 8px 20px calc(8px + var(--gomgom-safe-bottom));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    border-top: 1px solid var(--gomgom-color-line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.app-bottom-nav .nav-tab {
    position: relative;
    min-width: 0;
    min-height: 58px;
    padding: 7px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: rgba(17, 17, 17, .42);
    text-decoration: none;
}

.app-bottom-nav .nav-tab.active {
    background: rgba(119, 80, 248, .09);
    color: var(--gomgom-color-ink);
}

.app-bottom-nav .nav-tab.active::after {
    content: "";
    position: absolute;
    top: 7px;
    right: calc(50% - 17px);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gomgom-color-violet);
}

.app-bottom-nav .nav-label {
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
}

.toast {
    position: absolute;
    left: 50%;
    bottom: calc(var(--gomgom-bottom-nav-height) + var(--gomgom-safe-bottom) + 14px);
    z-index: 100;
    max-width: calc(100% - 40px);
    padding: 11px 16px;
    border-radius: var(--gomgom-control-radius);
    background: rgba(17, 17, 17, .92);
    color: #fff;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: var(--gomgom-shadow-floating);
    transform: translate(-50%, 10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (min-width: 449px) {
    .stage {
        padding: 18px;
        align-items: center;
    }

    .app {
        height: min(900px, calc(100vh - 36px));
        height: min(900px, calc(100dvh - 36px));
        border: 1px solid var(--gomgom-color-line);
        border-radius: 32px;
        box-shadow: 0 28px 80px rgba(17, 17, 17, .14);
    }
}

@media (max-width: 359px) {
    .ticket-status {
        max-width: 112px;
    }
}
