@view-transition {
    navigation: auto;
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 1ms;
    }
}

@keyframes app-page-zoom-in {
    from {
        opacity: 0;
        transform: scale(0.95);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

@keyframes app-page-zoom-out {
    from {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }

    to {
        opacity: 0;
        transform: scale(0.95);
        filter: blur(10px);
    }
}

::view-transition-old(root) {
    animation: app-page-zoom-out 300ms cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(root) {
    animation: app-page-zoom-in 400ms cubic-bezier(0, 0, 0.2, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 60ms;
    }
}

body {
    position: relative;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    margin: 0;
    color: var(--text);
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 1;
}

html,
body {
    min-height: 100%;
    height: auto;
    overflow-y: auto;
}

html {
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
    font-family: var(--font), "Segoe UI", Arial, sans-serif;
}

button,
input,
.nav-item,
.recent-item,
.select-trigger,
.select-option,
.close-window {
    transition: 0.2s ease;
}

button {
    display: flex;
    font-size: 20px;
    justify-content: center;
    background: var(--surface-2);
    border: 0px solid transparent;
    border-radius: var(--8px-radius);
    padding: 0 16px;
    align-items: center;
    color: var(--text);
}

button:hover {
    filter: brightness(0.8);
    scale: 0.98;
}

button:active {
    scale: 0.94;
    filter: brightness(0.6);
}

.primary {
    background: var(--accent-color);
    color: var(--text);
}

input {
    display: flex;
    font-size: 20px;
    justify-content: center;
    background: var(--surface-2);
    border: 0px solid transparent;
    border-radius: var(--8px-radius);
    padding: 0 16px;
    align-items: center;
    color: var(--text);
    outline: 0;
}

input:hover {
    filter: brightness(1.2);
    scale: 1.01;
}

input:focus {
    filter: brightness(0.9);
    scale: 0.99;
}

input:active {
    filter: brightness(0.8);
    scale: 0.98;
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow: visible;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.nav {
    height: 48px;
    width: 100%;
    display: flex;
    position: sticky;
    top: 0;
    z-index: 30;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 16px 6px 16px;
    flex-direction: row;
    background: var(--surface-1);
    flex-shrink: 0;
}

.nav-gap {
    display: none;
}

.nav-item-group {
    display: flex;
    gap: 12px;
    flex-direction: row;
}

#apps-nav-group {
    position: relative;
    z-index: 20;
}

.apps-nav-anchor {
    position: relative;
}

#apps-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border-radius: var(--8px-radius);
    padding: 4px 8px;
    gap: 6px;
    color: var(--text);
}

#apps-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    width: 260px;
    padding: 4px;
    border-radius: var(--12px-radius);
    background: var(--surface-1);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

#apps-nav-group.open #apps-dropdown {
    display: grid;
}

#apps-dropdown .apps-option {
    display: flex;
    min-width: 0;
    height: 60px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    border-radius: var(--8px-radius);
    background: var(--surface-2);
    color: var(--text);
    font-size: 12px;
    text-align: center;
    text-decoration: none;
}

#apps-dropdown .apps-option:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.nav-app-svg {
    width: 100%;
}

.nav-item {
    color: var(--text);
}

