/* ================================================================
   Solo — Base Styles
   Reset, typography, layout primitives
   ================================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  touch-action: manipulation;
  /* Paint the html itself so iOS's rounded screen mask can't reveal a non-cream colour
     at the device corners or behind the status bar in standalone PWA mode. */
  background: var(--bg);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  letter-spacing: -0.05px;
  min-height: 100vh;
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, a, .tab-item, .bill-card, .quick-add-item, .provider-item, .chip, .freq-chip {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); font-weight: 600; }
h4 { font-size: var(--text-base); font-weight: 600; }

.green { color: var(--green) !important; }
.freq { font-size: .5em; font-weight: 400; color: var(--text-dim); }

/* ── App Shell ──────────────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(56px + 32px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}

.screen-content {
  flex: 1;
  width: 100%;
  max-width: var(--content-max-w);
  margin: 0 auto;
  padding: var(--content-pad);
  padding-top: var(--space-6);
}

/* ── Screen Transitions ─────────────────────────────────────── */
.screen-content.transitioning {
  opacity: 0;
  transform: translateY(8px);
}

.screen-content.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--duration) var(--ease),
              transform var(--duration) var(--ease);
}

/* ── Utility Classes ────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); border: 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.w-full { width: 100%; }
.text-center { text-align: center; }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* ── Scrollbar (subtle) ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }
