*,
*::before,
*::after {
    box-sizing: border-box;
}

@keyframes mhub-view-enter {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes mhub-view-exit {
    to { opacity: 0; }
}

@keyframes mhub-dialog-enter {
    from { opacity: 0; transform: scale(0.985); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes mhub-dialog-exit {
    to { opacity: 0; transform: scale(0.99); }
}

@keyframes mhub-backdrop-enter {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes mhub-backdrop-exit {
    to { opacity: 0; }
}

.mhub-view-enter { animation: mhub-view-enter 360ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.mhub-view-exit { animation: mhub-view-exit 180ms ease both; pointer-events: none; }

body[data-page]:not([data-page=""]) main {
    animation: mhub-view-enter 140ms ease-out both;
}

* {
    -webkit-user-select: none;
    user-select: none;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

:is(input, textarea, [contenteditable="true"], [contenteditable=""], [data-selectable="true"]) {
    -webkit-user-select: text;
    user-select: text;
}

html {
    scroll-behavior: smooth;
}

body {
    position: relative;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    letter-spacing: var(--letter-spacing);
    line-height: 1.5;
    text-rendering: optimizeLegibility;
}

.smoke-background {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100svh;
    pointer-events: none;
}

.site-header,
main,
.site-footer {
    position: relative;
    z-index: 1;
}

main {
    min-height: calc(100svh - 77px);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    margin-bottom: 0;
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 0.95;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
a,
input {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

::selection {
    background: var(--primary);
    color: var(--primary-foreground);
}

.mhub-redesign .toast-notification {
    position: fixed;
    z-index: 1100;
    top: max(92px, calc(env(safe-area-inset-top) + 76px));
    right: max(20px, env(safe-area-inset-right));
    bottom: auto;
    left: auto;
    width: min(420px, calc(100vw - 32px));
    opacity: 0;
    pointer-events: none;
    transform: none;
    transition: opacity 180ms ease;
}

.mhub-redesign .toast-notification.show {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.mhub-redesign .toast-content {
    display: flex;
    min-width: 0;
    max-width: 100%;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border: 1px solid color-mix(in srgb, var(--foreground) 16%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--background) 90%, transparent);
    box-shadow: 0 16px 44px rgb(0 0 0 / 28%);
    color: var(--foreground);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.mhub-redesign .toast-icon {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--foreground) 9%, transparent);
    font-size: 15px;
    font-weight: 700;
}

.mhub-redesign .toast-notification.success .toast-icon::before {
    content: "✓";
    color: #5fca8c;
}

.mhub-redesign .toast-notification.error .toast-icon::before {
    content: "!";
    color: #ff727b;
}

.mhub-redesign .toast-message {
    color: var(--foreground);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .mhub-redesign .toast-notification {
        top: max(84px, calc(env(safe-area-inset-top) + 68px));
        right: max(12px, env(safe-area-inset-right));
        width: min(420px, calc(100vw - 24px));
    }
}

@media (prefers-reduced-motion: reduce) {
    body[data-page]:not([data-page=""]) main { animation-duration: 100ms; }
    .mhub-view-exit { animation-duration: 140ms; }
}
