:root {
    --primary-h: 75;
    --primary-s: 42%;
    --primary-l: 36%;

    --md-sys-color-primary: hsl(var(--primary-h), 65%, 74%);
    --md-sys-color-on-primary: hsl(var(--primary-h), 65%, 12%);
    --md-sys-color-primary-container: hsl(var(--primary-h), 45%, 22%);
    --md-sys-color-on-primary-container: hsl(var(--primary-h), 75%, 90%);

    --md-sys-color-secondary: hsl(var(--primary-h), 25%, 72%);
    --md-sys-color-on-secondary: hsl(var(--primary-h), 40%, 14%);
    --md-sys-color-secondary-container: hsl(var(--primary-h), 22%, 22%);
    --md-sys-color-on-secondary-container: hsl(var(--primary-h), 35%, 88%);

    --md-sys-color-tertiary: hsl(calc(var(--primary-h) + 60), 45%, 74%);
    --md-sys-color-on-tertiary: hsl(calc(var(--primary-h) + 60), 55%, 14%);
    --md-sys-color-tertiary-container: hsl(calc(var(--primary-h) + 60), 40%, 22%);
    --md-sys-color-on-tertiary-container: hsl(calc(var(--primary-h) + 60), 60%, 88%);

    --md-sys-color-surface: hsl(var(--primary-h), 14%, 7%);
    --md-sys-color-surface-dim: hsl(var(--primary-h), 14%, 5%);
    --md-sys-color-surface-bright: hsl(var(--primary-h), 14%, 12%);
    --md-sys-color-on-surface: hsl(var(--primary-h), 15%, 92%);
    --md-sys-color-surface-variant: hsl(var(--primary-h), 12%, 18%);
    --md-sys-color-on-surface-variant: hsl(var(--primary-h), 16%, 76%);

    --md-sys-color-surface-container-lowest: hsl(var(--primary-h), 14%, 4%);
    --md-sys-color-surface-container-low: hsl(var(--primary-h), 13%, 9%);
    --md-sys-color-surface-container: hsl(var(--primary-h), 12%, 12%);
    --md-sys-color-surface-container-high: hsl(var(--primary-h), 12%, 15%);
    --md-sys-color-surface-container-highest: hsl(var(--primary-h), 12%, 19%);

    --md-sys-color-outline: hsl(var(--primary-h), 8%, 56%);
    --md-sys-color-outline-variant: hsl(var(--primary-h), 10%, 26%);

    --md-sys-color-inverse-surface: hsl(var(--primary-h), 16%, 90%);
    --md-sys-color-inverse-primary: hsl(var(--primary-h), 55%, 24%);

    --radius-xs: 4px;
    --radius-s: 8px;
    --radius-m: 12px;
    --radius-l: 16px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    --elevation-1: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --elevation-2: 0 4px 10px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.35);
    --elevation-3: 0 8px 20px rgba(0, 0, 0, 0.55), 0 4px 8px rgba(0, 0, 0, 0.4);

    --transition-standard: 240ms cubic-bezier(0.2, 0, 0, 1);
    --transition-decelerate: 300ms cubic-bezier(0.05, 0.7, 0.1, 1);
    --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

    --drawer-width: 270px;
    --rail-width: 76px;
}

[data-theme="ocean"] {
    --primary-h: 210;
}

[data-theme="amethyst"] {
    --primary-h: 275;
}

[data-theme="amber"] {
    --primary-h: 38;
}

[data-theme="rose"] {
    --primary-h: 345;
}

.light-theme,
:root.light-theme {
    --md-sys-color-primary: hsl(var(--primary-h), 58%, 32%);
    --md-sys-color-on-primary: hsl(0, 0%, 100%);
    --md-sys-color-primary-container: hsl(var(--primary-h), 42%, 78%);
    --md-sys-color-on-primary-container: hsl(var(--primary-h), 65%, 12%);

    --md-sys-color-secondary: hsl(var(--primary-h), 22%, 38%);
    --md-sys-color-on-secondary: hsl(0, 0%, 100%);
    --md-sys-color-secondary-container: hsl(var(--primary-h), 25%, 80%);
    --md-sys-color-on-secondary-container: hsl(var(--primary-h), 35%, 14%);

    --md-sys-color-tertiary: hsl(calc(var(--primary-h) + 60), 32%, 35%);
    --md-sys-color-on-tertiary: hsl(0, 0%, 100%);
    --md-sys-color-tertiary-container: hsl(calc(var(--primary-h) + 60), 36%, 78%);
    --md-sys-color-on-tertiary-container: hsl(calc(var(--primary-h) + 60), 50%, 12%);

    
    --md-sys-color-surface: hsl(var(--primary-h), 26%, 88%);
    --md-sys-color-surface-dim: hsl(var(--primary-h), 22%, 83%);
    --md-sys-color-surface-bright: hsl(var(--primary-h), 28%, 91%);
    --md-sys-color-on-surface: hsl(var(--primary-h), 45%, 12%);
    --md-sys-color-surface-variant: hsl(var(--primary-h), 22%, 80%);
    --md-sys-color-on-surface-variant: hsl(var(--primary-h), 28%, 22%);

    --md-sys-color-surface-container-lowest: hsl(var(--primary-h), 28%, 92%);
    --md-sys-color-surface-container-low: hsl(var(--primary-h), 24%, 86%);
    --md-sys-color-surface-container: hsl(var(--primary-h), 24%, 83%);
    --md-sys-color-surface-container-high: hsl(var(--primary-h), 24%, 79%);
    --md-sys-color-surface-container-highest: hsl(var(--primary-h), 24%, 75%);

    --md-sys-color-outline: hsl(var(--primary-h), 18%, 46%);
    --md-sys-color-outline-variant: hsl(var(--primary-h), 20%, 70%);

    --md-sys-color-inverse-surface: hsl(var(--primary-h), 30%, 15%);
    --md-sys-color-inverse-primary: hsl(var(--primary-h), 65%, 82%);

    --elevation-1: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
    --elevation-2: 0 3px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --elevation-3: 0 6px 14px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.light-theme .floating-nav-bar {
    background-color: var(--md-sys-color-surface-container-high);
    border-color: var(--md-sys-color-outline-variant);
}

.light-theme .floating-nav-indicator {
    background-color: var(--md-sys-color-primary);
}

.light-theme .floating-nav-item.active {
    color: var(--md-sys-color-on-primary);
}

.light-theme .floating-nav-item {
    color: var(--md-sys-color-on-surface-variant);
}

.light-theme .floating-nav-item:hover {
    color: var(--md-sys-color-on-surface);
}

.light-theme .res-modal-backdrop,
.light-theme .tool-modal-backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.light-theme .os-icon-svg {
    filter: brightness(0);
}

.light-theme .os-chip-btn.active .os-icon-svg {
    filter: brightness(0) invert(1);
}

.dark-theme,
:root.dark-theme {
    --md-sys-color-primary: hsl(var(--primary-h), 65%, 74%);
    --md-sys-color-on-primary: hsl(var(--primary-h), 65%, 12%);
    --md-sys-color-primary-container: hsl(var(--primary-h), 45%, 22%);
    --md-sys-color-on-primary-container: hsl(var(--primary-h), 75%, 90%);

    --md-sys-color-secondary: hsl(var(--primary-h), 25%, 72%);
    --md-sys-color-on-secondary: hsl(var(--primary-h), 40%, 14%);
    --md-sys-color-secondary-container: hsl(var(--primary-h), 22%, 22%);
    --md-sys-color-on-secondary-container: hsl(var(--primary-h), 35%, 88%);

    --md-sys-color-tertiary: hsl(calc(var(--primary-h) + 60), 45%, 74%);
    --md-sys-color-on-tertiary: hsl(calc(var(--primary-h) + 60), 55%, 14%);
    --md-sys-color-tertiary-container: hsl(calc(var(--primary-h) + 60), 40%, 22%);
    --md-sys-color-on-tertiary-container: hsl(calc(var(--primary-h) + 60), 60%, 88%);

    --md-sys-color-surface: hsl(var(--primary-h), 14%, 7%);
    --md-sys-color-surface-dim: hsl(var(--primary-h), 14%, 5%);
    --md-sys-color-surface-bright: hsl(var(--primary-h), 14%, 12%);
    --md-sys-color-on-surface: hsl(var(--primary-h), 15%, 92%);
    --md-sys-color-surface-variant: hsl(var(--primary-h), 12%, 18%);
    --md-sys-color-on-surface-variant: hsl(var(--primary-h), 16%, 76%);

    --md-sys-color-surface-container-lowest: hsl(var(--primary-h), 14%, 4%);
    --md-sys-color-surface-container-low: hsl(var(--primary-h), 13%, 9%);
    --md-sys-color-surface-container: hsl(var(--primary-h), 12%, 12%);
    --md-sys-color-surface-container-high: hsl(var(--primary-h), 12%, 15%);
    --md-sys-color-surface-container-highest: hsl(var(--primary-h), 12%, 19%);

    --md-sys-color-outline: hsl(var(--primary-h), 8%, 56%);
    --md-sys-color-outline-variant: hsl(var(--primary-h), 10%, 26%);

    --elevation-1: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --elevation-2: 0 4px 10px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.35);
    --elevation-3: 0 8px 20px rgba(0, 0, 0, 0.55), 0 4px 8px rgba(0, 0, 0, 0.4);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

::-webkit-scrollbar,
*::-webkit-scrollbar,
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--md-sys-color-surface);
}

body {
    font-family: 'Unbounded', 'Plus Jakarta Sans', 'Noto Sans Javanese', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000;
    color: var(--md-sys-color-on-surface);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    letter-spacing: -0.02em;
    -webkit-font-smoothing: antialiased;
}

.material-symbols-rounded {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    user-select: none;
}

.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: var(--md-sys-color-surface);
    transform-origin: center center;
    transition: transform 0.40s var(--ease-spring-soft),
                border-radius 0.40s var(--ease-spring-soft);
}

body.legal-modal-open .app-layout,
body.res-modal-open .app-layout,
body.tool-modal-open .app-layout,
body.social-modal-open .app-layout,
body.preset-modal-open .app-layout {
    will-change: transform;
    transform: scale(0.95);
    border-radius: var(--radius-xl);
    pointer-events: none;
}

body.legal-modal-open .floating-nav-bar,
body.res-modal-open .floating-nav-bar,
body.tool-modal-open .floating-nav-bar,
body.social-modal-open .floating-nav-bar,
body.preset-modal-open .floating-nav-bar {
    transform: translateX(-50%) translateY(120px);
    opacity: 0;
    pointer-events: none;
}

.floating-nav-bar {
    display: inline-flex;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background-color: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-full);
    z-index: 44;
    justify-content: flex-start;
    align-items: center;
    padding: 6px;
    gap: 4px;
    max-width: min(94vw, 520px);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 1;
    transition: transform 0.42s var(--ease-spring-soft),
                opacity 0.38s var(--ease-spring-soft),
                background-color var(--transition-standard),
    will-change: transform, opacity;
}

.floating-nav-bar::-webkit-scrollbar {
    display: none;
}

.floating-nav-bar:hover {
    transform: translateX(-50%) translateY(-2px);
}

.floating-nav-indicator {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 6px;
    width: 44px;
    background-color: var(--md-sys-color-primary-container);
    border-radius: var(--radius-full);
    z-index: 1;
    pointer-events: none;
}

.floating-nav-item {
    position: relative;
    z-index: 2;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.88rem;
    font-weight: 500;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    background: transparent;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease, padding 0.4s var(--ease-spring-soft);
}

.floating-nav-item .nav-label {
    white-space: nowrap;
    display: inline-block;
    line-height: 1;
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-width 0.4s var(--ease-spring-soft),
                opacity 0.28s ease,
                margin-left 0.4s var(--ease-spring-soft);
}

