/*
 * GOMGOM compact compatibility layer
 *
 * Shared controls and runtime interaction states. Reset, viewport and app-shell
 * rules belong to foundation; screen-specific rules belong to page stylesheets.
 */

/* Shared editorial typography and generic actions. */
.eyebrow {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.title {
    margin: 0;
    font-size: clamp(37px, 9.7vw, 48px);
    font-weight: 780;
    line-height: 1.07;
    letter-spacing: -.07em;
    word-break: keep-all;
}

.lead {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: -.025em;
    word-break: keep-all;
}

.primary,
.secondary {
    width: 100%;
    border-radius: var(--gomgom-control-radius, 999px);
    font-weight: 850;
}

.primary {
    height: 54px;
    margin-top: 20px;
    border: 0;
    background: var(--b);
    color: #fff;
}

.secondary {
    height: 48px;
    margin-top: 10px;
    border: 1px solid var(--b);
    background: #fff;
    color: var(--b);
}

/* Shared header icon buttons. */
.compact-header-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--b);
    text-decoration: none;
    box-shadow: none;
}

.compact-header-icon svg {
    width: 23px;
    height: 23px;
    display: block;
    fill: currentColor;
    pointer-events: none;
}

.compact-header-icon:active {
    opacity: .55;
}

.compact-notification-button {
    cursor: pointer;
}

.compact-notification-button.has-notification {
    color: var(--v);
}

/* Legacy footer lock toast retained until its renderer uses .toast. */
.guel-footer-lock-toast {
    position: absolute;
    left: 50%;
    bottom: calc(var(--gomgom-bottom-nav-height, 82px) + var(--gomgom-safe-bottom, 0px) + 14px);
    z-index: 280;
    max-width: calc(100% - 40px);
    padding: 11px 16px;
    border-radius: var(--gomgom-control-radius, 999px);
    background: rgba(17, 17, 17, .92);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
    box-shadow: var(--gomgom-shadow-floating, 0 16px 42px rgba(17, 17, 17, .13));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.guel-footer-lock-toast.is-show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* Physical drag dock: behavioral states layered on foundation navigation. */
html[data-compact-page]:not([data-compact-page="reader"]),
html[data-compact-page]:not([data-compact-page="reader"]) body {
    height: 100%;
    overflow: hidden;
}

html[data-compact-page]:not([data-compact-page="reader"]) .stage,
html[data-compact-page]:not([data-compact-page="reader"]) .app {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.app-bottom-nav.compact-drag-dock {
    --compact-dock-width: 252px;
    --compact-dock-height: 90px;
    --compact-dock-center-size: 54px;
    --compact-dock-side-icon-size: 26px;
    --compact-dock-gap: 6px;
    --compact-dock-radius: 41px;
    position: fixed;
    left: 50%;
    right: auto;
    bottom: max(12px, var(--gomgom-safe-bottom, 0px));
    z-index: 200;
    width: min(var(--compact-dock-width), calc(100vw - 28px));
    min-height: var(--compact-dock-height);
    padding: 7px 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--compact-dock-center-size) minmax(0, 1fr);
    gap: var(--compact-dock-gap);
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--compact-dock-radius);
    background: #fff;
    box-shadow: none;
    overflow: visible;
    isolation: isolate;
    transform: translateX(-50%);
}

.app-bottom-nav.compact-drag-dock .nav-tab {
    z-index: 2;
    width: 100%;
    min-height: var(--compact-dock-center-size);
    padding: 0;
    flex-direction: row;
    gap: 0;
    border-radius: calc(var(--compact-dock-center-size) / 2);
    background: transparent;
    color: #242421;
    touch-action: none;
    user-select: none;
}

/* Side tabs stretch to the full row height so the icon can be pinned to the
   same center line as the HOME circle, with the label occupying the space
   below — keeps all three icons on one visual row (설계 논의: A안). */
.app-bottom-nav.compact-drag-dock .dock-glab,
.app-bottom-nav.compact-drag-dock .dock-my {
    align-self: stretch;
    height: auto;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
}

.app-bottom-nav.compact-drag-dock .dock-glab .dock-side-icon,
.app-bottom-nav.compact-drag-dock .dock-my .dock-side-icon {
    /* centers the icon on the same line as the HOME circle: row content height
       is (dock height - vertical padding), and HOME's icon center sits at
       half of that; this offsets the smaller side icon to match. */
    margin-top: calc((var(--compact-dock-height) - 14px - var(--compact-dock-side-icon-size)) / 2);
}

.app-bottom-nav.compact-drag-dock .nav-label {
    display: none;
}

.app-bottom-nav.compact-drag-dock .dock-glab .nav-label,
.app-bottom-nav.compact-drag-dock .dock-my .nav-label {
    display: flex;
    align-items: center;
    gap: 1px;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: -.01em;
    white-space: nowrap;
}

.app-bottom-nav.compact-drag-dock .dock-glab .nav-label {
    color: var(--v);
}

.app-bottom-nav.compact-drag-dock .dock-my .nav-label {
    color: var(--c);
}

.app-bottom-nav.compact-drag-dock .nav-label .dock-label-chevron {
    font-weight: 900;
}

.app-bottom-nav.compact-drag-dock .center-home {
    z-index: 4;
    width: var(--compact-dock-center-size);
    height: var(--compact-dock-center-size);
    border-radius: 0;
    background: transparent;
    color: #000;
}

.app-bottom-nav.compact-drag-dock .center-home .dock-icon {
    width: var(--compact-dock-center-size);
    height: var(--compact-dock-center-size);
    display: block;
    color: #000;
    pointer-events: none;
}

.app-bottom-nav.compact-drag-dock .dock-side-icon {
    width: var(--compact-dock-side-icon-size);
    height: var(--compact-dock-side-icon-size);
    display: block;
    pointer-events: none;
}

.app-bottom-nav.compact-drag-dock .dock-glab-icon {
    fill: var(--v);
}

.app-bottom-nav.compact-drag-dock .dock-my-icon {
    fill: var(--c);
}

.app-bottom-nav.compact-drag-dock .nav-tab.active {
    background: transparent;
    color: #242421;
}

.app-bottom-nav.compact-drag-dock .nav-tab.active::after {
    display: none;
    content: none;
}

.app-bottom-nav.compact-drag-dock .nav-tab.is-dragging,
.app-bottom-nav.compact-drag-dock .nav-tab.is-armed {
    z-index: 6;
    background: #fff;
    box-shadow: 0 6px 14px rgba(36, 36, 33, .12);
}

.app-bottom-nav.compact-drag-dock .nav-tab.is-dragging {
    transition: none;
}

.app-bottom-nav.compact-drag-dock .dock-target-ring {
    position: absolute;
    z-index: 1;
    left: 50%;
    top: 50%;
    width: 46px;
    height: 46px;
    border: 1px dashed rgba(17, 17, 17, .18);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(.84);
}

.app-bottom-nav.compact-drag-dock.is-dragging .dock-target-ring {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Runtime pull-to-refresh indicator. */
#gomgomPullRefresh {
    position: absolute;
    left: 50%;
    top: calc(var(--gomgom-header-height, 76px) + var(--gomgom-safe-top, 0px) + 6px);
    z-index: 250;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: var(--gomgom-control-radius, 999px);
    background: rgba(255, 255, 255, .96);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -18px);
    transition: opacity .14s ease, transform .14s ease;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }

    .app-bottom-nav.compact-drag-dock .nav-tab,
    .app-bottom-nav.compact-drag-dock .dock-target-ring,
    #gomgomPullRefresh,
    .guel-footer-lock-toast {
        transition: none !important;
    }
}
