:root {
  --primary: #5b8ef0;
  --primary-dark: #3a6fd8;
  --bg: #f8f9fc;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --danger: #ef4444;
  --success: #48bb78;
  --warning: #f6ad55;
  --nav-height: 64px;
  --banner-height: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

.hidden { display: none !important; }

.tab-content {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  overflow-y: auto;
  padding: 16px 16px 8px;
  -webkit-overflow-scrolling: touch;
}
.tab-content.has-banner { top: var(--banner-height); }

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 4px;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.nav-tab.active { color: var(--primary); }
.nav-icon { font-size: 20px; line-height: 1; }
.nav-label { font-size: 10px; font-weight: 500; }

.conn-indicator {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  z-index: 200;
  transition: background 0.3s;
}
.conn-indicator.connected { background: var(--success); }
.conn-indicator.pending   { background: var(--warning); }
.conn-indicator.syncing   { background: var(--primary); animation: pulse 1s infinite; }
.conn-indicator.offline   { background: var(--text-muted); }

@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.4 } }

.timer-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--banner-height);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  z-index: 150;
}
.timer-text { flex: 1; }
.timer-stop-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-width: 60px;
  min-height: 34px;
}
.timer-stop-btn.left { order: -1; margin-right: 12px; }