.floating-nav-item .nav-icon,
.floating-nav-item .material-symbols-rounded {
    font-size: 1.35rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.floating-nav-item.active {
    color: var(--md-sys-color-on-primary-container);
    font-weight: 700;
    padding: 0 18px 0 14px;
}

.floating-nav-item.active .nav-label {
    max-width: 120px;
    opacity: 1;
    margin-left: 6px;
}

.floating-nav-item.active .nav-icon,
.floating-nav-item.active .material-symbols-rounded {
    font-variation-settings: 'FILL' 1;
}

.floating-nav-item:hover {
    color: var(--md-sys-color-on-surface);
}

.floating-nav-item:first-child {
    margin-left: auto;
}

.floating-nav-item:last-child {
    margin-right: auto;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    background-color: var(--md-sys-color-surface);
}

.batik-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

:root {
    --cube-depth: 520px;
    --cube-rot-y: 0deg;
    --ease-spring: cubic-bezier(0.34, 1.24, 0.5, 1);
    --ease-spring-soft: cubic-bezier(0.22, 1.04, 0.32, 1);
}@supports (transition-timing-function: linear(0, 1)){
    :root {
        --ease-spring: linear(0, 4.17% 0.0933, 8.33% 0.2953, 12.5% 0.5206, 16.67% 0.7207, 20.83% 0.8735, 25% 0.9757, 29.17% 1.034, 33.33% 1.0592, 37.5% 1.0625, 41.67% 1.0538, 45.83% 1.0401, 50% 1.0262, 54.17% 1.0144, 58.33% 1.0057, 62.5% 1.0001, 66.67% 0.9972, 70.83% 0.9961, 75% 0.9962, 79.17% 0.9968, 83.33% 0.9977, 87.5% 0.9986, 91.67% 0.9993, 95.83% 0.9998, 100% 1);
        --ease-spring-soft: linear(0, 5% 0.089, 10% 0.2686, 15% 0.4598, 20% 0.6257, 25% 0.7555, 30% 0.8494, 35% 0.9131, 40% 0.9541, 45% 0.9788, 50% 0.9928, 55% 0.9999, 60% 1.003, 65% 1.0039, 70% 1.0036, 75% 1.003, 80% 1.0022, 85% 1.0016, 90% 1.001, 95% 1.0006, 100% 1);
    }
}

.content-scroller {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding: 0 0 92px 0;
    position: relative;
    z-index: 1;
}

.cube-viewport {
    width: 100%;
    position: relative;
    perspective: 1800px;
    perspective-origin: 50% 350px;
    overflow: visible;
}

.cube-3d-box {
    width: 100%;
    position: relative;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 0.7s var(--ease-spring-soft);
    transform: translateZ(calc(var(--cube-depth) * -1)) rotateY(var(--cube-rot-y));
}

/* will-change hanya selama animasi rotasi (hemat layer GPU permanen) */
.cube-3d-box.cube-rotating {
    will-change: transform;
}

.app-view.cube-face {
    width: 100%;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Sengaja TANPA preserve-3d: konten 3D internal (signpost dll) di-flat
       ke bidang face. Ini memutus kebocoran paint 3D antar face dan
       visual tetap sama karena .signpost-overlay punya perspective sendiri. */
    position: absolute;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
}

.app-view.cube-face.active-face {
    position: relative;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Selama rotasi, hanya face asal (active-face) + face tujuan (face-entering)
   yang dirender — bukan 6 face sekaligus. Hemat rasterisasi besar di mobile. */
.cube-rotating .app-view.cube-face.active-face,
.cube-rotating .app-view.cube-face.face-entering {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Signpost punya konteks 3D sendiri (preserve-3d + perspective + arrow-side
   rotateX). Children ber-transform 3D bisa lolos dari clipping
   overflow:hidden pada face non-aktif, sehingga signpost "berhantu" di tab
   lain — apalagi saat animasi rotasi kubus saat SEMUA face dipaksa visible.
   Sembunyikan total berdasarkan view aktif (di-set di body[data-view] oleh
   navigateToRoute sejak awal navigasi), bukan menunggu animasi selesai. */
body:not([data-view="home"]) .signpost-overlay {
    display: none !important;
}

.cube-face-front,
.cube-face-1 {
    transform: rotateY(0deg) translateZ(var(--cube-depth));
}

.cube-face-right,
.cube-face-2 {
    transform: rotateY(60deg) translateZ(var(--cube-depth));
}

.cube-face-3 {
    transform: rotateY(120deg) translateZ(var(--cube-depth));
}

.cube-face-back,
.cube-face-4 {
    transform: rotateY(180deg) translateZ(var(--cube-depth));
}

.cube-face-left,
.cube-face-5 {
    transform: rotateY(240deg) translateZ(var(--cube-depth));
}

.cube-face-6 {
    transform: rotateY(300deg) translateZ(var(--cube-depth));
}

.section {
    max-width: 1040px;
    margin: 0 auto;
    padding: 48px 24px;
    position: relative;
}

.hero-fullscreen-section {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 48px;
    padding-bottom: 48px;
    position: relative;
}

.hero-fullscreen-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hero-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
    flex-wrap: wrap;
}

.kinetic-stacked-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 280px;
}

.kinetic-greeting-line {
    font-size: clamp(2rem, 5.2vw, 3.6rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    color: var(--md-sys-color-on-surface);
    min-height: 1.25em;
}

.kinetic-name-line {
    font-size: clamp(2.4rem, 6.8vw, 4.8rem);
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: -1.5px;
    color: var(--md-sys-color-primary);
    min-height: 1.25em;
}

.kinetic-flip-box {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    perspective: 900px;
    transform-style: preserve-3d;
    vertical-align: baseline;
    contain: layout;
}

.flip-layer {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.flip-layer.layer-next {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.flip-char {
    display: inline-block;
    will-change: transform, opacity;
    transition: transform 380ms cubic-bezier(0.25, 0.8, 0.25, 1), opacity 260ms ease;
    transform-origin: 50% 80%;
    color: var(--md-sys-color-on-surface);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
}

.name-box .flip-char {
    color: var(--md-sys-color-primary);
    font-weight: 900;
    text-shadow: 0 2px 14px hsla(var(--primary-h), 50%, 50%, 0.35);
}

.flip-space {
    display: inline-block;
    width: 0.28em;
}

@keyframes charFlipOut {
    0% {
        transform: rotateX(0deg) translateY(0);
        opacity: 1;
    }
    100% {
        transform: rotateX(85deg) translateY(-35%);
        opacity: 0;
    }
}

@keyframes charFlipIn {
    0% {
        transform: rotateX(-85deg) translateY(35%);
        opacity: 0;
    }
    100% {
        transform: rotateX(0deg) translateY(0);
        opacity: 1;
    }
}

.char-idle {
    transform: rotateX(0deg) translateY(0);
    opacity: 1;
}

.char-flip-out {
    animation: charFlipOut 380ms cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

.char-flip-in {
    animation: charFlipIn 380ms cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

.cd-0 { animation-delay: 0ms; }
.cd-1 { animation-delay: 24ms; }
.cd-2 { animation-delay: 48ms; }
.cd-3 { animation-delay: 72ms; }
.cd-4 { animation-delay: 96ms; }
.cd-5 { animation-delay: 120ms; }
.cd-6 { animation-delay: 144ms; }
.cd-7 { animation-delay: 168ms; }
.cd-8 { animation-delay: 192ms; }
.cd-9 { animation-delay: 216ms; }
.cd-10 { animation-delay: 240ms; }
.cd-11 { animation-delay: 264ms; }
.cd-12 { animation-delay: 288ms; }
.cd-13 { animation-delay: 312ms; }
.cd-14 { animation-delay: 336ms; }
.cd-15 { animation-delay: 360ms; }
.cd-16 { animation-delay: 384ms; }
.cd-17 { animation-delay: 408ms; }
.cd-18 { animation-delay: 432ms; }
.cd-19 { animation-delay: 456ms; }
.cd-20 { animation-delay: 480ms; }

.theme-switcher-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    flex-shrink: 0;
}

.theme-palette-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    background-color: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.mini-palette-btn {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform var(--transition-bounce), border-color var(--transition-standard);
}

.mini-palette-btn:hover {
    transform: scale(1.3);
}

.mini-palette-btn.active {
    border-color: var(--md-sys-color-on-surface);
    transform: scale(1.15);
}

.mini-palette-btn[data-color="greentea"] { background-color: #8da435; }
.mini-palette-btn[data-color="ocean"] { background-color: #3b82f6; }
.mini-palette-btn[data-color="amethyst"] { background-color: #a855f7; }
.mini-palette-btn[data-color="amber"] { background-color: #f59e0b; }
.mini-palette-btn[data-color="rose"] { background-color: #f43f5e; }

.theme-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    border: 1px solid var(--md-sys-color-outline-variant);
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-standard), transform var(--transition-bounce);
}

.theme-icon-btn:hover {
    background-color: var(--md-sys-color-surface-container-highest);
    transform: scale(1.08);
}

.hero-bio-text {
    font-size: clamp(1.05rem, 2.2vw, 1.22rem);
    line-height: 1.75;
    color: var(--md-sys-color-on-surface);
    max-width: 840px;
}

/* ============================================================
   SIGNPOST — sekarang section in-flow di atas Linimasa (bukan overlay).
   Panggung tinggi tetap; tiang + plate Navigator via pseudo-element;
   panah menempel kiri/kanan tiang dengan rotasi 3D.
   ============================================================ */
.signpost-overlay {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 26px 24px 0;
    pointer-events: none;
    overflow: visible;
    perspective: 900px;
    perspective-origin: 50% 28%;
}

.signpost-overlay .signpost {
    position: relative;
    width: min(840px, 100%);
    height: clamp(520px, 68vh, 720px);
    transform-origin: 50% 100%;
    transform: none;
    transform-style: preserve-3d;
}

/* Tiang — nuansa primary senada panah, memudar di ujung bawah */
.signpost::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 0;
    left: 50%;
    width: clamp(12px, 1.2vw, 18px);
    transform: translateX(-50%);
    border-radius: 999px;
    background-image: linear-gradient(90deg,
        color-mix(in srgb, var(--md-sys-color-primary) 10%, var(--md-sys-color-surface-container-high)),
        color-mix(in srgb, var(--md-sys-color-primary) 28%, var(--md-sys-color-surface-container-high)) 48%,
        color-mix(in srgb, var(--md-sys-color-primary) 8%, var(--md-sys-color-surface-container-high)));
    -webkit-mask-image: linear-gradient(to bottom, #000 62%, rgba(0, 0, 0, 0.35) 84%, transparent 99%);
    mask-image: linear-gradient(to bottom, #000 62%, rgba(0, 0, 0, 0.35) 84%, transparent 99%);
    pointer-events: none;
}

.signpost-inner,
.sign-arrow {
    transform-origin: 50% 100%;
}

.signpost.is-wobbling .signpost-inner {
    animation: signWobble 950ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes signWobble {
    0% { transform: rotate(0deg); }
    15% { transform: rotate(-2.6deg); }
    35% { transform: rotate(2deg); }
    55% { transform: rotate(-1.2deg); }
    75% { transform: rotate(0.6deg); }
    100% { transform: rotate(0deg); }
}

.signpost-inner {
    position: absolute;
    inset: 0;
    transform-origin: 50% 96%;
    transform-style: preserve-3d;
}

.sign-arrow {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    height: clamp(56px, 7vh, 72px);
    min-width: clamp(230px, 19vw, 320px);
    padding: 0 42px 0 28px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    z-index: 2;
    pointer-events: auto;
    background: transparent;
    transform-style: preserve-3d;
    --theta: 20deg;
    --depth: 18px;
    --box-thick: 12px;
    transition: transform 0.45s var(--ease-spring);
}

.arrow-right {
    left: 50%;
    transform-origin: left center;
    transform: rotateY(var(--theta)) translateZ(var(--depth));
}

.arrow-left {
    right: 50%;
    padding: 0 30px 0 50px;
    transform-origin: right center;
    transform: rotateY(var(--theta)) translateZ(var(--depth));
}

/* Susunan 3D di stage: theta & depth seragam → semua panah menempel rapi di tiang */
.arrow-right.tone-a { top: 80px;  --theta: 20deg;  --depth: 18px; }
.arrow-left.tone-b  { top: 190px; --theta: -20deg; --depth: 18px; }
.arrow-right.tone-c { top: 300px; --theta: 20deg;  --depth: 18px; }
.arrow-left.tone-d  { top: 410px; --theta: -20deg; --depth: 18px; }

/* Hover: hanya rotasi menghadap kamera — posisi tetap, tidak maju */
.arrow-right:hover {
    transform: rotateY(9deg) rotateX(-6deg) translateZ(var(--depth));
}

.arrow-left:hover {
    transform: rotateY(-9deg) rotateX(-6deg) translateZ(var(--depth));
}

.sign-arrow:active {
    transform: rotateY(var(--theta)) translateZ(var(--depth)) scale(0.95);
}

.sign-arrow.tone-a { color: var(--md-sys-color-on-primary-container); --arrow-bg: var(--md-sys-color-primary-container); }
.sign-arrow.tone-b { color: var(--md-sys-color-on-secondary-container); --arrow-bg: var(--md-sys-color-secondary-container); }
.sign-arrow.tone-c { color: var(--md-sys-color-on-tertiary-container); --arrow-bg: var(--md-sys-color-tertiary-container); }
.sign-arrow.tone-d { color: var(--md-sys-color-on-primary); --arrow-bg: var(--md-sys-color-primary); }

/* Front face — bentuk pemandu arah / bendera ujung segitiga */
.sign-arrow::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--arrow-bg, var(--md-sys-color-surface-container-high));
    transform: translateZ(0);
    pointer-events: none;
}

/* Back face — tutup box di belakang */
.sign-arrow::after {
    content: '';
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--arrow-bg, #888) 62%, black);
    transform: translateZ(calc(var(--box-thick) * -1));
    pointer-events: none;
}

.arrow-right::before,
.arrow-right::after {
    clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 50%, calc(100% - 24px) 100%, 0 100%);
}

.arrow-left::before,
.arrow-left::after {
    clip-path: polygon(24px 0, 100% 0, 100% 100%, 24px 100%, 0 50%);
}

.arrow-side {
    position: absolute;
    pointer-events: none;
}

.sign-arrow-icon {
    font-size: clamp(24px, 3vh, 32px);
    flex-shrink: 0;
    transform: translateZ(10px);
    transform-style: preserve-3d;
}

.sign-arrow-year {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.72;
    white-space: nowrap;
}

.sign-arrow-label {
    font-size: clamp(1.15rem, 2.2vh, 1.45rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    transform: translateZ(6px);
    text-shadow: 0 1px 0 rgba(0,0,0,0.18), 0 6px 10px rgba(0,0,0,0.22);
}

/* Rentang desktop-menengah: panah sedikit lebih ramping */
@media (max-width: 1718px) and (min-width: 1025px) {
    .sign-arrow {
        min-width: clamp(180px, 15vw, 250px);
        padding: 0 36px 0 24px;
    }

    .arrow-left {
        padding: 0 28px 0 46px;
    }
}

@media (max-width: 1024px) {
    .signpost-overlay {
        padding: 20px 18px 0;
    }

    .signpost-overlay .signpost {
        height: clamp(480px, 58vh, 640px);
    }

    .sign-arrow {
        height: clamp(52px, 6vh, 64px);
        min-width: min(26vw, 230px);
        gap: 10px;
        padding: 0 32px 0 20px;
    }

    .arrow-left {
        padding: 0 20px 0 32px;
    }

    .arrow-right.tone-a { top: 72px;  --theta: 18deg;  --depth: 15px; }
    .arrow-left.tone-b  { top: 166px; --theta: -18deg; --depth: 15px; }
    .arrow-right.tone-c { top: 260px; --theta: 18deg;  --depth: 15px; }
    .arrow-left.tone-d  { top: 354px; --theta: -18deg; --depth: 15px; }

    .sign-arrow-icon { font-size: 22px; }
    .sign-arrow-label { font-size: 1.05rem; }
}

@media (max-width: 640px) {
    .signpost-overlay {
        padding: 16px 14px 0;
        perspective: 760px;
    }

    .signpost-overlay .signpost {
        width: 100%;
        height: clamp(420px, 54vh, 560px);
    }

    .signpost::before {
        top: 42px;
        width: 14px;
    }

    .signpost::after {
        font-size: 0.58rem;
        padding: 5px 11px;
    }

    .sign-arrow {
        height: 50px;
        min-width: min(36vw, 220px);
        gap: 8px;
        padding: 0 26px 0 16px;
    }

    .arrow-left {
        padding: 0 16px 0 26px;
    }

    .arrow-right.tone-a { top: 68px;  --theta: 14deg;  --depth: 12px; }
    .arrow-left.tone-b  { top: 152px; --theta: -14deg; --depth: 12px; }
    .arrow-right.tone-c { top: 236px; --theta: 14deg;  --depth: 12px; }
    .arrow-left.tone-d  { top: 320px; --theta: -14deg; --depth: 12px; }

    .sign-arrow-icon { font-size: 20px; }
    .sign-arrow-label { font-size: 0.98rem; }
}



.tiktok-media-host {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tiktok-media-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.tiktok-skel-icon {
    font-size: 40px;
    animation: skelPulse 1.4s ease-in-out infinite;
}

@keyframes skelPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.hero-action-row,
.hero-bottom-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 24px;
}

.journey-section {
    padding-top: 64px;
    margin-top: 32px;
}

.section-header {
    margin-bottom: 40px;
    text-align: left;
}

.section-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.section-pill .material-symbols-rounded {
    font-size: 1.1rem;
}

.tools-header-pill-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.tools-header-pill-row .section-pill {
    margin-bottom: 0;
}

.btn-tools-clean-cache {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid var(--md-sys-color-outline-variant);
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1), color 0.2s cubic-bezier(0.2, 0, 0, 1), transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.btn-tools-clean-cache:hover {
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-primary);
    transform: scale(1.06);
}

.btn-tools-clean-cache:active {
    transform: scale(0.94);
}

.btn-tools-clean-cache .material-symbols-rounded {
    font-size: 1.15rem;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 4px;
}

.journey-manifesto-quote {
    font-size: clamp(0.92rem, 1.8vw, 1.04rem);
    line-height: 1.75;
    color: var(--md-sys-color-on-surface-variant);
    font-style: italic;
    max-width: 820px;
    margin: 8px 0 0 0;
    padding: 0;
    border: none;
    cursor: pointer;
    opacity: 0.9;
    transition: color var(--transition-standard), opacity var(--transition-standard);
}

.journey-manifesto-quote:hover {
    color: var(--md-sys-color-on-surface);
    opacity: 1;
}

.zigzag-timeline-wrapper,
.zigzag-timeline {
    position: relative;
    width: 100%;
    max-width: 920px;
    margin: 32px auto 0;
    padding: 8px 0;
}

.timeline-dynamic-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

#timeline-dynamic-path {
    stroke: var(--md-sys-color-outline-variant);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke var(--transition-standard);
}

.zigzag-item {
    position: relative;
    width: 50%;
    margin-bottom: 48px;
    box-sizing: border-box;
}

.zigzag-item:last-child {
    margin-bottom: 0;
}

.zigzag-left {
    left: 0;
    padding-right: 48px;
}

.zigzag-right {
    left: 50%;
    padding-left: 48px;
}

.zigzag-marker {
    position: absolute;
    top: 20px;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-primary);
    border: 3px solid var(--md-sys-color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: transform var(--transition-bounce), background-color var(--transition-standard);
}

.zigzag-marker .material-symbols-rounded {
    font-size: 1.2rem;
}

.zigzag-left .zigzag-marker {
    right: -21px;
}

.zigzag-right .zigzag-marker {
    left: -21px;
}

.glow-marker {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.zigzag-card {
    background-color: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-xl);
    padding: 24px 28px;
    position: relative;
    z-index: 2;
    transition: transform var(--transition-standard), background-color var(--transition-standard);
}

.zigzag-card:hover {
    transform: translateY(-4px);
    background-color: var(--md-sys-color-surface-container-high);
}

.feature-zigzag-card {
    background-color: var(--md-sys-color-surface-container-high);
    border: 2px solid var(--md-sys-color-primary);
}

.card-tag-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.year-badge {
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    font-weight: 700;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
}

.year-badge.active-badge {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.platform-badge {
    font-size: 0.78rem;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
}

.timeline-heading {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 8px;
}

.timeline-narrative {
    font-size: 0.92rem;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.65;
    margin-bottom: 0;
}

.md-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform var(--transition-standard), background-color var(--transition-standard);
}

.md-btn-primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.md-btn-primary:hover {
    background-color: hsl(var(--primary-h), 55%, 32%);
    transform: translateY(-2px);
}

.dark-theme .md-btn-primary:hover {
    background-color: hsl(var(--primary-h), 70%, 80%);
}

.md-btn-tonal {
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.md-btn-tonal:hover {
    background-color: var(--md-sys-color-surface-container-highest);
    border-color: var(--md-sys-color-primary);
    transform: translateY(-2px);
}

.social-section,
.social-page-section {
    padding-top: 48px;
    min-height: calc(100dvh - 160px);
}

.social-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.social-header-row .section-header {
    margin-bottom: 0;
    flex: 1;
    min-width: 280px;
}

.social-buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 580px;
    margin: 24px auto 0;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background-color: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-full);
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition-standard), background-color var(--transition-standard), border-color var(--transition-standard);
}

.social-btn:hover {
    transform: translateY(-2px);
    background-color: var(--md-sys-color-surface-container-highest);
    border-color: var(--md-sys-color-primary);
}

.social-btn-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.social-btn-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
    transition: transform var(--transition-standard);
}

.social-btn:hover .social-btn-icon-wrapper {
    transform: scale(1.08);
}

.social-btn-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.social-btn-label {
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.social-btn-arrow {
    font-size: 1.25rem;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
    transition: transform var(--transition-standard), color var(--transition-standard);
}

.social-btn:hover .social-btn-arrow {
    transform: translate(2px, -2px);
    color: var(--md-sys-color-primary);
}

.skeleton-social-btn {
    height: 64px;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--md-sys-color-surface-container-high) 25%, var(--md-sys-color-surface-container-highest) 50%, var(--md-sys-color-surface-container-high) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}


.resource-page-section {
    padding-top: 36px;
    padding-bottom: 48px;
    max-width: 960px;
    margin: 0 auto;
}

.resource-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    height: 52px;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-full);
    margin-top: 20px;
    margin-bottom: 16px;
    transition: border-color var(--transition-standard), background var(--transition-standard);
}

.resource-search-bar:focus-within {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-container-high);
}

