:root {
    --bg: #08080A;
    --bg-workspace: #0D0D10;
    --card: #121215;
    --card-elevated: #17171B;
    --border: #27272A;
    --border-hover: #3F3F46;
    --text: #F4F4F5;
    --text-dim: #A1A1AA;
    --text-faint: #71717A;
    --accent: #A78BFA;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    height: 100vh;
    height: 100svh;
}

/* ============================================================
   WADAH UTAMA (Tumpukan Halaman)
   ============================================================ */
.app-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.view-section {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
    will-change: transform, opacity;
}

.view-section#hero {
    z-index: 10;
    opacity: 1;
    transform: translateX(0);
}

.view-section#workspace {
    z-index: 20;
    opacity: 0;
    transform: translateX(100%);
    background: var(--bg-workspace);
    overflow-y: auto;
}

.app-container.show-workspace .view-section#hero {
    opacity: 0;
    transform: translateX(-30%);
    pointer-events: none;
}

.app-container.show-workspace .view-section#workspace {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.app-container.show-hero .view-section#hero {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.app-container.show-hero .view-section#workspace {
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
#particleCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
}

/* ---- Navbar ---- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
    flex-shrink: 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}

.nav-logo svg {
    width: 18px;
    height: 18px;
    stroke: var(--text);
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.coin-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.coin-pill:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.coin-pill svg {
    width: 12px;
    height: 12px;
    stroke: var(--accent);
}

/* ---- Hero Center ---- */
.hero-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 32px;
    padding: 20px 0;
}

/* ---- Floating Chat Mockup ---- */
.hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 440px;
    height: 160px;
}

.chat-bubble {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: 20px 20px 20px 6px;
    background: rgba(24, 24, 28, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: bubbleFloat 5s ease-in-out infinite;
}

.chat-bubble .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #52525B, #27272A);
    flex-shrink: 0;
}

.chat-bubble .bubble-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.01em;
}

@keyframes bubbleFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.float-badge {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: var(--radius-pill);
    background: rgba(18, 18, 21, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.8);
}

.float-badge svg {
    width: 12px;
    height: 12px;
    stroke: var(--accent);
}

.float-badge.badge-left {
    top: 18%;
    left: 0;
    animation: badgeFloat1 6s ease-in-out infinite;
}

.float-badge.badge-right {
    top: 14%;
    right: 0;
    animation: badgeFloat2 7s ease-in-out infinite;
}

.float-badge.badge-bottom {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: badgeFloat3 5.5s ease-in-out infinite;
}

@keyframes badgeFloat1 {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-4px, -6px);
    }
}

@keyframes badgeFloat2 {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(4px, -8px);
    }
}

@keyframes badgeFloat3 {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(6px);
    }
}

/* ---- Typography ---- */
.hero-title {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 0.95;
    letter-spacing: -0.045em;
    font-weight: 800;
}

.hero-title .line-1 {
    font-size: clamp(2.8rem, 12vw, 6.5rem);
    background: linear-gradient(180deg, #FAFAFA 0%, #A1A1AA 70%, #8B8B94 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-title .line-2 {
    font-size: clamp(2.8rem, 12vw, 6.5rem);
    color: #FFFFFF;
}

.hero-sub {
    max-width: 420px;
    font-size: 0.92rem;
    color: var(--text-dim);
    line-height: 1.65;
    padding: 0 8px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 14px 32px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #FFFFFF;
    color: #0A0A0C;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s, background 0.2s;
    box-shadow: 0 12px 32px -12px rgba(255, 255, 255, 0.4);
}

.hero-cta:hover {
    background: #F4F4F5;
    transform: translateY(-2px);
    box-shadow: 0 16px 40px -12px rgba(255, 255, 255, 0.5);
}

.hero-cta:active {
    transform: scale(0.98);
}

.hero-cta svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* ---- Scroll Indicator ---- */
.scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 0 28px;
    color: var(--text-faint);
    font-family: 'Geist Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    flex-shrink: 0;
    cursor: pointer;
    transition: color 0.2s;
}

.scroll-hint:hover {
    color: var(--text);
}

.scroll-hint .scroll-line {
    width: 1px;
    height: 28px;
    background: linear-gradient(to bottom, transparent, var(--text-faint));
    animation: scrollPulse 2.2s ease-in-out infinite;
}

@keyframes scrollPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scaleY(0.7);
        transform-origin: top;
    }

    50% {
        opacity: 1;
        transform: scaleY(1);
        transform-origin: top;
    }
}

