:root {
    --fauba-primary: #176b4d;
    --fauba-primary-dark: #123c32;
    --fauba-primary-active: #0d2b24;
    --fauba-out: #f97316;
    --fauba-out-dark: #ea580c;
    --fauba-out-ink: #431407;
    --fauba-out-soft: #fff4e8;
    --fauba-primary-soft: #ecf2ef;
    --fauba-bg: #f5f7f8;
    --fauba-surface: #ffffff;
    --fauba-text: #25313b;
    --fauba-muted: #64746f;
    --fauba-border: #e2e9e5;
    --fauba-focus: #2563a6;
    --fauba-footer: #374151;
    --fauba-footer-muted: #d1d5db;
    --fauba-radius: 8px;
    --fauba-radius-surface: 12px;
    --fauba-shadow: 0 1px 2px rgba(37, 49, 59, 0.06);
    --fauba-font: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html {
    background: var(--fauba-bg);
    font-size: 19px;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--fauba-bg);
    color: var(--fauba-text);
    font-family: var(--fauba-font);
}

#app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--fauba-bg);
    font-family: var(--fauba-font);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.6rem;
    padding: calc(0.45rem + env(safe-area-inset-top)) 0.75rem 0.45rem;
    background: var(--fauba-surface);
    border-bottom: 1px solid var(--fauba-border);
}

.brand {
    display: block;
    flex: 1 0 100%;
    width: min(24rem, 92vw);
    max-width: 92vw;
    height: auto;
    max-height: 64px;
    margin: 0.1rem auto 0.15rem;
    object-fit: contain;
    object-position: center;
}

.topbar-side {
    width: 100%;
    margin-left: 0;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.topbar-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
}

.product {
    display: none;
    margin: 0;
    color: var(--fauba-primary-dark);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.who,
.top-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid var(--fauba-border);
    background: var(--fauba-surface);
    color: var(--fauba-primary-dark);
    border-radius: var(--fauba-radius);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    min-height: 2.5rem;
    padding: 0.4rem 0.75rem;
}