.resource-search-bar .material-symbols-rounded {
    color: var(--md-sys-color-primary);
    font-size: 22px;
}

.resource-search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    color: var(--md-sys-color-on-surface);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
}

.resource-search-bar input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.65;
}

.chip-group {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 18px 0;
    margin-bottom: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chip-group::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid var(--md-sys-color-outline-variant);
    transition: all var(--transition-standard);
    font-family: inherit;
}

.chip:hover {
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border-color: var(--md-sys-color-outline);
}

.chip.active {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border-color: var(--md-sys-color-primary);
    font-weight: 700;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    width: 100%;
}


.resource-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background-color: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-l);
    transition: transform 0.26s var(--ease-spring-soft), 
                border-color 0.2s ease, 
                background-color 0.2s ease;
    cursor: pointer !important;
    position: relative;
    user-select: none;
}

.resource-card:hover {
    background-color: var(--md-sys-color-surface-container-high);
    border-color: var(--md-sys-color-primary);
}

.resource-card:active {
    background-color: var(--md-sys-color-surface-container-highest);
}

.resource-card-cutefish {
    border: 1.5px solid var(--md-sys-color-primary) !important;
    background-color: var(--md-sys-color-surface-container) !important;
}

.resource-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-m);
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.resource-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resource-icon {
    font-size: 26px;
    color: var(--md-sys-color-primary);
}

.resource-info-compact {
    flex: 1;
    min-width: 0;
}

.resource-title-compact {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.resource-dev-compact {
    font-size: 0.78rem;
    color: var(--md-sys-color-primary);
    margin: 2px 0 4px;
    font-weight: 600;
}

.resource-meta-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.os-chip {
    height: 22px;
    padding: 0 6px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background-color: var(--md-sys-color-surface-container-high) !important;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 6px;
    flex-shrink: 0;
}

.os-icon-svg {
    width: 14px;
    height: 14px;
    display: inline-block;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.resource-info-text {
    font-size: 0.74rem;
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.8;
}

.resource-cats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.resource-cat-chip {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface-variant);
}

.resource-card-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--md-sys-color-surface-container-high);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
    transition: transform var(--transition-standard), color var(--transition-standard);
}

.resource-card:hover .resource-card-arrow {
    transform: translateX(3px);
    color: var(--md-sys-color-primary);
}

.resource-card-arrow .material-symbols-rounded {
    font-size: 18px;
}

.tools-page-section {
    padding-top: 36px;
    padding-bottom: 48px;
    max-width: 960px;
    margin: 0 auto;
}

.tools-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    height: 52px;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-full);
    margin-top: 20px;
    margin-bottom: 16px;
    transition: border-color var(--transition-standard), background var(--transition-standard);
}

.tools-search-bar:focus-within {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-container-high);
}

.tools-search-bar .material-symbols-rounded {
    color: var(--md-sys-color-primary);
    font-size: 22px;
}

.tools-search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    color: var(--md-sys-color-on-surface);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
}

.tools-search-bar input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.65;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    width: 100%;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background-color: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-l);
    transition: transform 0.26s var(--ease-spring-soft), 
                border-color 0.2s ease, 
                background-color 0.2s ease;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.tool-card:hover {
    background-color: var(--md-sys-color-surface-container-high);
    border-color: var(--md-sys-color-primary);
}

.tool-card:active {
    background-color: var(--md-sys-color-surface-container-highest);
}

.tool-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-m);
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: visible;
    box-sizing: border-box;
}

.tool-icon {
    font-size: 22px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-primary);
    line-height: 1;
    user-select: none;
}

.tool-icon-img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.tool-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tool-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.tool-ver-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 4.5px;
    border-radius: var(--radius-full);
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border: 1.5px solid var(--md-sys-color-surface-container);
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    z-index: 5;
    pointer-events: none;
}

.tool-desc {
    margin: 0;
    font-size: 0.76rem;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.35;
    min-height: 2.7em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-card-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
    box-sizing: border-box;
    transition: transform var(--transition-standard), color var(--transition-standard), background var(--transition-standard), width var(--transition-standard), padding var(--transition-standard), border-radius var(--transition-standard);
}

.tool-card:hover .tool-card-arrow:not(.is-processing):not(.is-completed) {
    transform: translateX(3px);
    color: var(--md-sys-color-primary);
}

.tool-card-arrow.is-processing,
.tool-card:hover .tool-card-arrow.is-processing {
    min-width: 46px;
    width: auto;
    padding: 0 8px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--md-sys-color-primary) !important;
    color: var(--md-sys-color-on-primary) !important;
    border-color: transparent !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    transform: none !important;
    animation: toolPulse 1.8s ease-in-out infinite;
}

.tool-card-arrow.is-completed,
.tool-card:hover .tool-card-arrow.is-completed {
    min-width: 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4caf50 !important;
    color: #ffffff !important;
    border-color: transparent !important;
    transform: none !important;
}

.tool-card-progress-text {
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes toolPulse {
    0%, 100% {
    }
    50% {
    }
}

.tool-card-arrow .material-symbols-rounded {
    font-size: 18px;
    line-height: 1;
}


.res-portal-hero-card {
    position: fixed;
    z-index: 42;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background-color: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-l);
    box-sizing: border-box;
    will-change: transform, background-color, border-color;
    transform-origin: top left;
}