/* ============================================================
   WORKSPACE SECTION
   ============================================================ */
.workspace-inner {
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
    padding: 72px 20px 56px;
}

.workspace-header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
}

.ws-nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* logo navbar: putih di tema gelap, hitam di tema terang */
.nav-logo img {
    width: 22px;
    height: 22px;
    display: block;
    flex-shrink: 0;
}

/* label versi di bawah tombol utama */
.app-version {
    margin-top: 12px;
    font-family: 'Geist Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    text-align: center;
}

.nav-logo .logo-hitam {
    display: none;
}

html[data-theme="light"] .nav-logo .logo-putih {
    display: none;
}

html[data-theme="light"] .nav-logo .logo-hitam {
    display: block;
}

.workspace-label {
    font-family: 'Geist Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-back:hover {
    color: var(--text);
}

.btn-back svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.workspace-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 40px;
    line-height: 1.15;
}

.workspace-title span {
    color: var(--text-faint);
}

/* ---- Card ---- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 0;
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--card-elevated);
}

.card-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-dim);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.card-desc {
    font-size: 0.76rem;
    color: var(--text-faint);
    margin-top: 1px;
}

.card-step {
    font-family: 'Geist Mono', monospace;
    font-size: 0.68rem;
    color: var(--text-faint);
    letter-spacing: 0.05em;
}

.card-body {
    padding: 16px 20px 20px;
}

/* ---- CHAT UI (Decoder Chat) ---- */
.chat-container {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #0B0B0E;
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.chat-container:focus-within {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3), 0 10px 40px -10px rgba(139, 92, 246, 0.2);
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
}

.chat-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    display: grid;
    place-items: center;
    color: white;
}

.chat-avatar svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
}

.chat-header-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.02em;
}

.chat-body {
    padding: 16px;
}

.chat-body textarea {
    width: 100%;
    min-height: 90px;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.chat-body textarea::placeholder {
    color: var(--text-faint);
}

.chat-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.015);
    border-top: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.chat-chip {
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-chip:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
    color: var(--text);
}

.chat-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-top: 1px solid var(--border);
}

.context-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-right: 2px;
}

.context-chip {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px dashed var(--border);
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.context-chip:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.context-chip.active {
    border-style: solid;
    border-color: #FFFFFF;
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}

.chat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    background: #FFFFFF;
    color: #0A0A0C;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.chat-send-btn:hover {
    background: #E4E4E7;
    transform: scale(1.02);
}

.chat-send-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* ---- Result ---- */
.result {
    display: none;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.result.show {
    display: block;
    animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.result-label {
    font-family: 'Geist Mono', monospace;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 8px;
}

.meaning-box {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 0.86rem;
    color: var(--text-dim);
    line-height: 1.65;
}

.badge {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text-dim);
    background: var(--card-elevated);
}

.badge.danger {
    color: #FCA5A5;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.08);
}

.badge.mid {
    color: #FCD34D;
    border-color: rgba(252, 211, 77, 0.35);
    background: rgba(252, 211, 77, 0.08);
}

.badge.safe {
    color: #86EFAC;
    border-color: rgba(134, 239, 172, 0.35);
    background: rgba(134, 239, 172, 0.08);
}

.reply-title {
    font-family: 'Geist Mono', monospace;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 20px 0 10px;
}

.reply-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reply-item {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    transition: border-color 0.2s;
}

.reply-item:hover {
    border-color: var(--border-hover);
}

.reply-item .tag {
    font-family: 'Geist Mono', monospace;
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}

.reply-item .text {
    font-size: 0.86rem;
    color: var(--text);
    line-height: 1.65;
    margin-bottom: 10px;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-copy:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: var(--card-elevated);
}

.btn-copy:active {
    transform: scale(0.97);
}

.btn-copy.copied {
    color: #86EFAC;
    border-color: rgba(134, 239, 172, 0.4);
    background: rgba(134, 239, 172, 0.08);
}

.btn-copy svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
}

/* ---- Excuse Grid ---- */
.excuse-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.excuse-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s;
}

.excuse-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: var(--card-elevated);
}

.excuse-btn:active {
    transform: scale(0.98);
}

.excuse-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    flex-shrink: 0;
}

.excuse-result {
    display: none;
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
}