.who {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.top-btn {
    gap: 0.35rem;
    flex: 0 0 auto;
    line-height: 1;
}

.top-btn:hover,
.top-btn:focus {
    background: var(--fauba-primary-soft);
    color: var(--fauba-primary-dark);
}

.content {
    width: min(40rem, calc(100% - 1.5rem));
    margin: 0 auto;
    padding: 1rem 0 calc(1.25rem + env(safe-area-inset-bottom));
    flex: 1;
}

.content .container,
.content .row,
.content [class*="col-"] {
    width: auto;
    max-width: none;
    float: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

.mobile-leave {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.75rem;
}

.mobile-leave .who {
    flex: 1 1 auto;
    min-width: 0;
}

.guest-title {
    display: flex;
    margin: 0 0 0.75rem;
}

.guest-title .who {
    flex: 1 1 auto;
    width: 100%;
}

.content h2,
.sheet-card h2 {
    margin: 0 0 0.5rem;
    color: var(--fauba-primary-dark);
    font-size: 1.25rem;
    line-height: 1.25;
    font-weight: 600;
}

.sheet-in .sheet-card {
    border-top: 8px solid var(--fauba-primary);
}

.sheet-out .sheet-card {
    border-top: 8px solid var(--fauba-out);
}

.sheet-change .sheet-card {
    border-top: 8px solid var(--fauba-footer);
}

.sheet-card .moment-now {
    margin: 0 0 0.2rem;
    color: var(--fauba-muted);
}

.sheet-in .sheet-card h2,
.sheet-in .sheet-card .moment-now {
    color: var(--fauba-primary);
}

.sheet-out .sheet-card h2,
.sheet-out .sheet-card .moment-now {
    color: #ea580c;
}

.sheet-out .sheet-card h2,
.sheet-in .sheet-card h2,
.sheet-change .sheet-card h2 {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.65rem;
}

.panel {
    background: var(--fauba-surface);
    border: 1px solid var(--fauba-border);
    border-radius: var(--fauba-radius-surface);
    padding: 1rem 1.15rem;
    margin: 0 0 1rem;
    box-shadow: var(--fauba-shadow);
}

.kicker {
    margin: 0;
    color: var(--fauba-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.panel-title {
    margin: 0.25rem 0 0;
    color: var(--fauba-primary-dark);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.panel-meta {
    margin: 0.25rem 0 0;
    color: var(--fauba-muted);
    font-size: 1rem;
}

.stage-in,
.stage-out {
    border-radius: var(--fauba-radius-surface);
    padding: 0.7rem 0.7rem 0.15rem;
}

.stage-in {
    background: #e7f3ec;
}

.stage-out {
    background: var(--fauba-out-soft);
}

.moment {
    border-radius: var(--fauba-radius-surface);
    padding: 1.05rem 1.1rem 1.15rem;
    margin: 0 0 0.85rem;
    color: #fff;
}

.moment-in {
    background: var(--fauba-primary);
}

.moment-out {
    background: var(--fauba-out);
    color: var(--fauba-out-ink);
}

.moment-now {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.2;
}

.moment .moment-now {
    color: rgba(255, 255, 255, 0.88);
}

.content .moment-title {
    margin: 0.12rem 0 0;
    color: #fff;
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.moment-lead {
    margin: 0.45rem 0 0;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
}

.moment-out .moment-now,
.moment-out .moment-lead,
.content .moment-out .moment-title {
    color: var(--fauba-out-ink);
}

.panel-open {
    background: #fff7ed;
    border-color: #fdba74;
}

.panel-open .kicker,
.panel-open .panel-title {
    color: #ea580c;
}

.result {
    border-radius: var(--fauba-radius-surface);
    padding: 1rem 1.1rem 0.95rem;
    margin: 0 0 1rem;
    color: #fff;
}

.result-in {
    background: var(--fauba-primary);
}

.result-out {
    background: var(--fauba-out);
}

.result-change {
    background: var(--fauba-footer);
}

.result-now {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.result-title {
    margin: 0.12rem 0 0.45rem;
    color: #fff;
    font-size: 2.15rem;
    font-weight: 700;
    line-height: 1;
}

.result-body {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
}

.result-out,
.result-out .result-now,
.result-out .result-title,
.result-out .result-body {
    color: var(--fauba-out-ink);
}

.hint {
    margin: 0 0 0.75rem;
    color: var(--fauba-text);
    font-size: 0.9375rem;
    line-height: 1.45;
}

.content .alert {
    border-radius: var(--fauba-radius);
    padding: 0.75rem 1rem;
    margin: 0 0 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
}

.content .alert-danger {
    background: #fde8ea;
    color: #7d1d24;
    border: 1px solid #f0b7bd;
}

.content .alert-success {
    background: var(--fauba-primary-soft);
    color: var(--fauba-primary-dark);
    border: 1px solid #d5e4dc;
}

.login-card {
    background: var(--fauba-surface);
    border: 1px solid var(--fauba-border);
    border-radius: var(--fauba-radius-surface);
    padding: 1.25rem 1rem 0.5rem;
    box-shadow: var(--fauba-shadow);
}

.field {
    display: block;
    margin: 0 0 0.75rem;
    color: var(--fauba-text);
    font-weight: 600;
    font-size: 0.9375rem;
}

.field small {
    display: block;
    margin-top: 0.15rem;
    color: var(--fauba-muted);
    font-size: 0.8125rem;
    font-weight: 400;
}

.field input,
.field select {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--fauba-border);
    border-radius: var(--fauba-radius);
    background: var(--fauba-surface);
    color: var(--fauba-text);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.4;
}

.field input:focus,
.field select:focus,
.check-row input:focus,
.switch input:focus + .switch-ui,
.go:focus-visible,
.top-btn:focus-visible {
    outline: 2px solid var(--fauba-focus);
    outline-offset: 3px;
}

.switch,
.check-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.85rem;
    padding: 0.85rem 1rem;
    background: var(--fauba-surface);
    border: 1px solid var(--fauba-border);
    border-radius: var(--fauba-radius-surface);
    color: var(--fauba-text);
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.35;
}

.switch {
    position: relative;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.switch-ui {
    width: 2.75rem;
    height: 1.6rem;
    border-radius: 999px;
    background: #c5d0cb;
    position: relative;
    flex: 0 0 auto;
}

.switch-ui::after {
    content: "";
    position: absolute;
    top: 0.16rem;
    left: 0.16rem;
    width: 1.28rem;
    height: 1.28rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(37, 49, 59, 0.28);
    transition: transform 150ms ease;
}

.switch input:checked + .switch-ui {
    background: var(--fauba-primary);
}

.switch input:checked + .switch-ui::after {
    transform: translateX(1.15rem);
}

.check-row input {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--fauba-primary);
    flex: 0 0 auto;
    margin: 0;
}

.go,
.switch,
.check-row,
.top-btn {
    cursor: pointer;
    touch-action: manipulation;
}

.go {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    max-width: 100%;
    min-height: 2.75rem;
    margin: 0 0 0.55rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--fauba-radius);
    border: 1px solid transparent;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.go:hover,
.go:focus {
    color: #fff;
    text-decoration: none;
}

.ico {
    width: 1.125rem;
    height: 1.125rem;
    max-width: 1.125rem;
    max-height: 1.125rem;
    flex: 0 0 auto;
}

.go-in {
    background: var(--fauba-primary);
    border-color: var(--fauba-primary);
}

.go-in:hover,
.go-in:focus {
    background: var(--fauba-primary-dark);
    border-color: var(--fauba-primary-dark);
}

.go-in:active {
    background: var(--fauba-primary-active);
    border-color: var(--fauba-primary-active);
}

.go-out {
    background: var(--fauba-out);
    border-color: var(--fauba-out-dark);
    color: var(--fauba-out-ink);
}

.go-out:hover,
.go-out:focus,
.go-out:active {
    background: var(--fauba-out-dark);
    border-color: var(--fauba-out-dark);
    color: var(--fauba-out-ink);
}

.go-moment {
    min-height: 3.85rem;
    margin-top: 0.15rem;
    font-size: 1.28rem;
    font-weight: 700;
}

.go-moment .ico {
    width: 1.4rem;
    height: 1.4rem;
    max-width: 1.4rem;
    max-height: 1.4rem;
}

.go-shift,
.go-leave {
    background: var(--fauba-footer);
    border-color: var(--fauba-footer);
    color: #fff;
}

.go-shift:hover,
.go-shift:focus,
.go-leave:hover,
.go-leave:focus,
.go-shift:active,
.go-leave:active {
    background: #1f2937;
    border-color: #1f2937;
    color: #fff;
}

.go-ghost,
.go-change {
    background: var(--fauba-surface);
    color: var(--fauba-primary-dark);
    border-color: var(--fauba-border);
}

.go-ghost:hover,
.go-ghost:focus,
.go-change:hover,
.go-change:focus {
    background: var(--fauba-primary-soft);
    color: var(--fauba-primary-dark);
    border-color: #d5e4dc;
}

.go-change {
    justify-content: flex-start;
    text-align: left;
}

.go-kicker {
    display: block;
    color: var(--fauba-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.go-label {
    display: block;
    margin-top: 0.1rem;
    color: var(--fauba-text);
    font-size: 1rem;
    font-weight: 600;
}

.go-change .ico {
    align-self: center;
}

.divider {
    margin: 0.35rem 0 0.7rem;
    padding: 0;
    background: none;
    color: var(--fauba-primary-dark);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0;
}

.sheet {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0.75rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    background: rgba(37, 49, 59, 0.46);
}

.sheet[hidden] {
    display: none !important;
}

.sheet-card {
    width: min(100%, 28rem);
    background: var(--fauba-surface);
    border: 1px solid var(--fauba-border);
    border-radius: var(--fauba-radius-surface) var(--fauba-radius-surface) var(--fauba-radius) var(--fauba-radius);
    padding: 1.15rem 1rem 0.45rem;
    box-shadow: 0 12px 32px rgba(37, 49, 59, 0.24);
    font-family: var(--fauba-font);
}

.sheet-card p {
    margin: 0 0 1rem;
    font-size: 1rem;
    line-height: 1.45;
}

.pie {
    background: var(--fauba-footer);
    color: #fff;
}

.pie-inner {
    width: min(70rem, calc(100% - 1.5rem));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.9rem 0 calc(0.9rem + env(safe-area-inset-bottom));
}

.pie img {
    height: 36px;
    max-height: 36px;
    width: auto;
    max-width: 16rem;
    display: block;
    background: none;
    padding: 0;
}

.pie p {
    margin: 0;
    color: #fff;
    font-size: 0.8125rem;
    line-height: 1.35;
}

.pie span {
    color: var(--fauba-footer-muted);
}

@media (min-width: 900px) {
    html {
        font-size: 16px;
    }

    .topbar {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.85rem 1.5rem 0.65rem;
    }

    .brand {
        flex: 1 0 100%;
        width: min(36rem, 70vw);
        max-width: 70vw;
        height: auto;
        max-height: 84px;
        margin: 0 auto 0.35rem;
        object-position: center;
    }

    .topbar-side {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }

    .content {
        width: min(52rem, calc(100% - 4rem));
        padding-top: 1.5rem;
        padding-bottom: 2rem;
    }

    .stage {
        background: var(--fauba-surface);
        border: 1px solid var(--fauba-border);
        border-radius: var(--fauba-radius-surface);
        padding: 1.15rem 1.25rem 0.45rem;
        box-shadow: var(--fauba-shadow);
    }

    .stage-in {
        background: var(--fauba-surface);
        border-top: 8px solid var(--fauba-primary);
    }

    .stage-out {
        background: var(--fauba-surface);
        border-top: 8px solid var(--fauba-out);
    }

    .panel {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 0.85rem;
        padding: 0.85rem 1rem;
        background: var(--fauba-primary-soft);
    }

    .panel-open {
        background: #fff7ed;
        border-color: #fdba74;
    }

    .panel-title {
        font-size: 1.15rem;
    }

    .panel-meta {
        margin: 0;
        font-size: 0.95rem;
        text-align: right;
    }

    .login-card {
        max-width: 24rem;
        margin: 0.5rem auto 0;
        padding: 1.25rem 1.25rem 0.6rem;
    }

    .guest-title {
        width: min(calc(24rem + 2.5rem + 2px), 100%);
        margin-left: auto;
        margin-right: auto;
    }

    .actions .go-moment {
        min-height: 4rem;
        font-size: 1.35rem;
    }

    .actions .divider {
        margin-top: 0.85rem;
        font-size: 1rem;
    }

    .go-change {
        min-height: 2.75rem;
    }

    .sheet {
        align-items: center;
    }

    .sheet-card {
        border-radius: var(--fauba-radius-surface);
    }

    .pie img {
        height: 44px;
        max-height: 44px;
        max-width: 20rem;
    }

    .mobile-leave {
        display: none;
    }

    .pie-inner {
        width: min(52rem, calc(100% - 4rem));
    }
}

@media (prefers-reduced-motion: reduce) {
    .switch-ui::after,
    .go {
        transition: none;
    }
}