.res-portal-hero-card.in-modal {
    background-color: transparent !important;
    border-color: transparent !important;
    padding: 0 !important;
}

.res-portal-hero-card.in-modal .resource-card-arrow {
    display: none !important;
}

.res-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 41;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s var(--ease-spring-soft), 
                visibility 0.35s var(--ease-spring-soft);
}

.res-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.res-modal-card {
    position: fixed;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-l);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    z-index: 41;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    contain: content;
}

.res-modal-card.expanded {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.res-modal-header-container {
    padding: 16px 18px;
    border-bottom: 1px solid transparent;
    background: transparent;
    transition: border-bottom-color 0.4s var(--ease-spring-soft);
    box-sizing: border-box;
    width: 100%;
}

.res-modal-card.expanded .res-modal-header-container {
    border-bottom-color: var(--md-sys-color-outline-variant);
}

.res-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.res-modal-hero-slot {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.res-modal-hero-slot .resource-card-arrow,
.res-portal-hero-card.in-modal .resource-card-arrow {
    display: none !important;
}

.res-modal-hero-slot .resource-icon-wrapper,
.res-portal-hero-card.in-modal .resource-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-m);
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.res-modal-hero-slot .resource-info-compact,
.res-portal-hero-card.in-modal .resource-info-compact {
    flex: 1;
    min-width: 0;
}

.res-modal-hero-slot .resource-title-compact,
.res-portal-hero-card.in-modal .resource-title-compact {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.res-modal-hero-slot .resource-dev-compact,
.res-portal-hero-card.in-modal .resource-dev-compact {
    font-size: 0.78rem;
    color: var(--md-sys-color-primary);
    margin: 2px 0 4px;
    font-weight: 600;
}

.res-modal-hero-slot .resource-meta-compact,
.res-portal-hero-card.in-modal .resource-meta-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.res-modal-hero-slot .resource-cats-row,
.res-portal-hero-card.in-modal .resource-cats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.res-modal-hero-slot .resource-cat-chip,
.res-portal-hero-card.in-modal .resource-cat-chip {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface-variant);
}

.res-modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.res-modal-close-btn:hover {
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface);
    transform: scale(1.08);
}

.res-modal-close-btn .res-close-icon-arrow,
.res-modal-close-btn .res-close-icon-x {
    position: absolute;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.38s var(--ease-spring-soft), opacity 0.32s var(--ease-spring-soft);
}

.res-modal-close-btn .res-close-icon-arrow {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.res-modal-close-btn .res-close-icon-x {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.res-modal-card.expanded .res-modal-close-btn .res-close-icon-arrow {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

.res-modal-card.expanded .res-modal-close-btn .res-close-icon-x {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.res-modal-body {
    padding: 16px 18px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-sizing: border-box;
}

.res-modal-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.res-modal-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    opacity: 0.75;
}

.res-modal-os-chips {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 12px;
}

.res-modal-ver-chips {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

.os-chip-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 52px !important;
    padding: 0 16px !important;
    border-radius: var(--radius-m) !important;
    border: 1.5px solid var(--md-sys-color-outline-variant) !important;
    background: var(--md-sys-color-surface-container-high) !important;
    color: var(--md-sys-color-on-surface) !important;
    cursor: pointer;
    transition: transform 0.25s var(--ease-spring-soft),
                background-color 0.25s var(--ease-spring-soft),
                border-color 0.25s var(--ease-spring-soft);
}

.os-chip-btn .os-icon-svg {
    width: 24px !important;
    height: 24px !important;
    filter: brightness(0) invert(1);
    transition: filter 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.os-chip-btn:hover {
    border-color: var(--md-sys-color-primary) !important;
    background: var(--md-sys-color-surface-container-highest) !important;
    transform: translateY(-2px);
}

.os-chip-btn:hover .os-icon-svg {
    transform: scale(1.15);
}

.os-chip-btn.active {
    background: var(--md-sys-color-primary) !important;
    border-color: var(--md-sys-color-primary) !important;
    transform: scale(1.03);
}

.os-chip-btn.active .os-icon-svg {
    filter: brightness(0);
    transform: scale(1.1);
}

.res-popup-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.res-popup-chip:hover {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-container-highest);
}

.res-popup-chip.active {
    background: var(--md-sys-color-primary-container);
    border-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary-container);
}

.res-modal-instruction-box {
    font-size: 13px;
    line-height: 1.6;
    color: var(--md-sys-color-on-surface);
    background: var(--md-sys-color-surface-container-high);
    padding: 12px 16px;
    border-radius: 12px;
    border-left: 3px solid var(--md-sys-color-primary);
}

.res-modal-password-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    padding: 10px 14px;
    border-radius: 14px;
}

.res-modal-password-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.res-modal-password-left .material-symbols-rounded {
    color: var(--md-sys-color-primary);
    font-size: 20px;
}

.res-modal-password-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.res-modal-password-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
}

.res-modal-password-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--md-sys-color-primary);
    letter-spacing: 1px;
    font-family: 'JetBrains Mono', monospace;
}

.res-modal-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.res-modal-copy-btn:hover {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.res-modal-copy-btn .material-symbols-rounded {
    font-size: 16px;
}


.res-modal-download-btn {
    width: 100%;
    height: 52px;
    border-radius: var(--radius-full);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    transition: transform 0.2s var(--ease-spring-soft), 
                filter 0.2s ease;
}

.res-modal-download-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.res-modal-download-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.res-modal-download-btn:disabled {
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface-variant);
    cursor: not-allowed;
    opacity: 0.55;
}

.res-download-text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.res-download-main-text {
    font-size: 14px;
    font-weight: 700;
}

.res-download-sub-text {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.85;
}

.tool-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.72);
    z-index: 41;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s var(--ease-spring-soft), visibility 0.35s var(--ease-spring-soft);
}

.tool-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tool-modal-card {
    position: fixed;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-l);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    z-index: 41;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    contain: content;
}

/* Selama morph buka/tutup: matikan transisi child (border-color, dll)
   agar tidak ada style-recalc ganda per frame di dalam kartu. */
.res-modal-card.is-morphing *,
.tool-modal-card.is-morphing * {
    transition: none !important;
}

.tool-modal-card.expanded {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.tool-modal-header-container {
    padding: 16px 18px;
    border-bottom: 1px solid transparent;
    background: transparent;
    transition: border-bottom-color 0.4s var(--ease-spring-soft);
    box-sizing: border-box;
    width: 100%;
}

.tool-modal-card.expanded .tool-modal-header-container {
    border-bottom-color: var(--md-sys-color-outline-variant);
}

.tool-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.tool-modal-hero-slot {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.tool-modal-hero-slot .tool-card-arrow {
    display: none !important;
}

.tool-modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: background 0.3s var(--ease-spring-soft), color 0.3s var(--ease-spring-soft), transform 0.3s var(--ease-spring-soft), width 0.35s var(--ease-spring-soft), min-width 0.35s var(--ease-spring-soft), padding 0.35s var(--ease-spring-soft), border-radius 0.35s var(--ease-spring-soft);
}

.tool-modal-close-btn:hover {
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface);
}

.tool-modal-close-btn .tool-close-icon-arrow,
.tool-modal-close-btn .tool-close-icon-x,
.tool-modal-close-btn .tool-close-progress-text {
    position: absolute;
    font-size: 18px;
    transition: transform 0.38s var(--ease-spring-soft), opacity 0.3s ease;
}

.tool-modal-close-btn .tool-close-icon-arrow {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.tool-modal-close-btn .tool-close-icon-x {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.tool-modal-close-btn .tool-close-progress-text {
    opacity: 0;
    transform: scale(0.6);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    color: var(--md-sys-color-on-primary);
    white-space: nowrap;
}

.tool-modal-card.expanded .tool-modal-close-btn .tool-close-icon-arrow {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

.tool-modal-card.expanded .tool-modal-close-btn .tool-close-icon-x {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.tool-modal-close-btn.is-processing.is-closing,
.tool-modal-card:not(.expanded) .tool-modal-close-btn.is-processing {
    min-width: 46px;
    width: auto;
    padding: 0 8px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--md-sys-color-primary) !important;
    color: var(--md-sys-color-on-primary) !important;
    border-color: transparent !important;
}

.tool-modal-close-btn.is-processing.is-closing .tool-close-icon-x,
.tool-modal-card:not(.expanded) .tool-modal-close-btn.is-processing .tool-close-icon-x {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.tool-modal-close-btn.is-processing.is-closing .tool-close-progress-text,
.tool-modal-card:not(.expanded) .tool-modal-close-btn.is-processing .tool-close-progress-text {
    opacity: 1;
    transform: scale(1);
}

.tool-modal-body {
    padding: 16px 18px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
    max-height: calc(88vh - 84px);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tool-drop-zone {
    border: 2px dashed var(--md-sys-color-outline-variant);
    border-radius: var(--radius-m);
    padding: 20px 16px;
    background: var(--md-sys-color-surface-container-high);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    user-select: none;
}

.tool-drop-zone:hover,
.tool-drop-zone.dragover {
    border-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-surface-container-highest);
}

.tool-drop-icon {
    font-size: 32px;
    color: var(--md-sys-color-primary);
}

.tool-drop-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tool-drop-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

.tool-drop-subtitle {
    font-size: 11px;
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.75;
}

.tool-file-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    max-width: 100%;
}

.tool-file-badge .material-symbols-rounded {
    font-size: 16px;
}

.tool-file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.tool-file-size {
    opacity: 0.8;
    font-size: 11px;
}

.tool-drop-zone input[type="file"] {
    display: none;
}

.tool-dynamic-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-opt-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tool-opt-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--md-sys-color-primary);
}

.tool-opt-switch-row {
    display: flex;
    gap: 4px;
    background: var(--md-sys-color-surface-container-high);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.tool-opt-btn {
    flex: 1;
    height: 32px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tool-opt-btn:hover {
    color: var(--md-sys-color-on-surface);
}

.tool-opt-btn.active {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-weight: 700;
}

.tool-opt-info-box {
    font-size: 12px;
    line-height: 1.5;
    color: var(--md-sys-color-on-surface-variant);
    background: var(--md-sys-color-surface-container-high);
    padding: 10px 12px;
    border-radius: var(--radius-m);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.tool-progress-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: smoothExpandIn 0.36s var(--ease-spring-soft) both;
}

.tool-progress-track {
    height: 6px;
    width: 100%;
    background: var(--md-sys-color-surface-container-highest);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.tool-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--md-sys-color-primary);
    border-radius: var(--radius-full);
    transition: width 0.15s ease;
}

.tool-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

.tool-modal-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.tool-process-btn {
    width: 100%;
    height: 48px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform var(--transition-standard), background var(--transition-standard);
}

.tool-process-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.tool-process-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.tool-process-btn:disabled {
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.6;
    cursor: not-allowed;
}

.tool-download-btn {
    width: 100%;
    height: 48px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border: 1px solid var(--md-sys-color-primary);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform var(--transition-standard), background var(--transition-standard);
}

.tool-download-btn:hover {
    transform: translateY(-2px);
}

.tool-download-btn:active {
    transform: scale(0.98);
}


.skeleton-resource-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background-color: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-l);
    height: 86px;
}

.skeleton-resource-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-m);
    background: linear-gradient(90deg, var(--md-sys-color-surface-container-high) 25%, var(--md-sys-color-surface-container-highest) 50%, var(--md-sys-color-surface-container-high) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    flex-shrink: 0;
}

.skeleton-resource-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-resource-card-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--md-sys-color-surface-container-high) 25%, var(--md-sys-color-surface-container-highest) 50%, var(--md-sys-color-surface-container-high) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    width: 70%;
}

.skeleton-resource-card-line.short {
    width: 40%;
}

.skeleton-resource-card-line.medium {
    width: 55%;
}

.skeleton-tool-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background-color: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-l);
    height: 86px;
}

.skeleton-tool-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-m);
    background: linear-gradient(90deg, var(--md-sys-color-surface-container-high) 25%, var(--md-sys-color-surface-container-highest) 50%, var(--md-sys-color-surface-container-high) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    flex-shrink: 0;
}

.skeleton-tool-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-tool-card-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--md-sys-color-surface-container-high) 25%, var(--md-sys-color-surface-container-highest) 50%, var(--md-sys-color-surface-container-high) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    width: 70%;
}

.skeleton-tool-card-line.short {
    width: 40%;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 48px 16px;
    text-align: center;
    color: var(--md-sys-color-on-surface-variant);
}

.empty-state-icon {
    font-size: 48px;
    opacity: 0.5;
}

.empty-state-text {
    margin-top: 8px;
    font-weight: 500;
}

.hidden, .d-none {
    display: none !important;
}

.hidden, .d-none {
    display: none !important;
}

