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

html,
body {
    height: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--font-size-md);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.45;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

img {
    display: block;
    max-width: 100%;
}

svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

::selection {
    background: var(--color-primary-soft);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-strong);
    border-radius: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

.no-scroll {
    overflow: hidden;
    touch-action: none;
}

/* Tooltips - helpful hints on buttons (AR/EN via data-tooltip) */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}
/* RTL: keep tooltip centered */
[dir="rtl"] [data-tooltip]::after {
    left: 50%;
    transform: translateX(-50%) scale(0.95);
}
[dir="rtl"] [data-tooltip]:hover::after,
[dir="rtl"] [data-tooltip]:focus-visible::after {
    transform: translateX(-50%) scale(1);
}
