/* ============================================
   Base — reset, tipografi, aksesibilitas, kerangka app
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: var(--fs-md);
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* pembungkus ikon SVG */
.ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.ico svg { display: block; }

img,
svg,
iframe { max-width: 100%; }

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* Cegah zoom otomatis iOS saat mengisi input */
input,
textarea,
select { font-size: 16px; }

a { color: var(--secondary); }

:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

[hidden] { display: none !important; }

/* ============ kerangka aplikasi ============ */
.app { display: block; }

.app-screen { display: none; }
.app-screen.active { display: block; }

.screen-pad {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 var(--sp-4) calc(var(--sp-5) + env(safe-area-inset-bottom));
}

.screen-head {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4) 0 var(--sp-3);
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg);
}

.screen-head h1 {
    flex: 1;
    font-size: var(--fs-lg);
    font-weight: 700;
}

.muted { color: var(--text-dim); }
.small { font-size: var(--fs-sm); }
.stack { display: grid; gap: var(--sp-3); }

@media (min-width: 768px) {
    .screen-pad { max-width: 640px; }
}