.portfolio-footer {
    padding: 36px 24px 54px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    margin-top: 56px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-legal-links {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.86rem;
    font-weight: 500;
}

.footer-legal-link {
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    transition: color var(--transition-standard), transform var(--transition-standard);
}

.footer-legal-link:hover {
    color: var(--md-sys-color-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.footer-dot {
    color: var(--md-sys-color-outline-variant);
    font-size: 0.8rem;
    user-select: none;
}

.footer-simple-text {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
    letter-spacing: 0.2px;
    opacity: 0.85;
}

.vercel-release-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--md-sys-color-outline-variant);
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    user-select: none;
}

.vercel-release-badge .vrb-logo {
    flex-shrink: 0;
    opacity: 0.9;
}

.vercel-release-badge .vrb-version {
    color: var(--md-sys-color-primary);
    font-weight: 700;
    white-space: nowrap;
}

.footer-legal-btn {
    background: none;
    border: none;
    margin: 0;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    color: var(--md-sys-color-primary);
    font-family: 'Unbounded', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    cursor: pointer;
    box-sizing: border-box;
    background-color: transparent;
    transition: background-color 0.45s var(--ease-spring-soft), color 0.45s var(--ease-spring-soft);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.footer-legal-btn.forced-hover,
.footer-legal-btn:hover {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.legal-portal-hero-btn {
    position: fixed;
    z-index: 42;
    pointer-events: none;
    margin: 0;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-family: 'Unbounded', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transform-origin: top left;
    will-change: transform, background-color, color;
    transition: background-color 0.36s var(--ease-spring-soft),
                color 0.36s var(--ease-spring-soft);
}

.legal-modal-backdrop {
    position: fixed;
    background-color: var(--md-sys-color-surface-container);
    z-index: 41;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-sizing: border-box;
    contain: content;
    will-change: left, top, width, height, border-radius;
}

.legal-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.legal-modal-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--md-sys-color-surface-container);
}

.legal-modal-header-container {
    width: 100%;
    background-color: var(--md-sys-color-surface-container-high);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.legal-modal-header {
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
}

.legal-modal-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.legal-modal-icon-badge {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    will-change: opacity;
}

.legal-modal-icon-badge .material-symbols-rounded {
    font-size: 1.5rem;
}

.legal-modal-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legal-modal-subtitle {
    font-size: 0.74rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--md-sys-color-primary);
    will-change: opacity;
}

.legal-modal-title-slot {
    min-width: 140px;
    height: 32px;
    display: flex;
    align-items: center;
}

.legal-modal-close-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background-color: var(--md-sys-color-surface-container-highest);
    border: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-standard);
    flex-shrink: 0;
    will-change: opacity;
}

.legal-modal-close-btn .material-symbols-rounded {
    font-size: 1.4rem;
}

.legal-modal-close-btn:hover {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
    border-color: var(--md-sys-color-error);
    transform: rotate(90deg) scale(1.05);
}

.legal-modal-body-container {
    flex: 1;
    overflow-y: auto;
    width: 100%;
}

.legal-modal-body {
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
    padding: 36px 24px 80px 24px;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.legal-modal-body .legal-doc-pane {
    display: none;
}

.legal-modal-body .legal-doc-pane.active {
    display: block;
    animation: viewTransition 0.22s cubic-bezier(0.2, 0, 0, 1) forwards;
}

.legal-article-card {
    background: transparent;
    border: none;
    padding: 0;
}

.legal-article-card h2,
.legal-article-card h3,
.legal-article-card h4 {
    color: var(--md-sys-color-on-surface);
    margin-top: 24px;
    margin-bottom: 10px;
    font-weight: 700;
}

.legal-article-card h2:first-child {
    margin-top: 0;
}

.legal-article-card h2 {
    font-size: 1.15rem;
}

.legal-article-card h3 {
    font-size: 1.05rem;
}

.legal-article-card p {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 14px;
}

.legal-article-card strong {
    color: var(--md-sys-color-on-surface);
}

.legal-article-card a {
    color: var(--md-sys-color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.toast-container {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    pointer-events: none;
    width: max-content;
    max-width: calc(100vw - 24px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 8px 14px;
    border-radius: var(--radius-full);
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.35;
    max-width: calc(100vw - 24px);
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
    transition: opacity 240ms cubic-bezier(0.2, 0, 0, 1), transform 380ms var(--ease-spring-soft);
    pointer-events: auto;
    will-change: transform, opacity;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast.toast-exit {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
}

.toast .material-symbols-rounded {
    font-size: 16px;
    color: var(--md-sys-color-primary);
    flex-shrink: 0;
}

.toast-msg {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    min-width: 0;
}

@keyframes toastMsgSwap {
    0% {
        opacity: 0.15;
    }
    100% {
        opacity: 1;
    }
}

.toast.toast-swap .toast-msg {
    animation: toastMsgSwap 220ms cubic-bezier(0.2, 0, 0, 1) forwards;
}

.light-theme .toast {
    background-color: var(--md-sys-color-surface-container-high);
    border-color: var(--md-sys-color-outline-variant);
}@media (max-width: 768px){
    .hero-fullscreen-section {
        padding-top: 28px;
        padding-bottom: 28px;
        min-height: calc(100dvh - 64px);
    }

    .hero-fullscreen-inner {
        gap: 14px;
    }

    .section {
        padding: 28px 16px;
    }

    .hero-title-row {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 8px;
    }

    .theme-switcher-box {
        align-self: flex-end;
        padding-top: 0;
    }

    .kinetic-stacked-title {
        width: 100%;
        min-width: 0;
        gap: 2px;
    }

    .kinetic-greeting-line {
        font-size: clamp(2rem, 7.5vw, 3rem);
        line-height: 1.1;
    }

    .kinetic-name-line {
        font-size: clamp(2.7rem, 10.5vw, 4.2rem);
        line-height: 1.08;
    }

    .hero-bio-text {
        font-size: 0.92rem;
        line-height: 1.55;
    }

    .android-chat-bubble {
        padding: 12px 16px;
    }

    .zigzag-timeline-wrapper,
    .zigzag-timeline {
        padding-left: 6px;
    }

    .zigzag-item {
        width: 100% !important;
        left: 0 !important;
        padding-left: 52px !important;
        padding-right: 0 !important;
        margin-bottom: 24px;
    }

    .zigzag-left .zigzag-marker,
    .zigzag-right .zigzag-marker {
        left: 0 !important;
        right: auto !important;
        top: 16px;
        width: 40px;
        height: 40px;
    }

    .zigzag-marker .material-symbols-rounded {
        font-size: 1.15rem;
    }

    .zigzag-card {
        padding: 18px 20px;
        border-radius: var(--radius-l);
    }

    .timeline-heading {
        font-size: 1.05rem;
    }

    .timeline-narrative {
        font-size: 0.86rem;
        line-height: 1.6;
    }
}@media (max-width: 600px){
    .res-modal-card.expanded,
    .tool-modal-card.expanded {
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }
}@media (max-width: 480px){
    .hero-fullscreen-section {
        padding-top: 16px;
        padding-bottom: 24px;
    }

    .hero-fullscreen-inner {
        gap: 12px;
    }

    .section {
        padding: 20px 12px;
    }

    .kinetic-greeting-line {
        font-size: clamp(1.85rem, 7vw, 2.5rem);
    }

    .kinetic-name-line {
        font-size: clamp(2.5rem, 10vw, 3.8rem);
    }

    .hero-bio-text {
        font-size: 0.88rem;
        line-height: 1.55;
    }

    .journey-manifesto-quote {
        font-size: 0.86rem;
        line-height: 1.6;
        margin-top: 14px;
    }

    .social-buttons-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .social-btn {
        padding: 12px 18px;
    }

    .social-btn-icon-wrapper {
        width: 32px;
        height: 32px;
        font-size: 1.05rem;
    }

    .social-btn-label {
        font-size: 0.90rem;
    }

    .floating-nav-bar {
        bottom: 16px;
        padding: 5px;
        gap: 4px;
    }

    .floating-nav-item {
        height: 38px;
        padding: 0 11px;
        font-size: 0.82rem;
        gap: 6px;
    }

    .floating-nav-item.active {
        padding: 0 15px 0 12px;
    }

    .floating-nav-item.active .nav-label {
        max-width: 96px;
    }

    .zigzag-item {
        padding-left: 38px !important;
        margin-bottom: 18px;
    }

    .zigzag-left .zigzag-marker,
    .zigzag-right .zigzag-marker {
        left: -2px !important;
        top: 16px;
        width: 28px;
        height: 28px;
        border-width: 2px;
    }

    .zigzag-marker .material-symbols-rounded {
        font-size: 0.88rem;
    }

    .zigzag-card {
        padding: 14px 16px;
        border-radius: var(--radius-m);
    }

    .card-tag-row {
        gap: 6px;
        margin-bottom: 6px;
    }

    .year-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    .platform-badge {
        font-size: 0.72rem;
    }

    .hero-bottom-actions .md-btn {
        width: 100%;
        padding: 10px 18px;
        font-size: 0.88rem;
    }
}


.tiktok-latest-section {
    padding-top: 40px;
    padding-bottom: 24px;
}

.tiktok-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 18px;
    width: 100%;
}

.tiktok-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-l);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition-standard), border-color var(--transition-standard);
    animation: tiktokCardPopIn 0.4s cubic-bezier(0.2, 0, 0, 1) forwards;
}

@keyframes tiktokCardPopIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tiktok-card:hover {
    transform: translateY(-4px);
    border-color: var(--md-sys-color-primary);
}

.tiktok-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    background-color: var(--md-sys-color-surface-container-high);
    overflow: hidden;
}

.tiktok-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.2, 0, 0, 1);
}

.tiktok-card:hover .tiktok-card-thumb img {
    transform: scale(1.06);
}

.tiktok-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: transform var(--transition-standard), opacity var(--transition-standard), background-color var(--transition-standard);
}

.tiktok-card:hover .tiktok-card-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.tiktok-card-play .material-symbols-rounded {
    font-size: 1.5rem;
    margin-left: 2px;
}

.tiktok-card-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
}

.tiktok-card-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    justify-content: space-between;
}

.tiktok-card-author {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--md-sys-color-primary);
}

.tiktok-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--md-sys-color-on-surface);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tiktok-card-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.74rem;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 600;
    margin-top: 4px;
}

.tiktok-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}


.tiktok-card-skeleton {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-l);
    overflow: hidden;
}

.tiktok-card-skeleton .skeleton-thumb {
    width: 100%;
    aspect-ratio: 4 / 5;
    background: linear-gradient(90deg, var(--md-sys-color-surface-container-high) 25%, var(--md-sys-color-surface-container-highest) 50%, var(--md-sys-color-surface-container-high) 75%);
    background-size: 200% 100%;
    animation: tiktokShimmer 1.5s infinite;
}

.tiktok-card-skeleton .skeleton-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    border-radius: 4px;
    background: linear-gradient(90deg, var(--md-sys-color-surface-container-high) 25%, var(--md-sys-color-surface-container-highest) 50%, var(--md-sys-color-surface-container-high) 75%);
    background-size: 200% 100%;
    animation: tiktokShimmer 1.5s infinite;
}

.line-author {
    width: 70px;
    height: 12px;
}

.line-title {
    width: 90%;
    height: 16px;
}

.line-meta {
    width: 60%;
    height: 12px;
}

@keyframes tiktokShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}@media (max-width: 900px){
    .tiktok-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}@media (max-width: 480px){
    .tiktok-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .tiktok-card-body,
    .tiktok-card-skeleton .skeleton-body {
        padding: 10px 12px;
    }

    .tiktok-card-title {
        font-size: 0.82rem;
    }

    .tiktok-card-stats {
        gap: 8px;
        font-size: 0.7rem;
    }
}

.social-portal-backdrop {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--md-sys-color-surface);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 40;
    transition: opacity 0.38s var(--ease-spring-soft);
}

.social-portal-backdrop.active {
    opacity: 0.75;
    visibility: visible;
    pointer-events: auto;
}

.social-portal-card {
    position: fixed;
    z-index: 41;
    background-color: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    box-sizing: border-box;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    will-change: left, top, width, height, border-radius;
    cursor: pointer;
}

.social-portal-card.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.social-portal-icon-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    will-change: transform;
    transform-origin: top left;
    pointer-events: none;
}

.social-portal-icon-wrapper .social-btn-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.social-portal-label-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
    transform-origin: top left;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
}

.social-portal-label {
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: visible;
}

.social-portal-arrow {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 1.25rem;
    color: var(--md-sys-color-on-surface-variant);
    will-change: transform, opacity;
    transform-origin: top left;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-ghost {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-surface-variant);
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-icon-ghost:hover {
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
}

.tiktok-switcher-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 6px;
    margin-top: 12px;
}

.tiktok-fixaudio-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    cursor: pointer;
    user-select: none;
}

.tiktok-fixaudio-row .tiktok-switcher-label {
    margin: 0;
    cursor: pointer;
}

.tiktok-fixaudio-row .fivemb-checkbox-custom {
    background: var(--md-sys-color-surface-container-lowest);
}

.tiktok-fixaudio-row input:checked ~ .fivemb-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 3px;
    width: 4px;
    height: 8px;
    border: solid var(--md-sys-color-on-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.tiktok-switch-track {
    position: relative;
    display: flex;
    background: var(--md-sys-color-surface-container-highest);
    border-radius: 100px;
    padding: 4px;
}

.tiktok-switch-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc((100% - 8px) / 3);
    height: calc(100% - 8px);
    border-radius: 100px;
    background: var(--md-sys-color-primary);
    transition: transform 0.28s var(--ease-spring-soft);
    pointer-events: none;
    transform: translateX(0%);
}

