:root {
    --aw-contrast: 1;
    --aw-font-scale: 1; /* konten */
    --aw-head-scale: 1; /* konten */
    --aw-saturation: 1;
    --aw-gray: 0; /* 0=warna, 1=grayscale (level 3) */
    --aw-z: 9999;
}

/* >>> Semua efek diterapkan ke KONTEN, bukan widget */
#aw-content {
    filter: contrast(var(--aw-contrast)) saturate(var(--aw-saturation))
        grayscale(var(--aw-gray));
}

/* ====== PERBESAR TEKS (jinak, tidak jebol) – HANYA #aw-content ====== */
#aw-content.aw-font {
    --aw-font-mult: var(--aw-font-scale);
    --aw-head-mult: var(--aw-head-scale);
    --aw-line: 1.5;
    --aw-h-line: 1.28;
}
#aw-content.aw-font.aw-font-l0 {
    --aw-font-scale: 1;
    --aw-head-scale: 1;
    --aw-line: 1.5;
    --aw-h-line: 1.28;
}
#aw-content.aw-font.aw-font-l1 {
    --aw-font-scale: 1.06;
    --aw-head-scale: 1.04;
    --aw-line: 1.52;
    --aw-h-line: 1.3;
}
#aw-content.aw-font.aw-font-l2 {
    --aw-font-scale: 1.12;
    --aw-head-scale: 1.07;
    --aw-line: 1.56;
    --aw-h-line: 1.32;
}
#aw-content.aw-font.aw-font-l3 {
    --aw-font-scale: 1.18;
    --aw-head-scale: 1.1;
    --aw-line: 1.6;
    --aw-h-line: 1.34;
}

#aw-content.aw-font,
#aw-content.aw-font p,
#aw-content.aw-font li,
#aw-content.aw-font a,
#aw-content.aw-font span,
#aw-content.aw-font strong,
#aw-content.aw-font em,
#aw-content.aw-font small,
#aw-content.aw-font label,
#aw-content.aw-font input,
#aw-content.aw-font textarea,
#aw-content.aw-font button {
    font-size: calc(1em * var(--aw-font-mult)) !important;
    line-height: var(--aw-line) !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
}
#aw-content.aw-font h1,
#aw-content.aw-font h2,
#aw-content.aw-font h3,
#aw-content.aw-font h4,
#aw-content.aw-font h5,
#aw-content.aw-font h6 {
    font-size: calc(1em * var(--aw-head-mult)) !important;
    line-height: var(--aw-h-line) !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
}

/* ====== DYSLEXIA-FRIENDLY – HANYA #aw-content ====== */
@font-face {
    font-family: "OpenDyslexic";
    src: url("https://cdn.jsdelivr.net/gh/antijingoist/open-dyslexic/exports/OpenDyslexic3-Regular.woff2")
        format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
#aw-content.aw-dyslexia,
#aw-content.aw-dyslexia * {
    font-family: "OpenDyslexic", system-ui, -apple-system, Segoe UI, Roboto,
        "Helvetica Neue", Arial, sans-serif !important;
    letter-spacing: 0.02em !important;
    word-spacing: 0.04em !important;
    line-height: 1.6 !important;
}

/* ====== BIG CURSOR – HANYA #aw-content ====== */
#aw-content.aw-cursor,
#aw-content.aw-cursor * {
    cursor: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2248%22%20height%3D%2248%22%3E%3Cpolygon%20points%3D%221%2C1%201%2C35%2012%2C26%2018%2C46%2025%2C43%2019%2C24%2035%2C24%22%20fill%3D%22black%22%20stroke%3D%22white%22%20stroke-width%3D%222%22%2F%3E%3C%2Fsvg%3E")
            1 1,
        auto !important;
}
#aw-content.aw-cursor a,
#aw-content.aw-cursor button,
#aw-content.aw-cursor [role="button"],
#aw-content.aw-cursor input,
#aw-content.aw-cursor select,
#aw-content.aw-cursor textarea {
    cursor: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2248%22%20height%3D%2248%22%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%2210%22%20fill%3D%22black%22%20stroke%3D%22white%22%20stroke-width%3D%222%22%2F%3E%3C%2Fsvg%3E")
            16 16,
        pointer !important;
}

/* ====== SHELL / UI WIDGET ====== */
.aw {
    position: fixed;
    bottom: 1rem;
    inset-inline-end: 1rem;
    z-index: var(--aw-z);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.aw-left {
    inset-inline-start: 1rem;
    inset-inline-end: auto;
}
[hidden] {
    display: none !important;
}

.aw-toggle {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 0;
    background: #111;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}
.aw-toggle .ti {
    font-size: 22px;
}

.aw-panel {
    position: absolute;
    bottom: 64px;
    inset-inline-end: 0;
    width: 320px;
    max-width: calc(100vw - 2rem);
    background: #fff;
    color: #111;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
}
.aw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}
.aw-title {
    font-weight: 600;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.aw-close {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 20px;
    color: #444;
}

.aw-group {
    padding: 0.25rem 0.5rem;
}
.aw-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 10px;
}
.aw-row:hover {
    background: #fafafa;
}

.aw-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}
.aw-steps {
    display: flex;
    gap: 0.25rem;
}
.aw-step {
    min-width: 34px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
}
.aw-step.active {
    background: #111;
    color: #fff;
    border-color: #111;
}

.aw-switch {
    position: relative;
    width: 52px;
    height: 28px;
}
.aw-switch input {
    position: absolute;
    opacity: 0;
}
.aw-switch label {
    display: block;
    width: 100%;
    height: 100%;
    background: #ddd;
    border-radius: 999px;
    cursor: pointer;
    transition: 0.2s;
}
.aw-switch label:after {
    content: "";
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: 0.2s;
}
.aw-switch input:checked + label {
    background: #111;
}
.aw-switch input:checked + label:after {
    inset-inline-start: calc(100% - 25px);
}

.aw-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #111;
    background: #111;
    color: #fff;
    cursor: pointer;
}
.aw-btn.ghost {
    background: #fff;
    color: #111;
    border-color: #ddd;
}

/* Widget tetap normal (tidak terpengaruh scaling/filter) */
#aw-root {
    font-size: 1rem !important;
    --aw-font-mult: 1 !important;
    --aw-head-mult: 1 !important;
    --aw-line: 1.4 !important;
    --aw-h-line: 1.3 !important;
}
#aw-root,
#aw-root * {
    filter: none !important;
    font-size: inherit;
    line-height: inherit;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