.nav-icon {
    display: none;
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

.home {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    touch-action: pan-y;
}

.home-create {
    height: 64px;
    background: var(--surface-1);
    display: flex;
    gap: 12px;
    border-radius: var(--14px-radius);
    width: 480px;
    padding: 10px;
    flex-shrink: 1;
    height: 64px;
    min-height: 64px;
    margin: 32px 32px 0 32px;
}

.create-primary {
    background: var(--accent-color);
    color: var(--text);
    width: 50%;
    flex-shrink: 1;
    text-wrap: 0;
}

.create-secondary {
    background: var(--surface-2);
    color: var(--text);
    width: 50%;
    flex-shrink: 1;
}

.hidden {
    display: none !important;
}

.nav-search {
    background: var(--surface);
    border-radius: var(--8px-radius);
    font-size: 16px;
    display: flex;
    flex-grow: 1;
    flex-shrink: 1;
    max-width: calc(50% + 100px);
    padding-left: 12px;
    align-items: center;
    min-width: 0;
    height: 36px;
}

.nav-search-group {
    display: flex;
    flex: 1 1 auto;
    gap: 6px;
    min-width: 0;
    max-width: calc(50% + 100px);
}

.nav-search-group .nav-search {
    max-width: none;
}

.replace-search {
    display: none;
}

.nav-search-group.replace-mode .replace-search {
    display: flex;
}

.home-title {
    font-size: 50px;
    font-weight: 700;
    margin: 40px 0 0 32px;
    color: var(--accent-color);
}

.home-subtitle {
    font-size: 24px;
    font-weight: 400;
    margin: 32px 0 0 32px;
    color: var(--text);
}

.home-glow {
    position: fixed;
    top: -10%;
    right: -20%;
    width: 50%;
    height: 50%;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 256px 32px var(--accent-color);
    filter: blur(128px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.95;
}

.window-filter {
    position: fixed;
    z-index: 50;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    visibility: visible;
}

.window {
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: absolute;
    display: flex;
    top: 5%;
    bottom: 5%;
    left: 5%;
    right: 5%;
    background: var(--surface-1);
    border-radius: var(--24px-radius);
    padding: 16px;
    gap: 8px;
    z-index: 1;
    box-shadow: 0 0 32px rgba(0, 0, 0, 0.2);
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.window-filter.hidden {
    display: flex !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.settings-window {
    flex-direction: row;
    padding:8px;
}

.window-filter.hidden .window {
    opacity: 0;
    transform: scale(0.96);
}

.window-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    width: 60%;
    height: 100%;
}

#account-window,
.account-window {
    position: relative;
    inset: auto;
    width: min(420px, calc(100vw - 32px));
    height: auto;
    min-height: 0;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

#avatar-filter .window,
#delete-account-filter .window {
    position: relative;
    inset: auto;
    width: min(480px, calc(100vw - 32px));
    height: auto;
    min-height: 0;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

#account-window > .window-content,
#avatar-filter .window-content,
#delete-account-filter .window-content {
    width: 100%;
    height: auto;
}

.account-form,
.account-profile {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.avatar-window-content {
    display: grid;
    grid-template-rows: auto auto minmax(160px, 1fr) auto;
    justify-content: stretch;
}

.avatar-window-preview-area {
    display: grid;
    min-width: 0;
    min-height: 0;
    place-items: center;
    aspect-ratio: 1;
    width: min(100%, 320px);
    justify-self: center;
}

.avatar-window-preview {
    aspect-ratio: 1 / 1;
    width: min(100%, 320px);
    max-height: min(45vh, 320px);
    object-fit: contain;
    box-shadow: 0 0 8px var(--bg);
    border-radius: var(--96px-radius);
}

.account-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
}

input {
    width: 100%;
    height: 48px;
    border-radius: var(--12px-radius);
    background: var(--surface);
    color: var(--text);
    padding: 0 16px;
    font-size: 20px;
    outline: none;
}
.checkbox {
    appearance:none;
    width:42px;
    height:42px;
    color:var(--surface);
    border-radius:10px;
    background:var(--surface-2);
    transition:0.2s;
}
.checkbox:hover{
    scale:0.95;
}
.checkbox:active{
    scale:0.90;
}
.checkbox:checked{
    background:var(--accent-color);
}
.checkbox:checked::after{
  content: "";
  display: block;
  width: 0.4em; height: 0.6em;
  margin: auto;
  border: solid #fff;
  border-width: 0 4px 4px 0;
  transform: rotate(38deg);
}
.chat-item-checkbox{
    margin-left:auto;
}
.account-status {
    min-height: 20px;
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.account-status.error {
    color: #e46b6b;
}

.account-profile p {
    margin: 0;
    color: var(--text-muted);
}

.action-row {
    display: flex;
    width: 100%;
    gap: 12px;
    justify-content: center;
}

.window-title {
    text-align: left;
    font-size: 32px;
    margin: 8px 0 0 0;
    font-weight: 800;
    color: var(--text);
}
.settings-window-title {
    margin: 8px 0 0 12px;
}
.window-subtitle {
   margin: 0 0 8px; 
   color: var(--text-muted);
}

.window-select {
    width: 50%;
    height: 48px;
    font-size: 18px;
    font-weight: 700;
}

.selected {
    background: var(--accent-color);
}

.window-button {
    width: 50%;
    height: 48px;
    font-size: 18px;
    font-weight: 700;
}
.window-custom-select {
    width: 100%;
    max-width: 100% !important;
    min-width: 100% !important;
    flex-shrink: 0;
    height: 48px;
    font-size: 18px;
    font-weight: 700;
}
.window-custom-select .select-trigger {
    width: 100%;
    max-width: 100% !important;
    min-width: 100% !important;
    flex-shrink: 0;
    height: 48px;
    font-size: 18px;
    font-weight: 700;
    border-radius: var(--10px-radius);
}
.window-custom-select .select-option {
    height: 48px;
    font-size: 18px;
    align-items: center;
    justify-content: flex-start;
}

.close-window {
    position: fixed;
    width: 64px;
    height: 64px;
    padding: 4px;
    z-index: 2;
    border-radius: var(--16px-radius);
    right: 16px;
    top: 16px;
    background: none;
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.2);
    transition: 0.2s;
    display: none;
}

.window-filter:not(.hidden)~.close-window {
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-window:hover {
    background: color-mix(in srgb, red 60%, var(--surface-1) 40%);
}

.settings-left {
    width: 40%;
    height: 100%;
    flex-shrink: 0;
    gap: 12px;
    border-radius: var(--24px-radius);
    max-width: 400px;
    display: flex;
    padding: 2px;
    background: var(--surface-1);
    flex-direction: column;
    align-items: flex-start;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 0;
}

.settings-tab {
    width: 100%;
    height: 38px;
    gap: 6px;
    padding: 0 6px;
    border-radius: var(--12px-radius);
    background: var(--surface-2);
    font-weight: 600;
    font-size: 18px;
    color: var(--text);
    align-items: center;
    justify-content: flex-start;
    stroke: var(--text);
    fill: var(--text);
}

.setting-tab-svg {
    height: 80%;
    stroke: var(--text);
    fill: var(--text);
}

.settings-right {
    width: 70%;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    border-radius: var(--24px-radius);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.settings-content {
    background: var(--surface);
    width: 100%;
    height: auto;
    min-height: 100%;
    flex: 0 0 auto;
    padding: 8px;
    display: flex;
    border-radius: var(--24px-radius);
    flex-direction: column;
    gap: 8px;
    overflow: visible;
    position: relative;
    isolation: isolate;
}

.settings-content.hidden {
    display: none !important;
}

.settings-tab.active {
    background: var(--accent-color);
    color: white;
}

.settings-tab.active .setting-tab-svg {
    stroke: white !important;
    fill: white !important;
}

.setting-tab-svg {
    stroke: #ffffff;
}

:root[data-theme="light"] .setting-tab-svg {
    stroke: var(--text);
    fill: var(--text);
}

:root[data-theme="light"] .settings-tab.active .setting-tab-svg {
    stroke: #ffffff !important;
    fill: #ffffff !important;
}

.setting-card {
    width: 100%;
    background: var(--surface-1);
    border-radius: var(--16px-radius);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 48px;
    padding: 6px;
    position: relative;
    overflow: visible;
    z-index: 1;
}

.setting-card:has(.custom-select.open) {
    z-index: 300;
}

.setting-title {
    margin: 0 0 0 16px;
    font-weight: 800;
}

.setting-card-title {
    margin: 0 0 0 8px;
    font-weight: 600;
    font-size: 24px;
}

.setting-label-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* DROPDOWNS */

.custom-select {
    position: relative;
    width: 100%;
    max-width: 240px;
    min-width: 120px;
    flex-shrink: 1;
    z-index: 1;
    transition: 0.2s ease;
}

.custom-select.open {
    z-index: 200;
}

.select-trigger {
    width: 100%;
    padding: 4px 10px;
    border-radius: var(--12px-radius);
    background: var(--surface-2);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.select-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: 0.2s ease;
}

.select-arrow {
    font-size: 18px;
    color: var(--text-muted);
    transition: 0.2s ease;
}

.custom-select.open .select-arrow {
    transform: rotate(180deg);
    transition: 0.2s ease;
}

.select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    border-radius: var(--12px-radius);
    background: var(--surface-2);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
    max-height: 260px;
    overflow-y: auto;
    z-index: 1000;
    transform-origin: top center;
    transition: 0.2s ease;
    opacity: 0;
    transform: translateY(-4px);
}

.custom-select.open .select-options {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.select-options.portal-open {
    position: fixed;
    top: 0;
    right: auto;
    left: 0;
    display: flex;
    z-index: 2000;
    max-height: min(260px, calc(100vh - 16px));
    opacity: 1;
    transform: none;
    transition: none;
}

.select-option {
    width: 100%;
    border: 0;
    background: var(--surface-1);
    border-radius: var(--10px-radius);
    color: var(--text);
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
    display: flex;
    padding: 6px 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
    z-index: 2;
}

.select-option.is-selected {
    background: color-mix(in srgb, var(--accent-color) 20%, var(--surface-2) 80%);
    color: var(--accent-color);
}
/* Vertical scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  border-radius: 12px;
  background: rgba(127.5, 127.5, 127.5, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(127.5, 127.5, 127.5, 1);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: padding-box;
}   

/* Thumb on hover */
::-webkit-scrollbar-thumb:hover {
  border:0px solid transparent;
}   

@media (max-width: 768px) {
    .nav-item {
        padding: 0 0.8vw;
    }

    .nav-label {
        display: none;
    }

    .nav-icon {
        display: block;
    }

    .nav-item {
        width: 36px;
        height: 36px;
        padding: 6px;
    }

    .home-create {
        width: calc(100% - 64px);
    }

    .create-primary {
        width: 50%;
    }

    .create-secondary {
        width: 50%;
    }

    .window {
        flex-direction: column;
    }

    .settings-left {
        width: 100%;
        max-width: 100%;
        height: fit-content;
    }

    .settings-right {
        width: 100%;
        height: auto;
        min-height: 0;
        flex: 1 1 auto;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .custom-select {
        width: min(100%, 290px);
    }

    .window-content {
        width: 100%;
    }

    .action-row {
        flex-direction: column;
    }

    .window-button {
        width: 100%;
    }

    .window-select {
        width: 100%;
    }
}

:root {
    --bg: #080808;
    --surface: #101010;
    --surface-1: #181818;
    --surface-2: #242424;
    --surface-3: #303030;
    --border: #444444;
    --text: #e8e8e8;
    --text-muted: #a0a0a0;
    --6px-radius: 6px;
    --8px-radius: 8px;
    --10px-radius: 10px;
    --12px-radius: 12px;
    --14px-radius: 14px;
    --16px-radius: 16px;
    --18px-radius: 18px;
    --24px-radius: 24px;
    --48px-radius: 48px;
    --96px-radius: 96px;
    color-scheme: dark;
    --font: Nunito;
}

:root[data-theme="light"] {
    --bg: #C8C8C8;
    --surface: #D0D0D0;
    --surface-1: #E0E0E0;
    --surface-2: #F0F0F0;
    --surface-3: #F8F8F8;
    --border: #555555;
    --text: #000000;
    --text-muted: #686868;
    color-scheme: light;
}

:root[data-border-type="sharp"] {
    --6px-radius: 0;
    --8px-radius: 0;
    --10px-radius: 0;
    --12px-radius: 0;
    --14px-radius: 0;
    --16px-radius: 0;
    --18px-radius:0;
    --24px-radius: 0;
    --96px-radius: 0;
}
:root[data-border-type="squircle"] {
  --corner-shape: superellipse(2);

  --6px-radius: calc(6px * 4.50); /* 27.0 */
  --8px-radius: calc(8px * 3.90); /* 31.2 */
  --10px-radius: calc(10px * 3.40); /* 34.0 */
  --12px-radius: calc(12px * 3.00); /* 36.0 */
  --14px-radius: calc(14px * 2.70); /* 37.8 */
  --16px-radius: calc(16px * 2.45); /* 39.2 */
  --18px-radius: calc(18px * 2.25); /* 40.5 */
  --20px-radius: calc(20px * 2.10); /* 42.0 */
  --22px-radius: calc(22px * 1.95); /* 42.9 */
  --24px-radius: calc(24px * 1.85); /* 44.4 */
  --96px-radius: 100%;
}
    *{
    corner-shape: var(--corner-shape);
}