.tiktok-switch-track[data-selected="v1"] .tiktok-switch-indicator,
.tiktok-switch-track[data-selected="off"] .tiktok-switch-indicator,
.tiktok-switch-track[data-selected="slow"] .tiktok-switch-indicator,
.tiktok-switch-track:not([data-count="4"]):not(:has(> .tiktok-switch-option:nth-child(5)))[data-selected-idx="0"] .tiktok-switch-indicator {
    transform: translateX(0%);
}

.tiktok-switch-track[data-selected="v3"] .tiktok-switch-indicator,
.tiktok-switch-track[data-selected="fry"] .tiktok-switch-indicator,
.tiktok-switch-track[data-selected="720p"] .tiktok-switch-indicator,
.tiktok-switch-track[data-selected="medium"] .tiktok-switch-indicator,
.tiktok-switch-track:not([data-count="4"]):not(:has(> .tiktok-switch-option:nth-child(5)))[data-selected-idx="1"] .tiktok-switch-indicator {
    transform: translateX(100%);
}

.tiktok-switch-track[data-selected="fps"] .tiktok-switch-indicator,
.tiktok-switch-track[data-selected="1080p"] .tiktok-switch-indicator,
.tiktok-switch-track[data-selected="fast"] .tiktok-switch-indicator,
.tiktok-switch-track:not([data-count="4"]):not(:has(> .tiktok-switch-option:nth-child(5)))[data-selected-idx="2"] .tiktok-switch-indicator {
    transform: translateX(200%);
}

.tiktok-switch-track[data-count="4"] .tiktok-switch-indicator,
.tiktok-switch-track:has(> .tiktok-switch-option:nth-child(5)) .tiktok-switch-indicator {
    width: calc((100% - 8px) / 4);
}

.tiktok-switch-track[data-count="4"][data-selected="v1"] .tiktok-switch-indicator,
.tiktok-switch-track[data-count="4"][data-selected-idx="0"] .tiktok-switch-indicator,
.tiktok-switch-track:has(> .tiktok-switch-option:nth-child(5))[data-selected="v1"] .tiktok-switch-indicator,
.tiktok-switch-track:has(> .tiktok-switch-option:nth-child(5))[data-selected-idx="0"] .tiktok-switch-indicator {
    transform: translateX(0%);
}

.tiktok-switch-track[data-count="4"][data-selected="v3"] .tiktok-switch-indicator,
.tiktok-switch-track[data-count="4"][data-selected="fry"] .tiktok-switch-indicator,
.tiktok-switch-track[data-count="4"][data-selected-idx="1"] .tiktok-switch-indicator,
.tiktok-switch-track:has(> .tiktok-switch-option:nth-child(5))[data-selected="v3"] .tiktok-switch-indicator,
.tiktok-switch-track:has(> .tiktok-switch-option:nth-child(5))[data-selected="fry"] .tiktok-switch-indicator,
.tiktok-switch-track:has(> .tiktok-switch-option:nth-child(5))[data-selected-idx="1"] .tiktok-switch-indicator {
    transform: translateX(100%);
}

.tiktok-switch-track[data-count="4"][data-selected="binary"] .tiktok-switch-indicator,
.tiktok-switch-track[data-count="4"][data-selected-idx="2"] .tiktok-switch-indicator,
.tiktok-switch-track:has(> .tiktok-switch-option:nth-child(5))[data-selected="binary"] .tiktok-switch-indicator,
.tiktok-switch-track:has(> .tiktok-switch-option:nth-child(5))[data-selected-idx="2"] .tiktok-switch-indicator {
    transform: translateX(200%);
}

.tiktok-switch-track[data-count="4"][data-selected="fps"] .tiktok-switch-indicator,
.tiktok-switch-track[data-count="4"][data-selected-idx="3"] .tiktok-switch-indicator,
.tiktok-switch-track:has(> .tiktok-switch-option:nth-child(5))[data-selected="fps"] .tiktok-switch-indicator,
.tiktok-switch-track:has(> .tiktok-switch-option:nth-child(5))[data-selected-idx="3"] .tiktok-switch-indicator {
    transform: translateX(300%);
}

.tiktok-switch-option {
    flex: 1;
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 8px 16px;
    border-radius: 100px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    transition: color 0.22s ease;
    user-select: none;
    white-space: nowrap;
}

.tiktok-switch-option.active {
    color: var(--md-sys-color-on-primary);
}

.tiktok-preset-desc {
    margin-top: 10px;
    transition: opacity 0.18s ease;
    user-select: none;
}

.tiktok-desc-card {
    background: var(--md-sys-color-surface-container-high);
    padding: 14px 16px;
    border-radius: var(--radius-m);
    border: 1px solid var(--md-sys-color-outline-variant);
    text-align: left;
}

.tiktok-desc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    line-height: 1.6;
}

.tiktok-desc-list li {
    display: flex;
    align-items: center;
    font-size: 12.5px;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 4px;
}

.tiktok-desc-list li:last-child {
    margin-bottom: 0;
}

.tiktok-desc-list .material-symbols-rounded {
    font-size: 18px;
    margin-right: 8px;
    color: var(--md-sys-color-primary);
    flex-shrink: 0;
}

.tiktok-desc-list strong {
    color: var(--md-sys-color-on-surface);
    margin-right: 4px;
}

.tiktok-desc-divider {
    border: none;
    border-top: 1px dashed var(--md-sys-color-outline-variant);
    margin: 10px 0;
}