.excuse-result.show {
    display: block;
    animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.excuse-result .text {
    font-size: 0.86rem;
    color: var(--text-dim);
    line-height: 1.65;
    margin-bottom: 12px;
}

/* ---- About Card (Workspace) ---- */
.about-text {
    font-size: 0.86rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 12px;
}

.about-text strong {
    color: var(--text);
    font-weight: 600;
}

.about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.about-tag {
    font-family: 'Geist Mono', monospace;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-dim);
}

/* ---- Footer ---- */
.footer {
    max-width: 768px;
    margin: 48px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer p {
    font-size: 0.78rem;
    color: var(--text-faint);
    font-family: 'Geist Mono', monospace;
}

.footer p span {
    color: var(--text-dim);
}

/* ---- Toast ---- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 20px);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--card-elevated);
    color: var(--text);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 300;
    white-space: nowrap;
}

.toast svg {
    width: 14px;
    height: 14px;
    stroke: #86EFAC;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 380px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.modal-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.modal-close:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.modal-close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    margin-bottom: 14px;
}

.balance-row .label {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.balance-row .value {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Geist Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.balance-row .value svg {
    width: 14px;
    height: 14px;
    stroke: var(--accent);
}

.package-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    margin-bottom: 10px;
}

.package-row .pkg-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

.package-row .pkg-sub {
    font-family: 'Geist Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-faint);
    margin-top: 1px;
}

.package-row .pkg-price {
    font-family: 'Geist Mono', monospace;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-dim);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, filter 0.2s;
}

.btn-modal.primary {
    border: 1px solid rgba(167, 139, 250, 0.3);
    background: linear-gradient(180deg, #8B5CF6, #7C3AED);
    color: #FFFFFF;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-modal.primary:hover {
    filter: brightness(1.1);
}

.btn-modal.secondary {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
}

.btn-modal.secondary:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.btn-modal:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-modal svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* ---- Info Modal (untuk nav menu) ---- */
.info-modal-box {
    max-width: 440px;
}

.info-text {
    font-size: 0.86rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 12px;
}

.info-text strong {
    color: var(--text);
    font-weight: 600;
}

/* ---- Info Steps (Cara Kerja) ---- */
.info-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.info-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.86rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.info-steps .step-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--card-elevated);
    border: 1px solid var(--border);
    font-family: 'Geist Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
}

.info-steps strong {
    color: var(--text);
    font-weight: 600;
}

