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

/* No blue flash on tap (mobile) or click: drop the browser's tap highlight and the focus
   ring for pointer clicks. Keyboard focus still gets a quiet themed ring. */
* {
    -webkit-tap-highlight-color: transparent;
}

:focus:not(:focus-visible) {
    outline: none;
}

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
[onclick]:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--border2);
    outline-offset: 2px;
}

:root {
    --bg: #0a0a0a;
    --surface: #111;
    --surface2: #171717;
    --border: #222;
    --border2: #2e2e2e;
    --text: #ededed;
    --text2: #888;
    --text3: #444;
    --success: #3ecf8e;
    --error: #f87171;
    /* Elevation: dark mode leans on borders, so shadows stay faint */
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-btn: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
    --overlay: rgba(0, 0, 0, 0.6);
    --sidebar-w: 240px;
    --sidebar-w-collapsed: 60px;
    --topbar-h: 52px;
    --bottomnav-h: 60px;
}

html {
    font-size: 1rem;
    height: 100%
}

body {
    font-family: 'Geist', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* clip, where supported: no sideways scroll, but body stays a non-scrolling box so sticky bars work */
    overflow-x: clip
}

/* Scrollbars are hidden everywhere; scrolling (wheel, touch, keys) still works */
::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Smooth scroll behavior */
* {
    scroll-behavior: smooth;
}

/* Momentum scrolling on iOS */
.tab-section,
.contacts-list,
.history-list,
.panel {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

/* Scroll fade effect at bottom of panels */
.scroll-fade {
    position: relative;
}

.scroll-fade::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--bg));
    pointer-events: none;
    display: block;
}