.tiktok-desc-footer {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 12px;
    line-height: 1.5;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.tiktok-desc-footer .material-symbols-rounded {
    font-size: 18px;
    color: var(--md-sys-color-primary);
    flex-shrink: 0;
    margin-top: 1px;
}

.tiktok-desc-footer a {
    color: var(--md-sys-color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
}

.tiktok-desc-footer a:hover {
    opacity: 0.8;
}

.tiktok-desc-warning-row,
.tiktok-desc-info-row {
    background: var(--md-sys-color-surface-container-high);
    padding: 14px 16px;
    border-radius: var(--radius-m);
    border: 1px solid var(--md-sys-color-outline-variant);
    margin: 0 0 10px 0;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 12px;
    line-height: 1.5;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    text-align: left;
}

.dark .tiktok-desc-warning-row,
[data-theme="dark"] .tiktok-desc-warning-row,
body.dark .tiktok-desc-warning-row,
.dark .tiktok-desc-info-row,
[data-theme="dark"] .tiktok-desc-info-row,
body.dark .tiktok-desc-info-row {
    background: var(--md-sys-color-surface-container-high);
    border-color: var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface-variant);
}

.tiktok-desc-warning-row .material-symbols-rounded,
.tiktok-desc-info-row .material-symbols-rounded {
    font-size: 18px;
    color: var(--md-sys-color-primary);
    flex-shrink: 0;
    margin-top: 1px;
}

.tiktok-desc-warning-row strong,
.tiktok-desc-info-row strong {
    color: var(--md-sys-color-on-surface);
    font-weight: 700;
}

.tiktok-desc-card .tiktok-desc-warning-row,
.tiktok-desc-card .tiktok-desc-info-row {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 8px 0 0 0;
}

.dark .tiktok-desc-card .tiktok-desc-warning-row,
[data-theme="dark"] .tiktok-desc-card .tiktok-desc-warning-row,
body.dark .tiktok-desc-card .tiktok-desc-warning-row,
.dark .tiktok-desc-card .tiktok-desc-info-row,
[data-theme="dark"] .tiktok-desc-card .tiktok-desc-info-row,
body.dark .tiktok-desc-card .tiktok-desc-info-row {
    background: transparent;
    border: none;
}

.tiktok-ext-warning {
    margin-top: 12px;
    padding: 14px 16px;
    background-color: var(--md-sys-color-surface-container-high, #1e2219);
    border: 1.5px solid var(--md-sys-color-primary, #bedc74);
    border-radius: var(--radius-m, 12px);
    color: var(--md-sys-color-on-surface, #edf0e8);
    font-size: 12.5px;
    line-height: 1.55;
    text-align: left;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.dark .tiktok-ext-warning,
[data-theme="dark"] .tiktok-ext-warning,
body.dark .tiktok-ext-warning {
    background-color: #171a13;
    border-color: #bedc74;
}

.tiktok-ext-warning-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--md-sys-color-primary, #bedc74);
    margin-bottom: 6px;
    font-size: 13.5px;
}

.dark .tiktok-ext-warning-header,
[data-theme="dark"] .tiktok-ext-warning-header,
body.dark .tiktok-ext-warning-header {
    color: #bedc74;
}

.tiktok-ext-warning-header .material-symbols-rounded {
    font-size: 20px;
    color: var(--md-sys-color-primary, #bedc74);
}

.tiktok-ext-warning-body {
    margin: 0 0 12px 0;
    color: var(--md-sys-color-on-surface-variant, #9aa491);
    font-size: 12px;
    line-height: 1.5;
}

.tiktok-ext-warning-body strong {
    color: var(--md-sys-color-on-surface, #edf0e8);
}

.tiktok-ext-warning-options {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tiktok-ext-warning-options li {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: var(--md-sys-color-on-surface);
    font-size: 12px;
}

.tiktok-ext-warning-options .material-symbols-rounded {
    font-size: 16px;
    color: var(--md-sys-color-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.tiktok-ext-flags-list {
    margin: 12px 0 4px 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.tiktok-ext-flags-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.6;
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant, #9aa491);
}

.tiktok-ext-flags-list li::before {
    content: "•";
    color: var(--md-sys-color-primary, #bedc74);
    font-weight: bold;
    font-size: 15px;
    line-height: 1.3;
    flex-shrink: 0;
}

.tiktok-ext-flags-list code {
    background: rgba(190, 220, 116, 0.12);
    color: var(--md-sys-color-primary, #bedc74);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    border: 1px solid rgba(190, 220, 116, 0.22);
}

.tiktok-ext-success {
    margin-top: 12px;
    padding: 10px 14px;
    background-color: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: var(--radius-m);
    color: var(--md-sys-color-on-surface);
    font-size: 12.5px;
    line-height: 1.45;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.tiktok-ext-success .material-symbols-rounded {
    font-size: 20px;
    color: #10b981;
    flex-shrink: 0;
}

.tiktok-ext-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(190, 220, 116, 0.15);
}

.btn-ext-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-pill, 999px);
    background: var(--md-sys-color-primary, #bedc74);
    color: var(--md-sys-color-on-primary, #171a13);
    border: 1px solid var(--md-sys-color-primary, #bedc74);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ext-download:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    color: var(--md-sys-color-on-primary, #171a13);
}

.btn-ext-download .material-symbols-rounded {
    font-size: 16px;
}

.btn-ext-download-secondary {
    background: var(--md-sys-color-surface-container-highest, #24291d);
    color: var(--md-sys-color-on-surface, #edf0e8);
    border: 1px solid var(--md-sys-color-outline-variant, rgba(190, 220, 116, 0.3));
}

.btn-ext-download-secondary:hover {
    background: var(--md-sys-color-surface-container-high, #2d3324);
    border-color: var(--md-sys-color-primary, #bedc74);
    color: var(--md-sys-color-primary, #bedc74);
}

.btn-ext-recheck {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    background: var(--md-sys-color-surface-container-highest, #24291d);
    border: 1px solid var(--md-sys-color-outline-variant, rgba(190, 220, 116, 0.3));
    color: var(--md-sys-color-on-surface, #edf0e8);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-ext-recheck:hover {
    background: var(--md-sys-color-primary, #bedc74);
    color: var(--md-sys-color-on-primary, #171a13);
    border-color: var(--md-sys-color-primary, #bedc74);
}

.btn-ext-recheck .material-symbols-rounded {
    font-size: 18px;
}

.btn-ext-recheck.loading .material-symbols-rounded {
    animation: spin 0.8s linear infinite;
}

.process-logs-wrap {
    margin-top: 14px;
    text-align: left;
    animation: smoothExpandIn 0.38s var(--ease-spring-soft) both;
}

@keyframes smoothExpandIn {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.process-logs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.process-logs-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
}

.btn-copy-logs {
    background: var(--md-sys-color-surface-container-highest);
    border: 1px solid var(--md-sys-color-outline-variant);
    cursor: pointer;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 11px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-copy-logs:hover {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.btn-copy-logs .material-symbols-rounded {
    font-size: 14px;
}

.process-logs-pre {
    background: var(--md-sys-color-surface-container-low);
    padding: 12px;
    border-radius: var(--radius-s);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.45;
    max-height: 180px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    border: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface-variant);
}



.tool-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.tool-input-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--md-sys-color-on-surface-variant);
}

.tool-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: 48px;
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-m);
    transition: border-color var(--transition-standard), background var(--transition-standard);
    box-sizing: border-box;
    width: 100%;
}

.tool-input-wrapper:focus-within {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-container-highest);
}

.tool-input-icon {
    color: var(--md-sys-color-primary);
    font-size: 20px;
    flex-shrink: 0;
}

.tool-input-text {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    color: var(--md-sys-color-on-surface);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
}

.tool-input-text::placeholder {
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.65;
}

.tool-input-clear-btn {
    background: transparent;
    border: none;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.tool-input-clear-btn:hover {
    background: var(--md-sys-color-surface-container-lowest);
    color: var(--md-sys-color-on-surface);
}

.tool-input-clear-btn .material-symbols-rounded {
    font-size: 18px;
}

.tool-status-text {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    color: var(--md-sys-color-primary);
    min-height: 18px;
    transition: color 0.2s ease;
}


.stats-results-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
}

.stats-preview-container {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-m);
    box-sizing: border-box;
}

.stats-preview-info {
    flex: 1;
    min-width: 0;
}

.stats-video-cover-wrapper {
    width: 80px;
    height: 108px;
    border-radius: var(--radius-s);
    overflow: hidden;
    background: var(--md-sys-color-surface-container-low);
    flex-shrink: 0;
    position: relative;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.stats-video-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.stats-creator-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-creator-handle {
    font-size: 12px;
    color: var(--md-sys-color-primary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.stats-caption {
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stats-details-card {
    background: var(--md-sys-color-surface-container-high);
    padding: 14px;
    border-radius: var(--radius-m);
    border: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
}

.stats-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.stats-detail-label {
    color: var(--md-sys-color-on-surface-variant);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.stats-detail-label .material-symbols-rounded {
    font-size: 16px;
    color: var(--md-sys-color-primary);
}

.stats-method-link {
    color: var(--md-sys-color-primary);
    text-decoration: none;
    font-weight: 600;
}

.stats-method-link:hover {
    text-decoration: underline;
}

.stats-badge-safe {
    background: rgba(76, 175, 80, 0.16);
    color: #4caf50;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stats-badge-safe .material-symbols-rounded {
    font-size: 14px;
}

.stats-badge-warn {
    background: rgba(244, 67, 54, 0.16);
    color: #f44336;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stats-badge-warn .material-symbols-rounded {
    font-size: 14px;
}

.stats-section-divider {
    border: none;
    border-top: 1px dashed var(--md-sys-color-outline-variant);
    margin: 4px 0;
}

.stats-skeleton {
    display: inline-block;
    height: 13px;
    width: 50px;
    background: var(--md-sys-color-surface-container-highest);
    border-radius: 4px;
    animation: stats-pulse 1.3s ease-in-out infinite;
}

.stats-skeleton-text {
    width: 80px;
}

@keyframes stats-pulse {
    0% { opacity: 0.35; }
    50% { opacity: 0.85; }
    100% { opacity: 0.35; }
}


.seq-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.seq-input-card {
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-m);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.seq-config-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface-variant);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.seq-config-label .material-symbols-rounded {
    font-size: 16px;
    color: var(--md-sys-color-primary);
}

.seq-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--md-sys-color-surface-container-highest);
    border-radius: var(--radius-s);
    padding: 2px 8px;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.seq-text-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--md-sys-color-on-surface);
    font-size: 14px;
    font-weight: 700;
    width: 100%;
    font-family: inherit;
}

.seq-unit-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--md-sys-color-primary);
    user-select: none;
}

.seq-audio-zone {
    background: var(--md-sys-color-surface-container-high);
    border: 1px dashed var(--md-sys-color-outline-variant);
    border-radius: var(--radius-m);
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    user-select: none;
}

.seq-audio-zone:hover {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-container-highest);
}

.seq-audio-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seq-audio-icon {
    font-size: 24px;
    color: var(--md-sys-color-primary);
}

.seq-audio-text-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.seq-audio-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

.seq-audio-sub {
    font-size: 11px;
    color: var(--md-sys-color-on-surface-variant);
}

.seq-audio-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.seq-audio-badge .material-symbols-rounded {
    color: #4caf50;
    font-size: 20px;
}

.seq-audio-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.seq-audio-remove-btn {
    background: transparent;
    border: none;
    color: var(--md-sys-color-error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
}


.fivemb-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.fivemb-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.fivemb-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fivemb-actions-group {
    display: flex;
    gap: 6px;
}

.fivemb-action-btn {
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-primary);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background 0.2s;
}

.fivemb-action-btn:hover {
    background: var(--md-sys-color-surface-container-highest);
}

.fivemb-filter-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.fivemb-filter-tab {
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s;
}

.fivemb-filter-tab.active {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-color: var(--md-sys-color-primary);
}

.fivemb-filter-tab .material-symbols-rounded {
    font-size: 16px;
}

.fivemb-filter-count {
    background: rgba(255, 255, 255, 0.15);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
}

.fivemb-layers-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.fivemb-layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-m);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.fivemb-layer-item.selected {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-container-highest);
}

.fivemb-layer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.fivemb-checkbox-wrapper {
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.fivemb-checkbox-wrapper input {
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.fivemb-checkbox-custom {
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid var(--md-sys-color-outline-variant);
    pointer-events: none;
    transition: all 0.2s;
}

.fivemb-checkbox-wrapper input:checked ~ .fivemb-checkbox-custom {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
}

.fivemb-layer-icon {
    font-size: 20px;
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
}

.fivemb-layer-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-align: left;
}

.fivemb-layer-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fivemb-layer-sub {
    font-size: 11px;
    color: var(--md-sys-color-on-surface-variant);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fivemb-layer-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.fivemb-layer-badge.photo {
    background: rgba(76, 175, 80, 0.16);
    color: #4caf50;
}

.fivemb-layer-badge.video {
    background: rgba(33, 150, 243, 0.16);
    color: #2196f3;
}

.fivemb-layer-badge.audio {
    background: rgba(255, 152, 0, 0.16);
    color: #ff9800;
}

.fivemb-empty-notice {
    padding: 16px;
    text-align: center;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 13px;
}


.ae-am-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.ae-am-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ae-am-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface-variant);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ae-am-label .material-symbols-rounded {
    font-size: 16px;
    color: var(--md-sys-color-primary);
}

.ae-am-select,
.ae-am-input {
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-m);
    padding: 10px 12px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    width: 100%;
}

.ae-am-select:focus,
.ae-am-input:focus {
    border-color: var(--md-sys-color-primary);
}

.ae-am-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ae-am-summary-card {
    background: var(--md-sys-color-surface-container-highest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-m);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ae-am-beat-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--md-sys-color-primary);
}

.ae-am-beat-meta {
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
}

.ae-am-beat-warn {
    font-size: 12px;
    color: var(--md-sys-color-error);
    font-weight: 600;
}



.upscale-workspace,
.interp-workspace,
.rembg-workspace {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    width: 100%;
}

#upscale-main-content,
#rembg-main-content,
#interp-main-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

#upscale-main-content.hidden,
#rembg-main-content.hidden,
#interp-main-content.hidden {
    display: none !important;
}

.upscale-controls-card,
.interp-controls-card {
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-m);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.upscale-controls-title,
.interp-controls-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.upscale-controls-title.upscale-title-spaced {
    margin-top: 14px;
}

.upscale-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.upscale-preset-btn {
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface-variant);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background-color var(--transition-standard), color var(--transition-standard), border-color var(--transition-standard), transform var(--transition-standard);
}

.upscale-preset-btn:hover {
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border-color: var(--md-sys-color-outline);
}

.upscale-preset-btn.active {
    background: var(--md-sys-color-primary-container);
    border-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary-container);
    font-weight: 700;
}

.upscale-preset-btn.active .material-symbols-rounded {
    color: var(--md-sys-color-on-primary-container);
}

.upscale-preset-btn .material-symbols-rounded {
    font-size: 16px;
    color: var(--md-sys-color-primary);
}

.upscale-order-toggle {
    position: relative;
    display: flex;
    background: var(--md-sys-color-surface-container-highest);
    border-radius: var(--radius-full);
    padding: 4px;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.upscale-order-toggle .tiktok-switch-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc((100% - 8px) / 2);
    height: calc(100% - 8px);
    border-radius: var(--radius-full);
    background: var(--md-sys-color-primary);
    transition: transform 0.28s var(--ease-spring-soft);
    pointer-events: none;
    transform: translateX(0%);
}

.upscale-order-toggle[data-selected="after"] .tiktok-switch-indicator {
    transform: translateX(100%);
}

.upscale-order-btn {
    flex: 1;
    position: relative;
    z-index: 1;
    background: transparent;
    border: none;
    color: var(--md-sys-color-on-surface-variant);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: color 0.22s ease;
    text-align: center;
    user-select: none;
    white-space: nowrap;
}

.upscale-order-btn.active {
    background: transparent;
    color: var(--md-sys-color-on-primary);
}

.upscale-normalise-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-m);
}

.upscale-normalise-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.upscale-normalise-title {
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    line-height: 1.2;
}

.upscale-normalise-desc {
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.4;
    opacity: 0.85;
}

.normalise-switch-wrap {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.normalise-switch-wrap input {
    opacity: 0;
    width: 0;
    height: 0;
}

.normalise-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--md-sys-color-surface-container-highest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 24px;
    transition: 0.2s;
}

.normalise-thumb {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 3px;
    background-color: var(--md-sys-color-outline);
    border-radius: 50%;
    transition: 0.2s;
}

.normalise-switch-wrap input:checked + .normalise-track {
    background-color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
}

.normalise-switch-wrap input:checked ~ .normalise-thumb {
    transform: translateX(18px);
    background-color: var(--md-sys-color-on-primary);
}


.interp-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.interp-metric-card {
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-m);
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.interp-metric-card.highlight {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-primary-container);
}

.interp-metric-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--md-sys-color-on-surface);
}

.interp-metric-val.primary {
    color: var(--md-sys-color-primary);
}

.interp-metric-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.interp-multipliers-track {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    background: var(--md-sys-color-surface-container-highest);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--md-sys-color-outline-variant);
}

.interp-mult-pill {
    background: transparent;
    border: none;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 13px;
    font-weight: 700;
    padding: 8px;
    border-radius: var(--radius-full);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.interp-mult-pill.active {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}


.rembg-color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--md-sys-color-surface-container-highest);
    border: 1px solid var(--md-sys-color-outline-variant);
    padding: 8px 12px;
    border-radius: var(--radius-m);
}

.rembg-color-box {
    border: none;
    background: transparent;
    width: 32px;
    height: 32px;
    cursor: pointer;
    border-radius: 50%;
}

.rembg-color-text {
    background: transparent;
    border: none;
    outline: none;
    color: var(--md-sys-color-on-surface);
    font-size: 13px;
    font-weight: 600;
    flex: 1;
}

.system-checking-card {
    margin-top: 16px;
    padding: 24px;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-l);
    text-align: center;
}

.system-checking-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--md-sys-color-on-surface);
}

.system-checking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.system-checking-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
}

@keyframes upscale-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.upscale-spinner {
    display: inline-block;
    animation: upscale-spin 1.2s linear infinite;
}


.upscale-comparison-container {
    position: relative;
    background: #000;
    border-radius: var(--radius-m);
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--md-sys-color-outline-variant);
    margin-bottom: 8px;
    touch-action: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

.upscale-comparison-container.checkerboard {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.12) 25%, transparent 25%),
                      linear-gradient(-45deg, rgba(255, 255, 255, 0.12) 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.12) 75%),
                      linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.12) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    background-color: #141414;
}

.upscale-comparison-wrapper,
.upscale-comparison-wrapper * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

.upscale-comparison-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upscale-transform-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
}

.upscale-comparison-wrapper video,
.upscale-comparison-wrapper img,
.upscale-comparison-wrapper canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    display: block;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
}

.upscale-original-clip {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.upscale-canvas-clip {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.upscale-unprocessed-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    padding: 16px;
}

.upscale-unprocessed-overlay.show {
    opacity: 1;
}

.upscale-unprocessed-overlay .unprocessed-title {
    color: #ff4d4d;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upscale-unprocessed-overlay .unprocessed-subtitle {
    color: #e0e0e0;
    font-size: 11px;
    font-weight: 400;
}

.upscale-comparison-container::selection,
.upscale-comparison-container *::selection {
    background: transparent;
}

.upscale-comparison-container::-moz-selection,
.upscale-comparison-container *::-moz-selection {
    background: transparent;
}

.upscale-slider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--md-sys-color-primary);
    transform: translateX(-50%);
    z-index: 30;
    cursor: col-resize;
}

.upscale-slider-line::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -16px;
    right: -16px;
    cursor: col-resize;
}

.upscale-slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-primary);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    cursor: col-resize;
    z-index: 31;
    user-select: none;
}

.upscale-slider-label,
.upscale-unprocessed-overlay,
.upscale-unprocessed-overlay * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.upscale-slider-label {
    position: absolute;
    top: 10px;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    z-index: 25;
    user-select: none;
}

.upscale-slider-label.left {
    left: 10px;
}

.upscale-slider-label.right {
    right: 10px;
}

.upscale-zoom-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    z-index: 35;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.upscale-zoom-badge.hidden {
    opacity: 0;
}

.upscale-batch-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.upscale-batch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-m);
}

.upscale-batch-item-info {
    flex: 1;
    min-width: 0;
}

.upscale-batch-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upscale-batch-item-size {
    font-size: 11px;
    color: var(--md-sys-color-on-surface-variant);
}

.upscale-batch-item-status {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface-variant);
    white-space: nowrap;
}

.upscale-batch-item-status.done {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.upscale-batch-item-status.failed {
    background: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
}

.upscale-batch-item-download,
.upscale-batch-item-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--md-sys-color-outline-variant);
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.upscale-batch-item-download:hover {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.upscale-batch-item-remove:hover {
    background: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
}

.upscale-batch-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 16px;
    border: 2px dashed var(--md-sys-color-outline-variant);
    border-radius: var(--radius-l);
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    margin-bottom: 12px;
    transition: border-color 0.2s cubic-bezier(0.2, 0, 0, 1), background 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.upscale-batch-drop:hover,
.upscale-batch-drop.dragover {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-container-high);
}

