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

:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --text: #111111;
  --text-muted: #737373;
  --border: #e5e5e5;
  --accent: #111111;
  --nav-height: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  min-height: 100dvh;
  overscroll-behavior: none;
}

.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Header */
.header {
  padding: calc(16px + var(--safe-top)) 20px 12px;
  background: var(--bg);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.greeting {
  font-size: 14px;
  color: var(--text-muted);
}

.title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text);
  padding: 8px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:active {
  background: var(--border);
}

/* Main */
.main {
  flex: 1;
  padding: 8px 20px calc(var(--nav-height) + var(--safe-bottom) + 16px);
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Section */
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

/* Tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: background 0.15s, transform 0.1s;
  -webkit-user-select: none;
  user-select: none;
}

.tile:active {
  background: #ebebeb;
  transform: scale(0.98);
}

.tile--wide {
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
  padding: 20px 18px;
}

.tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.tile-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tile-title {
  font-size: 15px;
  font-weight: 600;
}

.tile-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* Bottom Navbar */
.navbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  padding: 8px 0;
  cursor: pointer;
  transition: color 0.15s;
}

.nav-item:active {
  opacity: 0.6;
}

.nav-item--active {
  color: var(--accent);
}

.nav-item svg {
  stroke: currentColor;
}