/* ---- FAQ ---- */
.faq-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-q {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.faq-a {
    font-size: 0.84rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ---- Menu list (modal Menu) ---- */
.menu-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.menu-list-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.menu-list-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: var(--card-elevated);
}

button.nav-link {
    font-family: inherit;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Mobile / Layar Pendek ---- */
@media (max-width: 640px) {
    .nav-center {
        display: none;
    }

    .hero-visual {
        height: 140px;
        max-width: 320px;
    }

    .float-badge {
        font-size: 0.66rem;
        padding: 6px 10px;
    }

    .float-badge.badge-left {
        top: 8%;
        left: -8px;
    }

    .float-badge.badge-right {
        top: 6%;
        right: -8px;
    }

    .workspace-inner {
        padding: 56px 16px 40px;
    }

    .card-header {
        padding: 16px 16px 0;
    }

    .card-body {
        padding: 14px 16px 16px;
    }

    .excuse-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-height: 720px) {
    .hero-center {
        gap: 18px;
        padding: 10px 0;
    }

    .hero-visual {
        height: 120px;
        max-width: 340px;
    }

    .hero-title .line-1,
    .hero-title .line-2 {
        font-size: clamp(2.2rem, 9vw, 4.5rem);
    }

    .hero-sub {
        font-size: 0.85rem;
    }

    .hero-cta {
        padding: 12px 26px;
        font-size: 0.86rem;
    }

    .scroll-hint {
        padding: 8px 0 14px;
    }
}

@media (max-height: 620px) {
    .hero-visual {
        display: none;
    }

    .hero-center {
        gap: 14px;
    }

    .scroll-hint .scroll-line {
        height: 18px;
    }
}

/* --- Riwayat --- */
.history-clear {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.history-clear:hover {
    color: #FFFFFF;
    border-color: #FFFFFF;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.015);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
}

.history-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    color: var(--text);
}

.history-meta {
    font-size: 0.68rem;
    color: var(--text-dim);
    white-space: nowrap;
}

/* --- Skor & Red Flag --- */
.risk-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.risk-score {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    color: var(--text);
}

.risk-bar {
    width: 56px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.risk-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.risk-flag {
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.68rem;
    color: var(--text);
}

/* --- Toggle sudut pandang --- */
.sudut-toggle {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sudut-toggle:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.sudut-toggle.active {
    border-color: #FFFFFF;
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}

/* --- Tanya lanjutan --- */
.followup {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.followup-title {
    margin-bottom: 10px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.followup-log {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.followup-bubble {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.82rem;
    line-height: 1.5;
}

.followup-bubble.user {
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.followup-bubble.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-dim);
}

.followup-input {
    display: flex;
    gap: 8px;
}

.followup-input input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    outline: none;
}

.followup-input input:focus {
    border-color: var(--border-hover);
}

.followup-btn {
    padding: 9px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    color: #000000;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.followup-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Bedah Percakapan --- */
#bedahInput {
    width: 100%;
    min-height: 130px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

#bedahInput:focus {
    border-color: var(--border-hover);
}

.bedah-btn {
    margin-top: 10px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    color: #000000;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.bedah-btn:hover {
    opacity: 0.9;
}

.bedah-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bedah-result {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.bedah-ringkasan {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text);
}

.bedah-invest {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    color: var(--text-dim);
}

.bedah-sub {
    margin: 16px 0 8px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.bedah-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bedah-list li {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-dim);
}

/* --- Navigasi tab workspace --- */
.ws-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 22px 0 16px;
}

.ws-tab {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ws-tab:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.ws-tab.active {
    border-color: #FFFFFF;
    background: #FFFFFF;
    color: #000000;
    font-weight: 600;
}

.ws-empty {
    padding: 18px 4px;
    font-size: 0.82rem;
    color: var(--text-dim);
}

/* --- Layout 2 kolom untuk layar lebar --- */
@media (min-width: 900px) {
    .workspace-inner {
        max-width: 1040px;
        display: grid;
        grid-template-columns: 200px minmax(0, 1fr);
        column-gap: 32px;
        align-items: start;
    }

    .workspace-header-nav,
    .workspace-title {
        grid-column: 1 / -1;
    }

    .ws-tabs {
        grid-column: 1;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 4px;
        margin: 0;
        position: sticky;
        top: 32px;
    }

    .ws-tab {
        text-align: left;
        padding: 9px 12px;
        border-radius: var(--radius-sm);
    }

    .card {
        grid-column: 2;
    }
}

/* --- Gauge overthinking --- */
.gauge {
    width: 280px;
    margin: 4px auto 0;
}

.gauge-svg {
    display: block;
    width: 100%;
    overflow: visible;
}

.arc {
    fill: none;
    stroke-width: 14;
}

.arc-red {
    stroke: #F87171;
}

.arc-orange {
    stroke: #FBBF24;
}

.arc-yellow {
    stroke: #FDE68A;
}

.arc-green {
    stroke: #4ADE80;
}

#gaugeNeedle line {
    stroke: #FFFFFF;
    stroke-width: 3;
    stroke-linecap: round;
}

.gauge-hub {
    fill: #FFFFFF;
}

.gauge-readout {
    text-align: center;
    margin-top: 2px;
}

.gauge-value {
    display: block;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

.gauge-label {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* --- Cek overthinking --- */
#overInput {
    width: 100%;
    min-height: 100px;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

#overInput:focus {
    border-color: var(--border-hover);
}

.over-hasil {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.over-alasan {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text);
}

.over-saran {
    margin-top: 10px;
    padding: 12px 14px;
    border-left: 2px solid #4ADE80;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-dim);
}

/* --- Terjemah emoji --- */
#emojiInput {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
}

#emojiInput:focus {
    border-color: var(--border-hover);
}

.emoji-hasil {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.emoji-ringkasan {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 14px;
}

.emoji-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.emoji-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.015);
}

.emoji-simbol {
    font-size: 1.4rem;
    line-height: 1;
    min-width: 30px;
    text-align: center;
}

.emoji-arti {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-dim);
}

/* --- Pembuka chat --- */
#pembukaInput {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

#pembukaInput:focus {
    border-color: var(--border-hover);
}