.upscale-zip-btn {
    width: 100%;
    margin-bottom: 10px;
}

.upscale-duration-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-full);
    margin-bottom: 8px;
    color: var(--md-sys-color-on-surface-variant);
}

.upscale-duration-row .material-symbols-rounded {
    font-size: 18px;
    flex-shrink: 0;
}

.upscale-duration-row input[type="range"] {
    flex: 1;
    height: 4px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--md-sys-color-outline-variant);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.upscale-duration-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--md-sys-color-primary);
    border: none;
    cursor: pointer;
}

.upscale-duration-row input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--md-sys-color-primary);
    border: none;
    cursor: pointer;
}

.upscale-duration-row input[type="range"]:disabled {
    opacity: 0.4;
    cursor: default;
}

.upscale-duration-label {
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 46px;
    text-align: right;
    color: var(--md-sys-color-on-surface);
    flex-shrink: 0;
}

.upscale-action-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.upscale-action-btn {
    background: var(--md-sys-color-surface-container-highest);
    border: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color var(--transition-standard), color var(--transition-standard), border-color var(--transition-standard), transform var(--transition-standard);
    flex: 1;
}

.upscale-action-btn:hover {
    background: var(--md-sys-color-surface-container-high);
    border-color: var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface);
}

.upscale-action-btn.active {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-weight: 700;
}

.upscale-action-btn.active .material-symbols-rounded {
    color: var(--md-sys-color-on-primary);
}

.upscale-action-btn .material-symbols-rounded {
    font-size: 18px;
    color: var(--md-sys-color-primary);
}

.upscale-action-btn.active:hover {
    background: var(--md-sys-color-primary);
    filter: brightness(1.05);
}

.upscale-timeline {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.upscale-timeline-times {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--md-sys-color-on-surface-variant);
    font-family: inherit;
}


.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.preset-card {
    position: relative;
    border-radius: var(--radius-l);
    overflow: hidden;
    background-color: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.2, 0, 0, 1), border-color 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.preset-card:hover {
    transform: translateY(-4px);
    border-color: var(--md-sys-color-primary);
}

.preset-thumb {
    position: relative;
    aspect-ratio: 9 / 13;
    background: linear-gradient(135deg, var(--md-sys-color-surface-container-high), var(--md-sys-color-surface-container));
}

.preset-thumb img,
.preset-thumb video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preset-thumb-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-outline);
}

.preset-thumb-placeholder .material-symbols-rounded {
    font-size: 36px;
    line-height: 1;
    opacity: 0.6;
}

.preset-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.preset-badge {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preset-badge img {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 17px;
    height: 17px;
    object-fit: contain;
}

.preset-name {
    padding: 10px 12px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--md-sys-color-on-surface);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.preset-skeleton {
    aspect-ratio: 9 / 13;
    border-radius: var(--radius-l);
    background-color: var(--md-sys-color-surface-container-high);
    animation: skelPulse 1.4s ease-in-out infinite;
}

.explore-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 26px 10px 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
}

.explore-info-title {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.preset-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0);
    visibility: hidden;
    transition: background-color 0.3s cubic-bezier(0.2, 0, 0, 1), visibility 0.3s step-end;
}

.preset-modal-backdrop.visible {
    background: rgba(0, 0, 0, 0.72);
    visibility: visible;
    transition: background-color 0.3s cubic-bezier(0.2, 0, 0, 1), visibility 0s;
}

.preset-modal-card {
    position: fixed;
    z-index: 41;
    display: flex;
    flex-direction: column;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-xl, 28px);
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    contain: content;
    transition: transform 0.44s var(--ease-spring-soft), filter 0.35s ease;
}

.preset-modal-card.expanded {
    visibility: visible;
    pointer-events: auto;
}

body.preset-popup-active .preset-modal-card.expanded {
    transform: scale(0.94) translateY(-8px);
    filter: brightness(0.55);
    pointer-events: none;
}

.preset-modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.preset-modal-close-btn .material-symbols-rounded {
    font-size: 20px;
    line-height: 1;
}

.preset-modal-media {
    position: absolute;
    inset: 0;
    background: var(--md-sys-color-surface-container-high);
}

.preset-modal-media img,
.preset-modal-media video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preset-modal-media .preset-thumb-placeholder {
    position: absolute;
    inset: 0;
}

.preset-preview-stage {
    position: absolute;
    inset: 0;
    z-index: 1;
    transition: opacity 0.45s ease 0.12s;
}

.preset-preview-stage.is-done {
    opacity: 0;
    pointer-events: none;
}

.preset-preview-stage .preset-preview-thumb {
    z-index: 1;
}

.preset-modal-media .preset-preview-video {
    opacity: 0;
    transition: opacity 0.45s ease;
    z-index: 2;
}

.preset-modal-media .preset-preview-video.is-ready {
    opacity: 1;
}

.preset-modal-overlay-ui {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 56px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 35%, rgba(0, 0, 0, 0.5) 65%, rgba(0, 0, 0, 0));
}

.preset-modal-overlay-ui .preset-badges {
    position: static;
}

.preset-modal-overlay-ui .preset-name {
    padding: 0;
    font-size: 1.15rem;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
    -webkit-line-clamp: unset;
}

.preset-modal-overlay-ui .preset-meta {
    color: rgba(255, 255, 255, 0.85);
}

.preset-modal-overlay-ui .meta-dot {
    opacity: 0.6;
}

.preset-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
}

.preset-download-btn {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: filter 0.2s cubic-bezier(0.2, 0, 0, 1), transform 0.15s cubic-bezier(0.2, 0, 0, 1);
}

.preset-download-btn .material-symbols-rounded {
    font-size: 20px;
    line-height: 1;
}

.preset-download-btn:hover:not(:disabled) {
    filter: brightness(1.1);
}

.preset-download-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.preset-download-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.chip-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    border-radius: 4px;
}

#preset-categories .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.preset-card.preset-source-hidden {
    opacity: 0;
    pointer-events: none;
}

.preset-thumb-fail {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    text-align: center;
    color: var(--md-sys-color-outline);
    background: linear-gradient(135deg, var(--md-sys-color-surface-container-high), var(--md-sys-color-surface-container));
}

.preset-thumb-fail .material-symbols-rounded {
    font-size: 40px;
    line-height: 1;
    opacity: 0.7;
}

.preset-thumb-fail-text {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.preset-modal-media .preset-thumb-fail .material-symbols-rounded {
    font-size: 64px;
}

.preset-modal-media .preset-thumb-fail-text {
    font-size: 0.9rem;
    color: var(--md-sys-color-on-surface-variant);
}

.preset-video-sound-btn {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 7;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.preset-video-sound-btn .material-symbols-rounded {
    font-size: 20px;
    line-height: 1;
}

.preset-modal-close-btn .material-symbols-rounded {
    font-size: 20px;
}

.preset-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 42;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.2, 0, 0, 1), visibility 0.25s step-end;
}

.preset-popup-overlay.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    background: transparent;
    transition: opacity 0.25s cubic-bezier(0.2, 0, 0, 1), visibility 0s;
}

.preset-popup-overlay.transparent-bg {
    background: transparent !important;
}

.preset-popup-card {
    position: fixed;
    z-index: 43;
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    will-change: left, top, width, height, border-radius;
}

.preset-popup-card.expanded {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.preset-morph-face {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
}

.preset-morph-face.btn-face {
    padding: 13px 18px;
    border-radius: var(--radius-full);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-size: 0.9rem;
    font-weight: 800;
    font-family: inherit;
}

.preset-morph-face.row-face {
    justify-content: flex-start;
    gap: 14px;
    padding: 0 16px;
    background: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-l, 16px);
    color: var(--md-sys-color-on-surface);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
}

.preset-morph-face .material-symbols-rounded {
    font-size: 20px;
    line-height: 1;
}

.preset-morph-face.btn-face .material-symbols-rounded:last-child {
    margin-left: 0;
}

.preset-morph-face.row-face img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
}

.preset-morph-face.row-face .material-symbols-rounded:last-child {
    margin-left: auto;
    color: var(--md-sys-color-primary);
}

.preset-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.preset-popup-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    min-width: 0;
}

.preset-popup-title-icon {
    font-size: 24px;
    color: var(--md-sys-color-primary);
    flex-shrink: 0;
}

.preset-popup-sw-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
}

.preset-popup-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preset-popup-close-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.preset-popup-close-btn:hover {
    background: var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface);
}

.preset-popup-close-btn:active {
    transform: scale(0.92);
}

.preset-popup-close-btn .material-symbols-rounded {
    font-size: 20px;
    line-height: 1;
}

.preset-popup-desc {
    font-size: 0.85rem;
    color: var(--md-sys-color-on-surface-variant);
    margin: 8px 0 16px 0;
    line-height: 1.4;
}

.preset-popup-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.preset-option-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border-radius: var(--radius-l, 16px);
    border: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, color 0.2s ease;
}

.preset-option-btn:hover {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.preset-option-btn:active {
    transform: scale(0.98);
}

.preset-option-btn img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
}

.preset-option-btn .material-symbols-rounded:last-child {
    margin-left: auto;
    font-size: 20px;
    color: var(--md-sys-color-primary);
    flex-shrink: 0;
}

.preset-option-btn:hover .material-symbols-rounded:last-child {
    color: var(--md-sys-color-on-primary-container);
}

.preset-option-btn.am-xml-btn {
    gap: 12px;
}

.preset-extra-section {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px dashed var(--md-sys-color-outline-variant);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.preset-section-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--md-sys-color-on-surface-variant);
}

.preset-extra-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.preset-extra-btn {
    padding: 10px 14px;
    font-size: 0.85rem;
    border-style: dashed;
}

.preset-plugin-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
}

.preset-plugin-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.preset-plugin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--md-sys-color-surface-container-highest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-m, 12px);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

.preset-plugin-badge .material-symbols-rounded {
    font-size: 16px;
    color: var(--md-sys-color-primary);
}

.preset-popup-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    margin-top: 6px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-sizing: border-box;
    transition: filter 0.2s ease, transform 0.15s ease;
}

.preset-popup-action-btn:hover {
    filter: brightness(1.08);
}

.preset-popup-action-btn:active {
    transform: scale(0.98);
}

.preset-popup-action-btn .material-symbols-rounded {
    font-size: 20px;
    line-height: 1;
}

@media (max-width: 600px) {
    .preset-popup-overlay {
        align-items: flex-end;
    }

    .preset-popup-card {
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius-xl, 28px) var(--radius-xl, 28px) 0 0;
        border-bottom: none;
        border-left: none;
        border-right: none;
        padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px)) 20px;
    }
}

.resource-card.deep-link-flash {
    animation: resource-deeplink-pulse 0.9s var(--ease-spring-soft, ease-out) 2;
}

@keyframes resource-deeplink-pulse {
    0% {
    }
    70% {
    }
    100% {
    }
}

/* ============================================================
   MOBILE LOW-END: matikan hardware acceleration / efek GPU-berat
   Render lebih banyak lewat CPU: tanpa layer paksa (will-change),
   tanpa blur backdrop, tanpa compositing 3D di signpost & modal.
   ============================================================ */
@media (max-width: 768px) {
    .floating-nav-bar,
    .tiktok-card-duration {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .floating-nav-bar,
    .floating-nav-indicator,
    .app-layout,
    .cube-3d-box,
    .preset-modal-card,
    .res-modal-card,
    .tool-modal-card,
    .legal-modal-backdrop,
    .social-portal-card,
    .social-portal-icon-wrapper,
    .social-portal-label-wrapper,
    .legal-portal-hero-btn {
        will-change: auto !important;
    }

    /* Modal terbuka: tanpa scale/transform di app-layout (hindari raster GPU layer raksasa) */
    body.legal-modal-open .app-layout,
    body.res-modal-open .app-layout,
    body.tool-modal-open .app-layout,
    body.social-modal-open .app-layout,
    body.preset-modal-open .app-layout {
        transform: none;
        border-radius: 0;
    }

    /* Signpost: 3D tetap aktif di mobile (perspective + box utuh dari desktop) */
    .sign-arrow {
        transition: transform 0.35s var(--ease-spring);
    }

    .sign-arrow:active {
        transform: rotateY(var(--theta)) translateZ(var(--depth)) scale(0.96) !important;
    }
}

/* ============================================================
   REDUCED MOTION: hentikan animasi dekoratif (shimmer/pulse/spin)
   untuk user yang mengaktifkan "reduce motion" di OS — hemat CPU.
   Animasi morphing utama (modal/cube) TIDAK disentuh.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {

    .tiktok-card-skeleton .skeleton-thumb,
    .tiktok-card-skeleton .skeleton-line,
    .skeleton-tool-card-icon,
    .skeleton-tool-card-line,
    .skeleton-resource-card-icon,
    .skeleton-resource-card-line,
    .skeleton-social-btn,
    .preset-skeleton,
    .tool-card-arrow.is-processing,
    .stats-skeleton {
        animation: none !important;
    }
}