.pembuka-hasil {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.pembuka-catatan {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-left: 2px solid #FBBF24;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-dim);
}

.pembuka-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ============================================================
   MODE TERANG
   Aktif saat <html data-theme="light">
   ============================================================ */
html[data-theme="light"] {
    --bg: #FAFAFA;
    --bg-workspace: #FFFFFF;
    --card: #FFFFFF;
    --card-elevated: #F4F4F5;
    --border: #E4E4E7;
    --border-hover: #D4D4D8;
    --text: #18181B;
    --text-dim: #52525B;
    --text-faint: #71717A;
    --accent: #7C3AED;
}

/* tombol utama dibalik: hitam di atas putih */
html[data-theme="light"] .chat-send-btn,
html[data-theme="light"] .bedah-btn,
html[data-theme="light"] .followup-btn,
html[data-theme="light"] .btn-modal.primary,
html[data-theme="light"] .ws-tab.active {
    background: #18181B;
    color: #FFFFFF;
    border-color: #18181B;
}

/* kotak isian jadi putih bersih */
html[data-theme="light"] textarea,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] #bedahInput,
html[data-theme="light"] #overInput,
html[data-theme="light"] #emojiInput,
html[data-theme="light"] #pembukaInput,
html[data-theme="light"] .followup-input input {
    background: #FFFFFF;
    color: #18181B;
    border-color: #E4E4E7;
}

/* panel kecil yang di mode gelap memakai putih transparan */
html[data-theme="light"] .reply-item,
html[data-theme="light"] .history-item,
html[data-theme="light"] .emoji-item,
html[data-theme="light"] .risk-flag,
html[data-theme="light"] .followup-bubble.ai,
html[data-theme="light"] .modal {
    background: #F4F4F5;
    border-color: #E4E4E7;
}

/* jarum gauge harus gelap supaya kelihatan */
html[data-theme="light"] #gaugeNeedle line {
    stroke: #18181B;
}

html[data-theme="light"] .gauge-hub {
    fill: #18181B;
}

html[data-theme="light"] .risk-bar {
    background: rgba(0, 0, 0, 0.08);
}

/* tombol ganti tema */
.theme-toggle {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* --- Perbaikan mode terang: bagian yang masih gelap/putih --- */
html[data-theme="light"] .chat-container {
    background: #FFFFFF;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .chat-container:focus-within {
    border-color: rgba(124, 58, 237, 0.45);
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.2), 0 10px 40px -10px rgba(124, 58, 237, 0.15);
}

html[data-theme="light"] .chat-header {
    background: #F4F4F5;
}

html[data-theme="light"] .chat-footer {
    background: #FAFAFA;
}

html[data-theme="light"] .hero-title .line-1 {
    background-image: linear-gradient(180deg, #18181B 0%, #3F3F46 70%, #52525B 100%);
}

html[data-theme="light"] .hero-title .line-2 {
    color: #18181B;
}

/* Badge & bubble hero di mode terang */
html[data-theme="light"] .float-badge {
    background: rgba(255, 255, 255, 0.92);
    border-color: #E4E4E7;
    color: #52525B;
    box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] .chat-bubble {
    background: #FFFFFF;
    border-color: #E4E4E7;
    box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .chat-bubble .bubble-text {
    color: #18181B;
}

/* ============================================================
   PALET FINAL — MODE TERANG
   Putih hangat, teks abu-gelap, garis lembut
   ============================================================ */
html[data-theme="light"] {
    --bg: #F6F5F2;
    --bg-workspace: #FBFAF8;
    --card: #FFFFFF;
    --card-elevated: #F1F0EC;
    --border: #E5E3DD;
    --border-hover: #D3D0C8;
    --text: #2B2B30;
    --text-dim: #5C5C64;
    --text-faint: #8A8A92;
    --accent: #6D5BD0;
}

/* kartu sedikit terangkat, bukan tenggelam di latar */
html[data-theme="light"] .card {
    box-shadow: 0 1px 2px rgba(43, 43, 48, 0.04), 0 8px 24px -18px rgba(43, 43, 48, 0.18);
}

/* tombol utama & tab aktif: hitam lembut, bukan hitam pekat */
html[data-theme="light"] .chat-send-btn,
html[data-theme="light"] .bedah-btn,
html[data-theme="light"] .followup-btn,
html[data-theme="light"] .btn-modal.primary,
html[data-theme="light"] .ws-tab.active {
    background: #2B2B30;
    color: #FBFAF8;
    border-color: #2B2B30;
}

/* kotak chat versi terang */
html[data-theme="light"] .chat-container {
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(43, 43, 48, 0.05), 0 10px 30px -22px rgba(43, 43, 48, 0.25);
}

html[data-theme="light"] .chat-header,
html[data-theme="light"] .chat-footer {
    background: #FBFAF8;
}